I’m using a projector to generate underwater caustics and they look great, except for some items that I purchased from the Unity Store. These items are showing artifacts ranging from white planes below the objects to a box-like halo around the object. A sample is below. Is this a shader issue or? Thank you for any assistance.
To be clear, without the caustic projection this looks like a red coral with sand below it – no white planes.
Judging from the screenshot, the issue is that those red coral or whatever objects use alpha (transparent/fade or cut-out modes) material on quads meshes. Projector cannot crop its projection by the alpha channel of the target object which is the result of those white planes. There is no way to make it look perfectly. You should contact the asset provider and ask them to create alternatives which uses mesh closer to the texture shape. It will definitely increase polygon count to some degree which is the whole point of using just quad by that asset provider.
OR if you don’t mind the coral (as well as all alpha objects) to be exempted from projection, just change the layer of these objects to something else, and add that layer to Projector’s “ignore layer” list.
Thank you for those answers. The second part (ignore layer) may be all I need really. It’s not perfect but I don’t think the provider will be inclined to make changes.
By the way, if you’re interested in writing customized shader, it’s possible to overlay a caustics texture which multiplies its alpha value with the coral texture’s, and you can scroll the caustics UV either in your shader or via C# script (for some reason the former is slow on mobile). Obviously the caustics overlaid via shader won’t sync with the projection, it’s just better than nothing.
I’m going to come back and read that solution again when I am competent enough to consider implementing it! But thank you for the information.
Hey I tried the layer solution and it did not seem to work. The projection is still the same as before. Do I need to do anything beyond what you described above? I have the corals on their own layer and have excluded that one from the projector.
Please check the shaders (as well as “rendering mode” in case of Standard shader) for the materials of your caustics projection and corals.
The shader for the caustics material is “Projector/Light” – is that what you are referring to?
Yes, and then what is the shader of the coral object?
Anyway it’s strange that the ignore layer doesn’t work for you. You may reproduce the same issue in a much simpler scene, preferably replace the textures with dummy ones so you don’t end up sharing the paid stuff. Pack it and share here for everyone to inspect the issue.
Success! Your answer was right, I had just not taken it far enough. Each coral object had an entry for “layer”, which I had set as you suggested. What I had missed though was that each object also has three “LOD” objects, and each of these needed to also be set for the ignore layer. I am just learning how LOD works so I did not even think of that. In any case everything looks great now. Thanks again!
Nice to know that. By the way, I think this issue should be given a feedback to Unity technicians so they have a formal record of requested feature:
https://feedback.unity3d.com/
So when you change the layer of 1 mesh object, the editor should ask you whether to apply layer change to all other mesh of the same LOD group, just like when the editor asks you whether to apply layer change to all child objects.
I don’t submit the feedback ticket myself because I honestly have never touched LOD (I mostly focus on particle system). You actually have more experience than me in making a proper feature request of this usability issue.
Actually it did ask me if I wanted to include all child objects, but at the time I was not sure what I was doing (I’m still not!), so I wanted to test the waters. Selecting “yes” after selecting the top-level object seems to set all to the correct layer. In fact I was able to select almost all of the objects at once and set them to the ignored layer. So I think everything is OK, correct?
