Switching shader back and forth fixes transparency issue?
Ok so I have a planet, with:
1) Water (Unity Standard shader set to simi Transparent)
2) Land (Opaque)
3) Fog of War (solid black color, alpha cutout shader, simi transparent).
When my fog of war is placed above the other two layers, the land turns black as expected, but the water still appears through the fog.
I tried every bloody thing, z-ordering, Transparency+1, +100, +1000, +10000... every wicha way.
Finally I found the fix: I run the game, and while it is running, I select the mesh for the fog in the editor, and select its material, and SWITCH its shader to Particles/alpha blended. Then I switch it back to my custom shader, and bingo, it works perfectly!
Only problem is, and I've verified this carefully, absolutely nothing is different in any settings. Same shader, same textures, same everything. I've done this twice now, worked both times. Why would switching my shader to something else, then back again, fix the issue?
I'm tempted to tell my script to switch the shader automatically. But I cringe to actually use this silly hack fix, especially in production, when I don't even know what the problem is, or why this switching around is fixing it.
Your answer
Follow this Question
Related Questions
Strange Material/Shader Transparency Problem 0 Answers
Random image appears in the center of the screen while using scrollrect 1 Answer
How to make my custom shader transparent? 0 Answers
Custom opaque shader looks transparent 0 Answers
Make albedo transparent and keep the glossiness and reflection visible - standard shader 0 Answers