Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Feedback Wanted: Scriptable Render Pipelines

Discussion in 'Graphics Experimental Previews' started by Tim-C, May 9, 2017.

  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,839
    playing around with unity 2018.1.0b2 on os x el capitan and the lightweight srp i came across a point where _MainLightPosition suddenly changed from the normalized position of the directional light to a value like (7.2, 0.35, 4.9, 1) – depending on the orientation of the camera.
    should _MainLightPosition not always contain the direction of the most important directional light and never any far away point or spot light?
     
  2. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,845
    @Tim-C
    Guys,
    Please add support to Gather, GatherRed and the likes in 2018. SRP is nice but without proper API support it won't allow us to tap into the latest hardware capabilities to improve/speed things up even further.
     
  3. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    359
    May be I have missed something, but does SRPs support pixel local storage for now?
     
  4. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    It's in the new shader library: https://github.com/Unity-Technologi...line/Core/CoreRP/ShaderLibrary/API/D3D11.hlsl

    Yep we support it. Easiest way is via RenderPasses. Take a look at this tesbed pipeline for some examples:
    https://github.com/Unity-Technologi...aster/TestbedPipelines/OnTileDeferredPipeline
    https://docs.unity3d.com/ScriptReference/Experimental.Rendering.RenderPass.html
     
  5. cfree

    cfree

    Joined:
    Sep 30, 2014
    Posts:
    58
    Wow!

    Definetely excited about the "Volumetrics" commits, and about the branch "PlanarReflections" (related to the HD Render Pipeline).
     
  6. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,888
    Trying to build a Windows 64 Bit Standalone Player of the provided "LightweightNightmareWithSGraph" example, causes the build to fail with the following error message:
     
  7. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    ahhhh looks like this should be wrapped in an #if UNITY_EDITOR we will fix. You can edit this cs file if you can't wait.
     
    Peter77 likes this.
  8. cfree

    cfree

    Joined:
    Sep 30, 2014
    Posts:
    58
    Hi @Tim-C!
    Please, two questions abou the release of HD Render Pipeline:
    --> What are the plans for Planar Reflections? It will be part of the first release of HD Render Pipeline (2018.1)? The branch is under development, i saw that are commits from today :)
    --> There are a few commits for Volumetric Lighting in the main branch... does this mean that it will be in 2018.1? Could you describe what features are planned on this topic?
    Thanks a lot!!!
     
  9. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    201
    @Tim-C
    "Realtime GI" is mentioned in this document, it's only supported in the HDRP.
    Is this the pre-computed realtime GI that we currently have, or a "true" real-time GI solution like SEGI/SVOGI/VXGI?
     
  10. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    332
    Starting with these facts (source):
    • No Dynamic GI, Motion Blur and SSR in Lightweight
    • Only PC, Xbox One and PS4 supported on HD
    It looks like Unity's current rendering method sits somewhere in between the two envisionned Lightweight and HD pipes, as it supports GI as well as the full Stack.

    I personnally liked the fact Unity allowed us to easily create and port our game on PC, PS4, Xbox One, VR, Switch and Tegra-based Android TV without much hassle.

    Don't get me wrong: I'm excited about the features brought into the HD Pipeline, but I think it's a bit sad that it means we'll now have to either downgrade our standard to support all the platforms, or say goodbye to Switch and other nice lower end platforms.
     
  11. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,331
    Or you can just copy HD and strip it down a bit or copy LW and add what you feel your game needs to it. I think someone will do it before long.
     
  12. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,063
    Soon mobile phones will be faster than PS4
    Then what will happen to the HD support for mobile?

    Same for Mac, iMac pro 18 core is almost out

    Unity Legacy Pipeline seems better than Lightweight for now.
     
  13. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    804
    It is using a ton of shader keywords, will that change? I'm deleting shader after shader to release one or two shader keywords, but the SRP keywords are really... plentiful.

    Edit: nevermind, seems to be another bug or legacy stuff. Shader Control says my project uses 68 keywords, most of them in the default shaders. A new project with the srp shaders takes about 50, so it shouldn't be over 256.

    Or do disabled keywords count, too? The new lit shader uses 70 alone.
     
    Last edited: Jan 20, 2018
  14. freedomize

    freedomize

    Joined:
    Aug 6, 2015
    Posts:
    30
    Does the HD rendering pipeline work with the nintendo switch?
     
    Lars-Steenhoff likes this.
  15. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    213
    Is it possible in HD rendering pipeline in default Lit shader use specular map texture ?
     
  16. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    804
    If you change the material type to "Specular Color", you can plug in a specular color map.
     
  17. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    213
    But, what to do if I want to use material type: Subsurface Scattering with specular map texture ?
     
  18. discofhc

    discofhc

    Joined:
    Dec 18, 2017
    Posts:
    39
    I did not find the options to create or use a Render Pipeline (LW) in Unity 2018.1 beta... do i need to download the Github code to allow this feature? I thought that it was built-in in 2018.1, no need to download separately...
     
  19. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    396
    We're still in beta. They'll be adding it eventually in a future beta. For now, download the github code.
     
    discofhc and cfree like this.
  20. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    396
    How is terrain being handled now? Is there a built terrain shader for HD? Is it running off the same terrain editor stuff (albedo + normal) and associating Metallic/Rough/Height/AO some other way? Or are we still going to need to either roll our own shaders or purchase someone else's in order to have modern terrain in HD?

    I'm all for extending and customizing using Shader Graph (or ASE), but I really really hope that there will be a built in way to handle terrain now and we won't be forced to roll our own graph just to use terrain.
     
  21. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,888
  22. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    We've reduced this a lot already over the past few weeks. We have a bit more to go but we are getting near 0.
     
    Peter77 likes this.
  23. Finepointcgi

    Finepointcgi

    Joined:
    Jul 5, 2017
    Posts:
    14
    hey @Tim-C ,
    Im running into a problem where it wont initialize saying that im

    Assets/scriptablerenderpipeline/ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs(5,32): error CS0234: The type or namespace name `GlobalIllumination' does not exist in the namespace `UnityEngine.Experimental'. Are you missing an assembly reference?

    and im not sure exactly where I would get that. I did the git and grabbed the post effects but still its not working. I have tried unity 2018 (failed with package management error)and 2017 (failed with this error).

    Any ideas?

    Mitch
     
    Last edited: Jan 22, 2018
  24. freedomize

    freedomize

    Joined:
    Aug 6, 2015
    Posts:
    30
    Do you plan to support Nintendo Switch in the HD rendering pipeline?
    Does the LW Pipeline works faster than the current pipeline (forward rendering) on modern mobile devices (Tegra X1 for example)?
     
  25. tspk91

    tspk91

    Joined:
    Nov 19, 2014
    Posts:
    84
    Are there any plans for shadows or per-cascade culling masks?
     
  26. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,366
    @SebLagarde Oh I forgot about this, do we have access in for light cookies uv in SRP? could be usefull for doing cloud shadows
     
  27. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    514
    I have struggled (without luck) to implement shadows using CommandBuffer and DrawProceduralIndirect. What is the prospect of getting this to work with SRP?
     
  28. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    416
    Current HDRP version in the Package Manager is 0.1.21, Github is 0.1.26.

    When could we expect to see an update? @Tim-C @SebLagarde
     
  29. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    213
    I want to share with these screenshots made with SRPHD with Unity 2018.1.0b4
    Standard HD Lit shader with sss settings.
    On a 4K monitor looks awesome.
    I can't wait for shader graph working in SRPHD.


     
    cecarlsen, quixotic, cfree and 3 others like this.
  30. WilkerLucio

    WilkerLucio

    Joined:
    May 2, 2017
    Posts:
    18
    Yes! I wanted this is exactly what I wanted to see, since I don't have any compute capable hardware...
     
  31. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    There is a staging and a release repository, we do frequent releases to the staging area, but don't promote all releases. If you want to use a staging release you can manually modify the project manifest files.
     
    JakubSmaga likes this.
  32. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    213
    Nope - Failed to resolve packages: Package [com.unity.render-pipelines.high-definition@0.1.26] cannot be found :(
     
  33. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    {
    "registry": "https://staging-packages.unity.com",
    "dependencies": {
    "com.unity.render-pipelines.high-definition" : "0.1.26"
    }
    }

    are you pointing to the staging repository?
     
  34. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    You need to emit them. Check out the code on the github for the lightweight pipeline.
    https://github.com/Unity-Technologi...ightPipeline/LWRP/LightweightPipeline.cs#L321
    Code (csharp):
    1.  
    2. #if UNITY_EDITOR
    3. // Emit scene view UI
    4. if (sceneViewCamera)
    5.     ScriptableRenderContext.EmitWorldGeometryForSceneView(camera);
    6. #endif
    7.  
     
  35. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    This was marked public when it (for now) should be internal. We want to have specific scene culling to make life easier, but we are not there yet and the API leaked a little early ;)
     
    hippocoder likes this.
  36. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    Some things got renamed between 2017 and 2018, try using the latest beta of unity or a version tagged for 2017 :)
     
    Drezzel likes this.
  37. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    hippocoder likes this.
  38. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    213
    With staging works, but throwing nonstop errors:

    ArgumentNullException: Argument cannot be null.
    Parameter name: value
    UnityEngine.MaterialPropertyBlock.SetTexture (Int32 name, UnityEngine.Texture value) (at C:/buildslave/unity/build/Runtime/Export/Shader.cs:159)
    UnityEngine.Rendering.PostProcessing.Dithering.Render (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at C:/ProgramData/Unity/cache/packages/staging-packages.unity.com/com.unity.postprocessing@0.1.7/PostProcessing/Runtime/Effects/Dithering.cs:31)
    UnityEngine.Rendering.PostProcessing.PostProcessLayer.RenderFinalPass (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context, Int32 releaseTargetAfterUse) (at C:/ProgramData/Unity/cache/packages/staging-packages.unity.com/com.unity.postprocessing@0.1.7/PostProcessing/Runtime/PostProcessLayer.cs:899)
    UnityEngine.Rendering.PostProcessing.PostProcessLayer.Render (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at C:/ProgramData/Unity/cache/packages/staging-packages.unity.com/com.unity.postprocessing@0.1.7/PostProcessing/Runtime/PostProcessLayer.cs:692)
    UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.RenderPostProcess (UnityEngine.Experimental.Rendering.HDPipeline.HDCamera hdcamera, UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.PostProcessing.PostProcessLayer layer) (at C:/ProgramData/Unity/cache/packages/staging-packages.unity.com/com.unity.render-pipelines.high-definition@0.1.26/HDRP/HDRenderPipeline.cs:1616)
    UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.Render (ScriptableRenderContext renderContext, UnityEngine.Camera[] cameras) (at C:/ProgramData/Unity/cache/packages/staging-packages.unity.com/com.unity.render-pipelines.high-definition@0.1.26/HDRP/HDRenderPipeline.cs:930)
    UnityEngine.Experimental.Rendering.RenderPipelineManager.DoRenderLoop_Internal (IRenderPipelineAsset pipe, UnityEngine.Camera[] cameras, IntPtr loopPtr) (at C:/buildslave/unity/build/Runtime/Export/RenderPipeline/RenderPipelineManager.cs:29)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    It's unusable even on new project :(
     
  39. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    Not sure whats happening here, can you try deleting your library folder?

    Anyway like I said, this is a non public release version that has not been through QA. There is a reason it's not promoted to a release yet.
     
  40. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    213
    Ok - I'll wait for public release.

    BTW - how to prevent opening new floating inspector window every time on play button ?
     
  41. Kumo-Kairo

    Kumo-Kairo

    Joined:
    Sep 2, 2013
    Posts:
    331
    Couldn't really find any info on this, but is it currently possible to build LWRP (on a device) from the Editor? Sources look like they need to be conditionally compiled from sources from the Unity Editor itself - https://github.com/Unity-Technologi...line/LWRP/Data/LightweightPipelineAsset.cs#L1
    But compiling it beforehand imprints that `using UnityEditor` statement in a .dll, not allowing it to be excluded in runtime player builds. I've double-checked that by decompiling the package that is supposed to live in runtime (`LightweightPipelineAsset`) and it really includes that `using UnityEditor`

    upload_2018-1-25_16-58-43.png

    So builds fail with a "can't use UnityEditor in builds" error:
    Code (CSharp):
    1. C:/ProgramData/Unity/cache/packages/staging-packages.unity.com/com.unity.render-pipelines.lightweight@0.1.21/Data/LightweightPipelineAsset.cs(2,19): error CS0234: The type or namespace name `ProjectWindowCallback' does not exist in the namespace `UnityEditor'. Are you missing an assembly reference?
    Is there a way to actually build the built-in LWRP that comes as a package dependency without needing to put the whole LWRP source folder inside Unity?
     
  42. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    This has been fixed for the next release.
     
    tatoforever and Kumo-Kairo like this.
  43. Kumo-Kairo

    Kumo-Kairo

    Joined:
    Sep 2, 2013
    Posts:
    331
    So uGUI rendering pipeline still can't be "rescripted"?
     
  44. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    No this is a closed system similar to particles and such.
     
  45. Kumo-Kairo

    Kumo-Kairo

    Joined:
    Sep 2, 2013
    Posts:
    331
    @Tim-C I have a few other questions if you don't mind.
    This new SRP system looks like it's less "extensible", that is, it's either taken as it is or rewritten completely (from LWRP sources or from scratch). Which is absolutely awesome for in-studio projects. But it's not completely clear what is the best practice for Assetstore plugins that need to "extend" the default pipeline for "just a bit".
    What is the best way to approach adding a post-processing pipeline to the LWRP without the need of writing a whole new Rendering Pipeline (so customers can stick to the built-in one)?
    I see that there's a call to the Command Buffers after everything has rendered https://github.com/Unity-Technologi...ightPipeline/LWRP/LightweightPipeline.cs#L360 but it seems like an internal thing at it's not clear how uGUI is handled in different rendering modes (overlay / camera)
     
    dadude123 likes this.
  46. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    787
    Will the standard renderer stay as it is right now forever? (ie with no updates?)
    Or will it be rewritten as a scriptable render loop implementation?
    Will it be recommended to switch away from the standard renderer to either HD or LD renderloops because the current renderer will be deprecated?
     
  47. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    We are talking this week about adding potential hook points into both the LW / HD pipe. The hard part is that any hook points make it much harder for us to change / improve / refactor internals as they will potentially break asset store plugins. We know we need a solution here though.

    Overlay is handled by core unity after everything is blit to the screen... it's not scriptable. Camera mode just emits geometry into the scene that get rendered as part of the pipeline at a position that depends on their material / sort oder and similar.
     
    chiapet1021 and Kumo-Kairo like this.
  48. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    Forever is a long time... What I can say is we won't be adding new functionality into the old renderer, and as some stage we will deprecate it.

    In terms of functionality we will probably grow the LW pipe to be closer to the legacy, it will not have the same shader API though

    If you are staring a new project on 18.1 we recommend investigating the new pipelines, we don't recommend switching a project that is in production.
     
    tatoforever and dadude123 like this.
  49. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    416
    Wasn't LW going to be a 2018.1 release? Why was it moved to 2018.2? https://unity3d.com/unity/roadmap

     
  50. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    It available and usable in 18.1 in preview. We just want a little more breathing room to make sure it works well on all devices and use cases. Right now we need to do a bit more work on performance and shader cache size. It will still work in 18.1 and is available from the launcher. :)
     
    Kumo-Kairo, Corvwyn and JakubSmaga like this.