Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Should I use the built-in renderer or HDRP for my custom shader?

Discussion in 'Shaders' started by Dawesign, Aug 21, 2019.

  1. Dawesign

    Dawesign

    Joined:
    Jan 26, 2019
    Posts:
    4
    I want to create a photorealistic island scene for which I want to create an ocean shader that uses tessellation. Now as far as I understand using the new HD render pipeline will help achieving photo realism more easily than using the built-in renderer. However after some research it seems like it's quite unintuitive to create custom shaders for the HDRP. As far as I understand I could only create custom shaders using the new shader graph which puts limitation on what would be possible by coding it in the built-in renderer. In my specfic example there doesn't seem to be a node yet that supports tesselation for example. (I also don't want to use the amplify shader plugin since it's another dependancy that needs to be updated etc.) Already having some experience with the graphic workflow benefits of HDRP, choosing the built-in renderer seems like a step back for me. Not sure where to start now... Is there a way to create custom coded shaders in HDRP anyways? Does the "standard surface shader" still work in HDRP?
     
  2. Namey5

    Namey5

    Joined:
    Jul 5, 2013
    Posts:
    188
    In theory, yes. HDRP is just an asset that you apply to your project - Unity itself remains the same. SRPs only render specific passes, however. Not only that, but the primary shader language has switched from CG to HLSL (which shares a lot with CG but isn't identical). As such, to answer your second question;
    No. SRPs have to pass all shader variables in manually - and the global shader variables on which the old custom shaders rely (especially surface shaders) are now completely different. If you want to create a custom shader, you have to do pretty much everything by hand the new way (and specific to the pipeline of your choice). To get started, I would suggest looking at the HDRP repository so you can see how the standard lit shader is written (spoiler; it's a lot of include files).

    https://github.com/Unity-Technologi...nity.render-pipelines.high-definition/Runtime
     
    Dawesign likes this.
  3. Dawesign

    Dawesign

    Joined:
    Jan 26, 2019
    Posts:
    4
    Thank you for the elaborate answer! I guess in that case I will actually make myself familiar with the Amplify Shader Editor plugin to achieve what I want to do as I'm not very keen to study all the jazz that comes with HDRP and custom shader coding at this point.