0
votes

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?
1
When you say "distributed version" which platform are you targeting? In theory if you are building a version for your local machine things should work as in the IDE. Without seeing the actual shader though it's hard to answer. - Jerdak
I'm building for Windows x86; I'm running Windows 64 bit. I know the shader is okay, but there is something going on underneath the surface of Unity. I'll try to remove the setting of the depth and see if it that makes a difference. If not, Unity is not updating the shader in the compilation. - RobotRock
Found the problem; I had a backup directory with a copy of the older shaders which were loaded instead of the new ones. - RobotRock

1 Answers

0
votes

Found the problem; I had a backup directory with a copy of the older shaders which were loaded instead of the new ones.