Search Unity

Shader Passing custom attribute from vertex to pixel

Discussion in 'High Definition Render Pipeline' started by CauchyH, Mar 7, 2021.

  1. CauchyH

    CauchyH

    Joined:
    Sep 20, 2018
    Posts:
    2
    In HDRP,
    I could use HDRPLitGraph
    to modify the position/normal/tangent in the vertex shader
    and have the GPU interpolating them and get the result in the pixel shader.

    BUT, I need a way to pass 'custom' data (calculating in vertex shader)
    and let GPU interpolating them,
    and then read them in pixel shader.
    I'm using these data to affect the lighting of HDRPLit. (Surface Color)

    Is there anyway to do it in HDRP?
    Also, I hope I could still use HDRPLit....Instead of writing a blank shader without any lighting....

    OR, does URP has this function?

    Thanks