Search Unity

Question Image Effects with Vertex Colors in scene from Camera

Discussion in 'Shader Graph' started by Gabestronaut, Aug 14, 2020.

  1. Gabestronaut

    Gabestronaut

    Joined:
    Oct 21, 2013
    Posts:
    5
    I am creating image effects and would like to know if there is a node or method that access the scenes objects' vertex colors captured by the camera as an input. Using universal render pipeline and 2019.4
     
  2. Oxeren

    Oxeren

    Joined:
    Aug 14, 2013
    Posts:
    121
    You can't directly get vertex colors in image effects. One way to achieve this is to add a renderer feature that renders all (or only required) objects with a replacement shader (just an unlit shader that outputs vertex color) into a separate render texture, and then you will be able to sample this texture in your image effect.
     
  3. Gabestronaut

    Gabestronaut

    Joined:
    Oct 21, 2013
    Posts:
    5
    Thank you for the help Oxeren
    I managed to add a new rendering feature, make a vertex color shader/material, and had the material be an override.

    So this appeared to work pretty good but objects like the terrain are not affected at all. Even by layer.
    The other thing is I am not quite sure how to pass the result onto a render to texture.