Search Unity

Question Apply Shader Graph to Camera

Discussion in 'Shader Graph' started by solidsnacksart, May 9, 2019.

  1. solidsnacksart

    solidsnacksart

    Joined:
    May 9, 2019
    Posts:
    1
    Hello there, I am new here so I apologise if this is not the right section. I started using Unity 2019 a few days ago and have been messing with the new Shader Graphs and the visual interface. I was able to apply the graph as a material to a game object, but was wondering if it was possible to instead apply the shader globally to the main camera. For example if there was a visual noise effect I want to apply that to my main camera in addition to the preexisting Post-process Volume stack and settings I have.
     
  2. Ramezov

    Ramezov

    Joined:
    May 2, 2017
    Posts:
    25
    Same here I created black hole shader graph and been trying to apply it to camera since few days and all tries fails.
    I thought assigning the shader graph to material then creating a script attached to camera and applying it using those codes:

    Code (CSharp):
    1. void OnRenderImage(RenderTexture source, RenderTexture destination)
    2.     {
    3.             Graphics.Blit(source,destination, _material);
    4.  
    5.         }
    6.     }
    but seems OnRenderImage not being called at all.