Search Unity

BlendOp Max turns off light attached to Scene view camera

Discussion in 'Shaders' started by Benjamin_Overgaard, Apr 29, 2018.

  1. Benjamin_Overgaard

    Benjamin_Overgaard

    Joined:
    Jul 20, 2015
    Posts:
    17
    I'm modifying the Internal-DeferredShading shader. I don't want additive lighting, so I use BlendOp Max in the first pass of the shader. I get the desired result, however it causes the directional light attached to the Scene view camera to go dark, and I really need that light.

    The directional light in the scene view turns off:



    However, the Scene view camera does manage to show the proper scene lighting in the Scene view:


    I'm blending in the first pass of the deferred shader, since it's the lighting pass.


    I don't have this problem in forward shading, but I need to use the deferred rendering path. Is there a way to fix this or maybe an alternative to using BlendOp Max in order to avoid additive lighting?
     
  2. Benjamin_Overgaard

    Benjamin_Overgaard

    Joined:
    Jul 20, 2015
    Posts:
    17
    I ended up solving the problem by modifying the second pass to use a g-buffer texture instead of the light buffer texture.
     
    Last edited: May 14, 2018