I have an annoying problem. I have a shader which works fine in the Unity SDK, but displays wrong alpha values in the distributed version. I am using the alpha channel of the framebuffer to implement godrays (as I cannot rely on the depthbuffer as it is "tainted" due to using (frag)depth). The result is that godrays are shown on objects which are opaque. Another shader, which is almost just like the shader described above, does work fine in the distributed version. The difference is I am setting the (frag)depth in the first shader and not in the latter. I have tested with Opengl as well as DirectX and both show the same problem.
My shaders are positioned in the resources folder, and I have made an adjustment to the compiled version of the (first) shader to make the (frag)depth work.
Two problems stand out:
- Why does it work in the SDK but not in the distributed version?
- Does this have anything to do with (frag)depth?