Search Unity

Does Shader Graph support built-in rendering?

Discussion in 'Shader Graph' started by joshcamas, May 3, 2018.

  1. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,278
    Hello friends!

    I am currently too far into my current project to be able to utilize the new fancy scriptable render pipeline. However, that shader graph looks mighty fine... can I use it without being forced to switch to the new pipeline?

    Thanks!
    Josh
     
    AntonioModer likes this.
  2. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,278
    Now I see that it is indeed only usable in the new pipelines. It makes sense, however it is also quite disappointing, since my game won't be able to use lightweight (since I need deferred rendering) nor HD (large world, terrain) pipeline. :( I guess I'll just bite the bullet and buy one of those shader addons
     
    twobob likes this.
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Everything I've read implies the answer is no. Currently it only supports the LWRP, and the user can extend it to support their own custom SRP (not sure if their is docs on how to do that yet though, I haven't gone through the tutorial). HDRP currently not supported but it should in a future 2018 build.

    I'm surprised the answer to your question hasn't been explicit, in that most people are going to continue with the legacy pipeline for most existing projects, and only the Lightweight pipeline appears feature complete enough to be taken seriously at this point, so mostly mobile or otherwise constrained platform projects. A lot of people, like myself, would like to take advantage of visual shader development right now, but it looks like for many projects you'll have to continue to hand script them or use a 3rd party shader tool.
     
    joshcamas likes this.
  4. tteneder

    tteneder

    Unity Technologies

    Joined:
    Feb 22, 2011
    Posts:
    175
    Shader Graph 12.0.0 (for Unity 2021.2 and newer) added the Built-In target. From the changelog:

    Added a new target for the built-in render pipeline, including Lit and Unlit sub-targets.​

    I know this thread is rather old, but it's ranked quite high in a web search.
     
  5. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,255
    Awesome news, thanks Unity for supporting this important feature. This will remove a lot of headaches for us developers to support all pipelines from one place even if Built-In dies very soon!

    Quick question: Is the created shader interchangeable between all pipelines of HDRP, URP & Standard in a universal manner?
     
  6. tteneder

    tteneder

    Unity Technologies

    Joined:
    Feb 22, 2011
    Posts:
    175
    Yes, I think that's the intention.
     
    TerraUnity likes this.
  7. emanvidmaker

    emanvidmaker

    Joined:
    Mar 2, 2017
    Posts:
    1
    Just tried and its not, it has some Shader Libraries that depend on the pipeline
     
  8. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    769
    I tried and think it can unless the custom shader (graph) uses pipeline specific nodes (including codes in custom functions) or features.
     
  9. Monil

    Monil

    Joined:
    Apr 24, 2012
    Posts:
    103
    Hello everyone,
    I really disapprove how in these years unity is trying to kill BiRP when URP is not ready and stable yet see constant changes and missing futures, you should make life easier for developers instead of adding layers of complexity. How is it that even having main light color is not possible in shaderGraph target BiRP? Over the years I have tried several times to use URP and had to revert to BiRP, I hope unity makes the right decisions in the future!

    void MainLight_half(float3 WorldPos, out half3 Direction, out half3 Color, out half DistanceAtten, out half ShadowAtten)
    {
    #if SHADERGRAPH_PREVIEW
    Direction = half3(0.5, 0.5, 0);
    Color = 1;
    DistanceAtten = 1;
    ShadowAtten = 1;
    #else
    #if SHADOWS_SCREEN
    half4 clipPos = TransformWorldToHClip(WorldPos);
    half4 shadowCoord = ComputeScreenPos(clipPos);
    #else
    half4 shadowCoord = TransformWorldToShadowCoord(WorldPos);
    #endif
    Light mainLight = GetMainLight(shadowCoord);
    Direction = mainLight.direction;
    Color = mainLight.color;
    DistanceAtten = mainLight.distanceAttenuation;
    ShadowAtten = mainLight.shadowAttenuation;
    #endif
    }
     
    akuno and Unifikation like this.
  10. Liam2349

    Liam2349

    Joined:
    Mar 10, 2016
    Posts:
    83
    Note that under BRP/BiRP, Shader Graph is not compatible with single pass stereo instancing.

    This means Shader Graph will not render correctly for most VR projects using BRP. I'm pretty sure I saw elsewhere that Unity does not plan to fix this.
     
    akuno likes this.