I am curious on how to modify the object shader, FOW.shader, to achieve this (as quoted from another user):
"If you check the thread on the Unity forums, people have used this package with mobiles, however it has to be done by modifying the object shaders instead. The idea is to not have a post-processing effect (image effect), but to have the shader used on your game objects actually sample the fog inside. This way you reduce fillrate, making it suitable for mobile platforms with next to no performance loss over not having the fog enabled."How would I create a shader to sample the fog? I figure I have to write a cg shader to create a sampler2d of the pixel on the first pass, and then using that information, if the fog is in front, then don't render the pixel?
I have had cg shader experience, but I could never get sampling to work, as I tried to create a font that changes color based on previous pixel color to black or white. I could get the shader to take a color as an input and then change color based on that, but never could sample a second pass to handle the color.
Can somebody give an example shader that achieves this? Or post one that has been created?
All help is appreciated!
