Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

HDRP Surface Shaders?

Discussion in 'Shaders' started by ArchaeopteryxRoboParty, Oct 27, 2021.

  1. ArchaeopteryxRoboParty

    ArchaeopteryxRoboParty

    Joined:
    Sep 15, 2014
    Posts:
    10
    Hi there,

    I'm finally looking to upgrade some projects from Unity 2017. They make heavy use of procedural content on the GPU.

    Currently they mostly use the old school way of RenderTextures as buffers to encode data, then reads those buffers in the Surface Shader - nice and easy to manipulate verts or fragments as needed. Some ComputeShaders/Buffers here and there.

    From what I see in Unity 2021 and the HDRP world, that's not possible anymore? It's all Shader Graph?
    I see some discussion around this from Unity and that something might come along in a few years.

    I can't be the only one who's faced this, and would be curious to hear what paths anyone else has taken?

    I've had a cursory look at Better Shaders, but it doesn't seem to support Unity 2021 (officially at least?).

    BTW these aren't games, they're installations that will only ever run on whatever hardware we spec (basically Windows + RTX cards).

    Many thanks
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,248
    The most common solution currently is:

    Don't switch to HDRP and stick with the built in renderer.

    Better Shaders only supports LTS versions of Unity as otherwise it gets really insane to try and support the asset. There can be significant and breaking changes between sub versions of the same Unity or SRP.
     
  3. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,496
    Shader Graph is basically acting as a more limited surface shader anyways.
    You can make a Custom Function Node to put your HLSL into which when indexes into your buffers or RenderTexture.
    You can manipulate verts and fragment data in shadergraph.
     
  4. ArchaeopteryxRoboParty

    ArchaeopteryxRoboParty

    Joined:
    Sep 15, 2014
    Posts:
    10
    Thanks both.

    It doesn't look like multiple passes are possible in Shader Graph either, which is kind of a deal breaker :s

    I guess sticking to the built-in renderer may be the path of least pain for now.

    I'll investigate the Custom Function Node a little more though, hadn't seen that thanks.