Search Unity

Feedback Wanted: Scriptable Render Pipelines

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

  1. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,299
    MSAA doesnt work yet but others do. You set them up using post-process layer on your camera - there are Anti-aliasing modes of FXAA, SMAA and TAA available there.

    edit - sorry I was too late with this reply, others beat me to it!
     
  2. rizu

    rizu

    Joined:
    Oct 8, 2013
    Posts:
    1,159
    I do hope they'll also fix forward only when using Shader Graph shaders. It will be a difficult road ahead to use HDRP with forward only if one can't easily author custom shaders for it.
     
  3. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    216
    thanks, I forgot about pplayer placed in camera ;)
     
    elbows likes this.
  4. f1ac

    f1ac

    Joined:
    May 23, 2016
    Posts:
    64
    I've noticed linear and exponential fog started filling lower hemisphere of my custom HDRP procedural sky with something like ambient color since Unity 2018.2, tried different versions of HDRP (2.0.1 - 3.0.0), but the effect is still there:

    Linear fog:
    CaptureLinear.PNG

    Volumetric fog:
    CaptureVolumetric.PNG

    Is it an optimization gone wrong? (Sun bloom is just a post-effect, so it overlays the thing)
     
    Last edited: Aug 2, 2018
  5. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    441
    Currently Volumetric don't support Heightfog, what you see with linear/exponential fog is the heightfog that make your image dark in the lower part.

    Heightfog is multiply by distance fog, if you don't want height fog to affect you, setup it to a high value (to 1) and play with fog distance
     
  6. o-san

    o-san

    Joined:
    Jun 23, 2018
    Posts:
    10
    I'm trying to get to grips with the new beginCameraRendering callbacks but I can't get the callback to trigger my prerender function. This is my setup:

    Code (CSharp):
    1.     public static event Action<Camera> beginCameraRendering;
    2.     void Start()
    3.     {
    4.         cam = GetComponent<Camera>();
    5.         beginCameraRendering += PreRender;
    6.     }
    7.  
    8.     public void PreRender(Camera camera)
    9.     {
    10.         Debug.Log("PreRender "+camera.gameObject.name);
    11.  
    12.         if (camera == cam)
    13.         {
    14.             // do stuff
    15.         }
    16.         else
    17.         {
    18.             // do stuff
    19.         }
    20.     }
    I got two cameras in my scene. Am I correct to expect it to log both camera names although the script is only attached to one of the cameras?

    I'm using Unity 2018.2.2f1, any help appreciated!
     
  7. Dudledok

    Dudledok

    Joined:
    Oct 24, 2013
    Posts:
    110
    Use
    RenderPipeline.beginCameraRendering += PreRender;
     
  8. Laurens-Paladin-Studios

    Laurens-Paladin-Studios

    Joined:
    Apr 25, 2015
    Posts:
    49
    Hi There Unity,

    Is there any timeline on a LWRP specific post processing stack?

    Cheers
    Laurens
     
  9. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,299
    I see a github branch for this now :) I wont even attempt to try it until 2018.3 beta is available.
     
  10. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,544
    Is that "ScriptableRenderPipeline 2.0.1-preview1"?

    Thanks
     
  11. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,544
    Feedback so far:
    A complete nightmare to actually get working. I haven't managed to get the errors out of the project that come with downloading the scriptable render files. I definitely couldn't get Book of the dead assets to appear in my project nor any of my assets to appear in the BOTD project.
    Seems like eye candy for advanced programmers. A bit like giving programmers new terrain tools or some other art feature. Would they ever use it?

    Meaning it's unlikely to be usable except for advanced studios (which is fine in a way because we want advanced studios to have advanced opportunities)

    In summary seeing how beautiful things look and realising you need a huge amount of programming & engine expertise to get it working is probably going to be frustrating rather than satisfying for most. It's almost as though we're being misled.

    There's a lot of talk about how it works but I cannot see any step by step guide?

    Anyways, looking forward to seeing if I can get HDRP working outside of Unity Demos.
     
    Last edited: Aug 12, 2018
  12. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    550
    It's actually really easy to setup, you just haven't seen the proper way to do so, someone explained it to you or you didn't take the time to figure it out.

    One step for a New Project
    Create a new project with the HDR/LW template

    upload_2018-8-12_2-40-21.png

    Two steps - Upgrading a project (will be more for setting up a scene but this will get everything rendering/working)

    Open the project and get HDRP/LWRP from the Package Manager

    Upgrade the project materials to work with HDRP/LWRP
    upload_2018-8-12_2-43-11.png

    Steps to get the book of the Dead project working are at the top of the description on the Asset Store in bold.
     
  13. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,544
    Thanks I had totally missed the new formats on Create New Game window.
     
  14. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,476
    Don't forget you don't need to add shadergraph and you don't need to add SRP from package manager. Simply adding HDRP (or LWRP) will quietly bring in all the dependencies required.

    I mention this because the people I train and assist fall foul of these issues often, so just a heads up!

    The way I did it was simply to select a new HDRP project from the template then update it with package manager. This way, I got an example scene and a nice quick start. So people interested in having a look hassle free could try that.
     
    AaronC likes this.
  15. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,372
  16. Dudledok

    Dudledok

    Joined:
    Oct 24, 2013
    Posts:
    110
    Having an issue with a project that's using LWRP and TMPro.

    Any TMPro elements will be rendered before anything else after the first time the game is run, and will persist into the editor. For clarification, the text will correctly be displayed based on its hierarchy position until I run the game once where it will be rendered before anything else (i.e. it can't be seen because it's behind every other element on that canvas) despite the hierarchy not changing. If I then create new TMPro components they will be rendered behind the UI as well. Using the Frame Debugger I can see they're being rendered first when they weren't before.

    Has anyone experienced this or know what might be causing it?

    I can set the TextMeshProUGUI GameObject to be the child of a canvas with Override Sorting enabled and Sort Order to be anything greater than zero, but then I'd need to go through my entire hierarchy and add canvases all over the place, ensure pop-ups have higher sorting, etc.
     
    Last edited: Aug 16, 2018
  17. partha-d

    partha-d

    Joined:
    May 28, 2018
    Posts:
    8
    How to call Camera Rendering Events e.g. OnPreRender(), OnPostRender() or OnRenderImage() from SRP RenderLoop. If not possible then what are its equivalent??
     
  18. partha-d

    partha-d

    Joined:
    May 28, 2018
    Posts:
    8
    Hi
    How can I hook the Camera rendering events like OnPreRender, OnPostRender, OnRenderImage into SRP render loop .
    If not possible what are their equivalents in SRP
     
  19. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    284
    https://forum.unity.com/threads/fee...e-render-pipelines.470095/page-8#post-3408481

    The closest match you can find are those:
    • public static event Action<Camera[]> beginFrameRendering;
      Called when SRP rendering begins. Do things like make frame dependent geometry or similar from this callback. Called by default in HD / LW pipe. If you write a custom pipe you need to issue the call yourself.

    • public static event Action<Camera> beginCameraRendering;
      Called when camera rendering begins (per camera). Do things like camera dependent effects (planer reflection) or similar from this callback. Called by default in HD / LW pipe. If you write a custom pipe you need to issue the call yourself.
     
  20. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    669
    Some errors I got in console

    Code (CSharp):
    1. SerializedObject target has been destroyed.
    2. UnityEditor.Undo:Internal_CallUndoRedoPerformed()
    3.  
    4.  
    5. Fixed up shadow data for algorithm PCF, variant V3
    6. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    7.  
    Also does refl. probes work ?

    II don't se any result in the scene but maybe I'm doing something wrong

    Code (CSharp):
    1. Attempting to update a disabled Reflection Probe. Action will be ignored.
    2. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    3.  
     
    Last edited: Aug 19, 2018
  21. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,372
    @SebLagarde is it possible to fetch the volumetric fog froxel and using it to add light/shadow to particle?
     
  22. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,331
    What happened to Camera Relative Rendering in Unity 2018.2.0f2?

    Before, in order to convert this shader code to the HD SRP (billboard code):
    Code (CSharp):
    1. output.pos = mul(UNITY_MATRIX_P, float4(UnityObjectToViewPos2(input.center), 1.0f) + offset);
    You had to replace it by this:
    Code (CSharp):
    1. output.pos.xyz = TransformObjectToWorld(input.center.xyz + offset.xyz);
    2. output.pos.xyz = GetCameraRelativePositionWS(output.pos.xyz);
    3. output.pos = TransformWorldToHClip(output.pos.xyz);    
    But now, the GetCameraRelativePositionWS() fuction causes the vertices to be all over the place. Commenting out that function fixes that problem, but then the sprites don't rotate towards the camera anymore. Any ideas?
     
    Last edited: Aug 20, 2018
  23. macrod

    macrod

    Joined:
    Dec 9, 2012
    Posts:
    22
    For customization of officially provided SRP packages like LWRP/HDRP, we copy the package into <project>/Packages/, so it can be managed together with the project via VCS. However, modifying shaders do not automatically update the project's shader cache. I guess there's something to do on the C++ side of the engine.
     
  24. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    669
    What is this error about ?

    Code (CSharp):
    1. ArgumentException: Getting control 36's position in a group with only 36 controls when doing ExecuteCommand
    2. Aborting
    3. UnityEngine.GUILayoutGroup.GetNext () (at C:/buildslave/unity/build/Modules/IMGUI/LayoutGroup.cs:117)
    4. UnityEngine.GUILayoutUtility.DoGetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:461)
    5. UnityEngine.GUILayoutUtility.GetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:450)
    6. UnityEditor.EditorGUILayout.GetControlRect (Boolean hasLabel, Single height, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:8802)
    7. UnityEditor.MaterialEditor.GetPropertyRect (UnityEditor.MaterialProperty prop, System.String label, Boolean ignoreDrawer) (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1035)
    8. UnityEditor.MaterialEditor.GetPropertyRect (UnityEditor.MaterialProperty prop, UnityEngine.GUIContent label, Boolean ignoreDrawer) (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1021)
    9. UnityEditor.MaterialEditor.ShaderProperty (UnityEditor.MaterialProperty prop, UnityEngine.GUIContent label, Int32 labelIndent) (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1102)
    10. UnityEditor.MaterialEditor.ShaderProperty (UnityEditor.MaterialProperty prop, UnityEngine.GUIContent label) (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1092)
    11. UnityEditor.Experimental.Rendering.HDPipeline.LitGUI.MaterialPropertiesAdvanceGUI (UnityEngine.Material material) (at C:/Users/PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.render-pipelines.high-definition@3.0.0-preview/HDRP/Editor/Material/Lit/LitUI.cs:884)
    12. UnityEditor.Experimental.Rendering.HDPipeline.BaseUnlitGUI.ShaderPropertiesGUI (UnityEngine.Material material) (at C:/Users/PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.render-pipelines.high-definition@3.0.0-preview/HDRP/Editor/Material/Unlit/BaseUnlitUI.cs:648)
    13. UnityEditor.Experimental.Rendering.HDPipeline.BaseUnlitGUI.OnGUI (UnityEditor.MaterialEditor materialEditor, UnityEditor.MaterialProperty[] props) (at C:/Users/PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.render-pipelines.high-definition@3.0.0-preview/HDRP/Editor/Material/Unlit/BaseUnlitUI.cs:678)
    14. UnityEditor.MaterialEditor.PropertiesGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1580)
    15. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    16.  
     
  25. macrod

    macrod

    Joined:
    Dec 9, 2012
    Posts:
    22
  26. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    Those events are clearly missing a working example. Can we get a simple sample of beginCameraRendering where it's clearing render target using command buffer, for example ?
     
    dariuszpietrala likes this.
  27. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    669
    Is Skybox/Simple material supported in SRP ? If so how to attach to Skybox ?
     
    Last edited: Aug 27, 2018
  28. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    669
    More errors

    Code (CSharp):
    1. Assertion failed on expression: '(int)indices[kStaticLightmap] + staticOffset >= 0 && indices[kStaticLightmap] + staticOffset < kLightmapIndexInfluenceOnly'
    2.  
    3.  
    4. Fixed up shadow data for algorithm PCF, variant V3
    5. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    6.  
    7. ArgumentException: Getting control 36's position in a group with only 36 controls when doing ExecuteCommand
     
  29. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    277
    Am I assuming correctly that the hdrp garbage allocations(seems to be 7.5kb on 2.0.8) will eventually be cleared up when its production ready?
     
  30. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    669
    Soon will 2018.3 be released and production ready.
     
  31. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,372
    i think i see a commit on version 3.x couple weeks ago about GC Cleanup
     
  32. Zarenityx

    Zarenityx

    Joined:
    Dec 2, 2012
    Posts:
    9
    A few observations on SRP so far---

    First:
    To the many people asking "Is <X> supported in SRP", the short answer is basically yes, as long as you support it. With the exception of the legacy camera events, pretty much everything else can be done so long as you implement it. https://cmwdexint.com/2018/05/24/custom-srp/ is a good site to check out if you are looking for tips on how to implement Unity features in your SRP.

    Second:
    By far the most annoying part of working with SRP is getting things to work in the scene view. Doing so requires creating a separate rendertexture that you blit into the target texture at the end, and also making a call to EmitWorldGeometryForSceneView(). On my machine this causes the image to be flipped by some renderers as well, and in a way that does not correlate to the UNITY_UV_STARTS_AT_TOP macro. None of this is hard to fix by any means, but it pops up in strange and annoying places (reflection probes had an issue with one of the solutions I tried for instance) and just adds a noticeable bit of clutter in both your C# and shader code.

    Third:
    SRPs are FUN! If you're a technical artist or graphics programmer, writing an SRP from the ground up can teach you a lot about the inner workings of a renderer, and if you have a specific featureset in mind, you can build an SRP around that. Also, using a custom SRP means maximum flexibility and blame-ability, so if something goes wrong it's always something you can fix. Not to mention, Unity has already established a precedent for minimal interoperability between pipelines, with HDRP, LWRP, and the Builtin pipelines requiring a conversion step to work together. This means that you never need to worry about adhering to any standard but your own, so you can focus on making pipelines that do what you want them to do. Honestly, of all the features coming out this year, SRP has to be the best addition to the engine. Not even the HDRP or LWRP, just the ability to write custom SRPs in general.
     
    cfree, konsic and Reanimate_L like this.
  33. Dudledok

    Dudledok

    Joined:
    Oct 24, 2013
    Posts:
    110


    Why is my TMPro text being rendered behind the image?
    As you can see it is both physically in front and below the image in the hierarchy, other than that the scene is empty.

    Unity 2018.2.5f1
    TextMeshPro 1.2.4 (2018.2 verified)
    LWRP 3.0.0

    Happens in all 2018.2 versions. The text will be rendered correctly in front of the image the first time I run the scene, but after that it gets rendered behind.

    Edit: never mind, found the (obvious) solution, posting here in case anyone else has this issue. I was changing the render queue of the canvas material to ensure it was being rendered on top of everything else:
    Canvas.GetDefaultCanvasMaterial().renderQueue = 5000;

    The TMPro Text is then in a lower position in the queue and rendered before the rest of the UI.
     
    Last edited: Aug 28, 2018
    konsic likes this.
  34. Laurens-Paladin-Studios

    Laurens-Paladin-Studios

    Joined:
    Apr 25, 2015
    Posts:
    49
    H there,

    Im having an issue using the latest LWRP together with a navigation Mesh. Namely the mesh is not drawn so it's hard to debug:

    Navigation_With_LWRP.JPG

    Here I disabled LWRP:
    Navigation_Without_LWRP.JPG

    I've Also created a bugreport (Case 1076333)

    Thank you for your attention :)
    Laurens
     
  35. discofhc

    discofhc

    Joined:
    Dec 18, 2017
    Posts:
    39
    Hi!
    What kind of visual improvement texture filtering can bring to our scenes? I don´t know if it is what i am expecting.
    Do you guys managed to include it on 2018.3?
    Thanks a lot!
     
  36. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    441
    Hi,
    We have improve the camera relative code precision. Before the change, the camera translation was apply after the matrix transform, making this useless to save precision, we now apply the camera translation before. Which mean you shouldn't have to do any call to GetCameraRelativePositionWS.

    The change is describe in the HDRP changelog.
     
  37. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    441
    We have get various issues with shaders files dependency. We working on fixing this.
     
  38. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    441
    This is what we already do for transparent. If particles use regular transparent lit shaders, then it already works (but is insanely expensive for particles :) ). Future VFX editor will do that.
     
    Reanimate_L likes this.
  39. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    441
  40. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    441
    Some have been fixed, still some cleanup to come.
     
  41. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    441
    Nope, we don't support any "builtin" skybox shaders.
     
  42. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    441
    HDRP will not be production ready in 2018.3
     
  43. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    441
    We have a prototype but are not satisfied with it yet.
    Texture filtering reduce specular aliasing on object that use normal map and that are smooth. On rough object or object without normal map there is no difference.
     
  44. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    441
    >SerializedObject target has been destroyed.
    No idea :)

    >Fixed up shadow data for algorithm PCF, variant V3
    We will fix this message in near future.

    >Also does refl. probes work ?
    Yes

    >Attempting to update a disabled Reflection Probe. Action will be ignored.
    Haven't met this message before. Need to check.

    Thanks for the notice.
     
  45. macrod

    macrod

    Joined:
    Dec 9, 2012
    Posts:
    22
    If you know the legacy renderer's camera replacement shader, you know the case: replace shader, preserve material parameters and textures.

    I was using LWRP, but the script documentation link means general SRP interface, right?
     
  46. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    525
    I am experimenting with decals,
    this is not a decal projector, its a submesh of the piece with a separate material with the decal shader.

    Mesh:
    upload_2018-9-3_9-22-17.png

    Decal atlas:
    upload_2018-9-3_9-22-45.png

    Material:
    upload_2018-9-3_9-23-0.png

    And the result:

    upload_2018-9-3_9-23-12.png

    It works properly, however you can see a square of wrong shading.
    Happens at both 127 and 128 for normal color, flipped green has no effect.
    It seems to be related to Decal Blend parameter, and its very chaotic.

    The square appears at periodic intervals, no matter if you are close to min or max, i.e. it can be 0.32 and be visible while not visible at 0.37

    It also happens if you have a Blend Factor map provided, with fully black and white cutouts for shapes, it is still visible.

    Same thing happens with a projector btw.
     
    rizu likes this.
  47. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    525
    love hdrp upload_2018-9-3_11-6-15.png

    the shadows tho are really low res, no matter what i do, cascades dont seem to work, this one is 4096 and still jagged

    Oh right its dependent on cone size silly me
     
    Last edited: Sep 3, 2018
  48. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    669
    When I'm in play mode, in hiearchy appears message "Don't destroy on load" .
    Which is weird.
     
  49. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    525
    upload_2018-9-3_11-16-29.png

    some debugging stuff from srp can safely ignore
     
  50. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    669
    Yes, but ,for example, reflection probe from scene view, appears in game mode. Which I think, it shouldn't.