Search Unity

Vertex displacement shader in HDRP

Discussion in 'Shaders' started by Reverend-Speed, Jul 20, 2019.

  1. Reverend-Speed

    Reverend-Speed

    Joined:
    Mar 28, 2011
    Posts:
    284
    Folks, I'm confused. I'm a moderately experienced Unity dev just starting with HDRP and I'm having trouble figuring out what documentation I should be using and if any of my old shader knowledge is applicable.

    Is it possible to write a vertex displacement shader for HDRP in code, or am I required to use Shadergraph?

    Can anybody point me towards useful documentation they've found on these topics?

    Very much appreciated, I'm not entirely sure where to start with this topic.
     
  2. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    There isn't much documentation for it yet since HDRP is still a work in progress. Your best bet is to just look at the Lit shader in the HDRP assets, make a copy and modify it to your needs. If you understand vert/frag decently well, not just Unity's "surf" system which isn't used in these new pipelines, then you should be fine modifying it to do your vertex displacement

    You could also just make it in ShaderGraph, there's a Code Function node now that you can actually write you code in and plug the output to the master node's position input.
     
  3. Reverend-Speed

    Reverend-Speed

    Joined:
    Mar 28, 2011
    Posts:
    284
    Thanks @Invertex. I don't know if I'd say I understand vert/frag decently well - only authored a couple of shaders - so I think I'll take your advice and try and get things working with ShaderGraph. Much appreciated...!