Search Unity

Adding HDRP Lighting to Vertex Fragment Shader (compute buffer in use)

Discussion in 'High Definition Render Pipeline' started by keromonkey, Dec 8, 2021.

  1. keromonkey

    keromonkey

    Joined:
    Jan 16, 2019
    Posts:
    42
    Hello, I am using DrawMeshInstancedIndirect to draw a grass mesh multiple times, positioned by a compute buffer. I've managed to convert the material shader from surface shader to vertex fragment in order to get it to work in HDRP. However, I'd like to add HDRP lighting to it, as currently it is unlit. grass dude.png

    Have considered darkening the grass color to correspond w/ the main directional light in the scene/time of day, but then it would not react to the player's light or other light sources.

    Have considered remaking shader/material in shader graph, but research says shader graph doesn't currently support compute buffers/instancing.

    For reference, I am currently in Unity 2021 and have HDRP 12 installed.