Occlusion culling and transparent objects. Occlusion forced disabled.

Hi, today unity again “surprised” me.

Basically it looks like it is forcibly disabling my static transparent objects from being an occluder.

You might be asking why would anyone want a transparent occluder ?

Example:
Imagine this situation, you will have a “dense fog”/“occluding effect” in particular place that will act as an occluder. This effect will not be present in editor but it will be generated at run-time. The solution would be to create a placeholder in edit mode and then just swap it’s material for invisible at runtime.

Problem is that I cannot have opaque placeholders on scene in editor since this will make my scene completely cramped and not readable.
Solution was to make this placeholders transparent - but as I said it looks like it is not working.

Have you got any idea ?

If I remember correctly it used to just put out a warning, are you sure it actually prevents you from doing it?

Also, I don’t think you can add occluders at runtime (unless something changed recently) so I’m a little confused by your description.

I’m pretty sure, just tested it two times with one big wall made out of cube.
No I cannot add occluders runtime. That’s why I need to add occluder placeholder during editor - than at runtime add invisible material to it and spawn my final object at the same position.

You could have opaque geometry that is editor only, add a script that disables it on play (so if you play in editor you don’t see it) and if you’re using a new-ish version of Unity also toggle the visibility so you also don’t see it in scene view.

7437236--911417--upload_2021-8-21_19-45-19.png

Now that I’ve said all that, I do think that stopping a mesh from acting as an occluder because it has a transparent material is pretty stupid. A warning was enough.

Its stupidity is on par with being unable to move lightmapped objects in scene view when in play mode because “it would make things look wrong”, which is a behavior that they changed, completely breaking my workflow, but they won’t change back because they are afraid of breaking people’s workflows.

I want to see it in editor, but I want it to be semitransparent so I can see other objects also.

Did not know about this.
But non static light-mapped objects also cannot be moved ?

I’m out of ideas, sorry :confused:

Yeah, having just the “contribute GI” flag turned on and nothing else causes the behavior I described, also see a handy gif here : https://discussions.unity.com/t/671187/10

1 Like