- Home /
How do I prevent GlobalFog from obscuring particle shaders?
I'm building a flying game, and I'd like to use global fog to have a low haze over the ground. Problem is, even when I'm flying well above the fog, the particles my character emits are obscured by the fog, far, far below. Seems like a clunky draw order thing. How do I force the particles to draw last?
I'm using the GlobalFog.js script, which references the Hidden/GlobalFog shader. The particles are mostly mobile/particles/additive
It's a bit curious that I don't have this issue with the standard, depth-only based fog. I'm no expert with unity shaders though, so I assume there's a straightforward fix.
Answer by Charles-Van-Norman · Oct 07, 2015 at 07:00 AM
Quote from this article: http://forum.unity3d.com/threads/global-fog-and-transparent-shaders.123803/
Hi Bren, just write @ImageEffectOpaque in the line just before the function OnRenderImage of the GlobalFog.js script. It should work. Also take a look at the EdgeDetectEffectNormals.js script , @ImageEffectOpaque is present there in the right location.
Turi