Question

I'm seeing issues on iOS builds for code that works fine on my Mac. With fog turned on, I'm seeing unpredictable, generally undesired rendering results, but only when writing to gl_FragColor.a at the end of my shaders. If I work with a temporary variable, and assign to all four channels of gl_FragColor with it, I see what I expect. Is this to be expected, or is it a problem with Unity? (With these problem shaders, I'm getting different results if I delete, as opposed to commenting out, fragment shader code, so I bet it's the latter, but if you feel comfortable answering, you hopefully know better than I do.)

Was it helpful?

Solution

Fog? You're using an OpenGL shader; there is no fog, unless the shader defines how it works. Are you relying on some per-vertex value passed to the fragment shader to do fog for you?

Unless Unity is amplifying or altering your shader in some way, fog is not something that should be out of your control.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top