Title is a bit self explanatory. In BIRP if I use “BlendOp Max” in the ForwardAdd pass of a vert/frag shader, the directional light cookie disappears. I tested this with a very simple white cookie on a directional light. I am trying to understand why this would happen functionally but can’t. It feels like a bug. Anyone seen anything similar to this?
It would make some sense if it was just the dark part of the cookie that was eliminated since it would be darker than the ForwardBase result in the RT, but the surface gets very dark when Max is used as if the light isn’t processed at all even with a white cookie.
Thanks!
It seems this has been partially fixed in later versions. It doesn’t reproduce on Unity 6 in a way that completely eliminates the cookie, however it is significantly darker which is also unexpected.
In this example in Unity 6, the lighter cube face is without BlendOp Max and the darker is with it. This is a single pass ForwardAdd shader. One would expect the output of the shader to be the brighter value and that to always be taken. The cookie is pure white in the whiter section.
EDIT: nevermind, accidentally added Max to base as well in this example, just in ForwardAdd it is working correctly in 6. I’ll work back to see which version of Unity this was fixed in.
There is more than meets the eye to this. It only doesn’t change color if the shader has a deferred pass. If it’s just a ForwardBase and ForwardAdd pass, then it does change color. I see now the deferred pass overrides the forwardbase/forwardadd if it exists. There is no forward draw call in the frame debugger. So it is just ignored.
ok, the behavior is still the same with only the forward passes. The color is significantly changed with BlendOp Max.