Yes, fog is a shader thing 🙂
For the records, I'm the author of this fog asset, called Volumetric Fog & Mist. I've achieved to make the standard Unity SpriteRenderer and normal sprites work well with the fog, thanks to a custom shader. So yes, it's possible to mix global image effects that takes into account z-buffer with sprites.
here's a video showing the issue:
My goal is to make Spine sprites compatible with fog as well.
Let me explain what's going on in the video:
- You can see an Elephant sprite, that uses standard SpriterRenderer and a custom shader called Sprite Fog (there're two variations, Unlit and Diffuse). This custom shader allows sprites to throw shadows and to blend correctly with fog.
- You can see how the Elephant is moved to the back and to the front, crossing the fog properly and getting hidden when it's beyond the minimum distance of the fog. And the Elephant is just a 2D Sprite!
However, I can't achieve the same result with the spine sprites even when I have assigned them the same custom sprite shader than the Elephant. The character either shows on top of the fog or if I uncheck the render before transparent objects property of the fog image effect, the character will not blend correctly with the fog, as it's cut by it as if it was not there (notice that the character is getting hidden in front of the fog and it should not).
I can send you a private copy of this test project in case you think you can help me and other customers solve this issue (in fact I'm contacting you in the name of one of my customers who is also using Spine for their Unity characters).
Hope we can both get to the end of this issue.
Thank you in advance.