Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Feedback Wanted: Lightweight Render Pipeline

Discussion in 'Graphics Experimental Previews' started by Tim-C, Feb 19, 2018.

Thread Status:
Not open for further replies.
  1. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,351
    @phil_lira Is LWRP still targeting Forward renderer only?
     
  2. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    103
    @phil_lira I've got a separate thread that is tangentially related to this, and am curious if you had any insight. Essentially, where I see a shortcoming in the SRP API currently (2018.1 Git branch) is the ability to get further subsets of FilterResults from our CullResults.visibleRenderers. For instance, I'd like to take the results of a Cull and then specify an additional set of Planes to check against, and perhaps a Point+Radius. Is this something that is on the road map or possibly even exists now in an obscure manner?

    I imagine you'd need to do something like this for multiple shadow sources since currently the interpolators in LW are full up for a single Pass that conforms to SM2.0.
     
  3. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    247
    So far this looks very good! We had some nice performance improvements. Just sad that a lot of shaders and post-processing scripts/shaders are not compatible, but it's a necessary step. One question, do we "have" to use Post-Processing Stack V2 framework to scrip post-processing? Or better yet - is there a way to easily port them to LWRP?
     
    Last edited: May 2, 2018
  4. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    234
    Hi, could you please elbborate on your performance improvements? Are you using 3D? I've read some other accounts saying that their LWRP experiments resulted in the same/worse performance that the normal pipeline. I'm trying to decide whether it is worth trying to port everything over to LWRP.
     
  5. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    247
    We're using LWRP for 2D with a little grain of 3D. We don't use a lot of custom shaders for sprites/several 3D objects. We've had about 15% of performance improvements compared to Vanilla Unity. Don't know about full 3D scenes, but it's working quite ok on 2D for us.
     
    hungrybelome likes this.
  6. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,314
    In order to get fog to work in a custom shader (transparent object with z-write off), previously, these code snippets were required:
    Code (CSharp):
    1. #pragma multi_compile_fog
    2. UNITY_FOG_COORDS(2)
    3. UNITY_TRANSFER_FOG(output, output.pos);
    4. UNITY_APPLY_FOG_COLOR(input.fogCoord, col, half4(0,0,0,0));
    With the LW SRP, this still seems to work. Is that by design or will this functionality be removed later?
     
  7. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    103
    As it's Experimental, I'd say that you should expect that anything could change.

    That being said, provided that Unity doesn't drastically change the way fog works and is laid out in it's CBuffer, you're probably going to be safe.
     
  8. Hornelch

    Hornelch

    Joined:
    Oct 17, 2015
    Posts:
    1
    Hi all,

    thanks for this exciting new feature in Unity. With the release of 2018.1, I am eagerly trying out new features in my early-stage project. I would like to share my results and ask some questions as well!

    I have made a simple test for the LWRP as follows:
    1) I took a fairly standard mobile scene (the demo scene "floating port" from the Polygon Mini Fantasy asset on the store).
    2) I created 2 additional copies of all objects, moved them around a bit. I also disabled all but one directional light. This results in a typical scene with around 170k verts with realtime lighting.

    3) I created several scenes with various light and post-processing settings and tested all on a Sony Xperia Z2 tablet (Full HD, Snapdragon 800 series, Adreno 330, GLES 3.0). This device is from 2013 and up to 6x slower than my Samsung S8 in typical unity projects, and a good reference for midrange devices for my purposes.

    4) I set up a standard and a LWRP project with typical "medium" settings. Medium quality settings for LWRP, Progressive Lightmapper, Shadowmask GI, medium resolution lightmaps.

    My initial results of LWRP vs. Standard Pipeline (Forward) are as follows:

    Scene 1: no static objects, 1 realtime directional light w/ soft shadows. 170k verts, 80k tris.
    Standard Pipeline: ~37 FPS
    LWRP: ~ 39 FPS

    Scene 2: 66% static objects (both copies of original were marked static, original left as dynamic). 1 mixed directional light.
    Standard Pipeline: 58-60 FPS (70k verts in editor stats)
    LWRP: ~41 FPS (still 170k verts in editor)

    Scene 3: 66% static objects (same as scene 2), postprocessing enabled (colorgrading ACES only)
    Standard Pipeline: 15 FPS
    LWRP: ~29 FPS

    Scene 4: same as 3, but bloom, fast FXAA and vignette enabled.
    Standard Pipeline: 10 FPS
    LWRP: ~22 FPS.

    In all 4 scenes, Gfx.WaitForPresent was the #1 activity, indicating a GFX-limited scenario. LWRP rendering was 10-25% of time spent on the CPU.


    My conclusions and questions:
    1) There seems to be almost no benefit to static objects and light maps in the LWRP. In fact, from the blog posts and unity tips, LWRP seems to be made for real-time shadows ONLY, and mixed mode lights are not really supported? This is a bit of a bummer, since the majority of my planned scenes would be static, and this allows for a reliable 60 FPS even on lower midrange devices.

    2) Once you get the LWRP to perform as you want it, post processing is fairly cheap (25-30% impact) compared to the prohibite cost in the forward renderer in the classic pipeline. In fact, LWRP with FXAA and color grading was still faster than the old forward pipeline with only color grading and static object optimization.

    My questions are the following:
    a) How can I optimize static objects in the LWRP? I would like beautiful, soft, ambient-occluded shadows for static-on-static objects, while getting the benefit of not needing real-time lighting (60 FPS in the example above).

    b) if this is currently not possible, are baked/static lights with performance benefits a planned feature for the LWRP, or is the philosophy behind the LWRP to get good performance with only real-time lighting?

    Thanks all!
    Daniel
     
    jazznazz and hungrybelome like this.
  9. developer6DLAB

    developer6DLAB

    Joined:
    Oct 31, 2016
    Posts:
    4
    I'm trying to build for mobile VR using shader graph too. But it seems doesn't work. I'm using Unity 2018.1.0f2. It's that an error? If I compile for cardboard and Shadergraphs, I get an app for cardboard with a black splited screen. I can compile for cardboard in Unity 2018 and see the scene (without Lightweight RP (VR)/ shadergrap), but it look like that it's not compatible with shadergraph.

    if it's true, when I will be able to build it?
     
  10. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    120
    From what I observed, Before I jammed in our LWRP, I had some custom shaders for deferred and lensflare that makes...
    what we have 2.png what we have.png These...
    What I want 2.png What I want.png into these
    upon plugging in a render pipeline, our options for switching these shaders, deferred and lens flare as our examples, are taken out. If I want to switch these shaders around in this new system, how would I do so?
     
  11. DavidSWu

    DavidSWu

    Joined:
    Jun 20, 2016
    Posts:
    87
    I bet that by the time that the standard rendering pipeline is phased out, studios will be able to choose between dozens of custom SRP's,
    That will be an advantage for Unity and small studios, get a pipeline that suites your needs and optimize it a little to make it perfect. all without without many years of engineering effort.
     
    deus0 likes this.
  12. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    715
    Hi I'm using Unity 2018.1.0f2 + LightWeight render pipeline + gear VR .
    App not working and showing black screen. but if I switch to unity normal render pipeline then its work.
     
    Tonieh085, jdp_sms and TsvetanTsankov like this.
  13. TsvetanTsankov

    TsvetanTsankov

    Joined:
    Dec 14, 2015
    Posts:
    3
    The same problem - created brand new project with specifying the LWRP for VR as an option. The project then was built without any modification to it except switching to Android in build settings. After running it on the GearVR it crashed, so I tested whether it would work by removing the Scriptable Pipeline in Graphic Settings, building it again and starting it again. Everything was running correctly with the built in renderer pipeline (the materials were pink (magenta), yet that was normal).


    https://forums.oculusvr.com/community/discussion/64935/gear-vr-with-lightweight-pipeline-not-work

    This is the link to Play_Edu's thread on the oculus forum.

    Could someone help out with that?

    Edit**
    Apparently if I switch it to Single Pass (Preview) in XR Settings, it runs after build, but none of the LIGHTWEIGHT shaders are working - Unlit materials are showing, yet the ones using the LightWeight Render Pipeline shaders are hidden from the Camera.

    Edit****
    For anyone curious - this is a problem with Unity 2018.1, Android and the SRP.
    More info -> https://github.com/Unity-Technologies/ScriptableRenderPipeline/issues/1304
    Hopefully they will fix it soon!
     
    Last edited: May 9, 2018
    phil_lira and Play_Edu like this.
  14. pixelshader1

    pixelshader1

    Joined:
    Apr 1, 2018
    Posts:
    2
    It would be great to have an optimized motion blur image effect for LWRP(or possibility to use motion vectors).
     
  15. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    310
    Agreed, this is the modification I’m most hoping someone more savvy with this sort of thing will make to the LW SRP.
     
  16. Bravo_cr

    Bravo_cr

    Joined:
    Jul 19, 2012
    Posts:
    148
    More findings. Take a look at the next image:
    PBR Issues.jpg
    The scene is the same. Unity configured on iOS, no light in the scene, just the skybox (procedural material). On the left you have the standard shader lightweight render on 2018.1 and on the right the standard shader on legacy render on 2017.1. As you will see the PBR shader on LWP has some weird issue with the IBL lighting, indeed if you use the standard simplified lighting you have exactly the same results.
     
    phil_lira likes this.
  17. UltraShibe

    UltraShibe

    Joined:
    Apr 11, 2018
    Posts:
    2
    Could someone help me out here? When I add the Lightweight Render Pipeline to the Graphics Settings I get this error upload_2018-5-10_21-9-28.png
     
    phil_lira likes this.
  18. TechTools

    TechTools

    Joined:
    Nov 21, 2013
    Posts:
    19
    @Hornelch, thanks for posting those stats.

    With regards to scene 2 it seems that the standard pipeline is faster due to batching. After researching this, I wanted to ask your opinion on how this merge request from 2 days ago helps to improve performance with LWP: https://github.com/Unity-Technologies/ScriptableRenderPipeline/tree/lw/enable-dynamic-batching.

    Like most I have a concern around switching to LWP because of batching performance, as I rely both on Unity's static batching and plugins and scripts that implement additional batching of both static meshes and skinned mesh renderers (I'm currently testing Mesh Baker for example).

    The concern is that all the measures I have in place will either be wasted effort or possibly even need to be reverted, however the improved performance surrounding post-processing from your benchmarks definitely makes me interested enough to try it out and benchmark myself.
     
    Last edited: May 10, 2018
    phil_lira likes this.
  19. kavanavak

    kavanavak

    Joined:
    Sep 30, 2015
    Posts:
    31
    Is anyone having issues with STEAMVR and LWRP-VR, The SteamVR controllers don't seem to want to render using the updated lightweight shader.
     
  20. pcg

    pcg

    Joined:
    Nov 7, 2010
    Posts:
    185
    I'm using the 2018.1 * LWRP 1.1.5. I have baked lights in my scene along with one real time directional light.
    The directional light has a culling mask set so it should not be affecting my static scene objects but the mask is being ignored. Is there any work around for this?
     
  21. gdp2

    gdp2

    Joined:
    Dec 6, 2016
    Posts:
    25
  22. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    472
    Did you install the Lightweight Render Pipeline? You can install it from the Package Manager or create a new project with the Lightweight Template
     
  23. gdp2

    gdp2

    Joined:
    Dec 6, 2016
    Posts:
    25
    Doh! That seems to have done the trick. Thanks!
     
  24. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    365
    for 2018 yes. We have plans to add a Deferred tile friendly renderer in 2019.
     
  25. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    365
    Hi Arlevi09,

    We are pushing a lot of optimizations in 2018.2. Some more coming on 2018.3. Have in mind that LWRP is not production ready, if you are very close to ship your game we recommend waiting until 2018.3 to get stability.

    However if you can use it and provide feedback on what scenarios that performance is not ok we will take a look at it and focus on that specific scenarios.
     
  26. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    365
    LWRP uses the same constants for Fog as Builtin. So it's expected and there are no plans to change it. Light and Shadow constants are not the same, everything else should be.

    We are working on an abstraction layer for those constants as well.
     
  27. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,351
    Ah okay, at least i know that was on the roadmap. But just curious why not something like forward plus or hybrid forward?
     
  28. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    120
    Also... If we could get refraction... That would be awesome
     
  29. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    365
    Hey @Hornelch thanks for sharing this. I'm interested in more details about #2. Is the vert difference coming from batching or shadows rendering?

    We are bringing a very fast shading path for single directional lights in LWRP for 2018.2. I'd expect the performance to increase even more on your results for #1.

    About your questions:

    The point we can most improve on is on realtime lighting, however baked lighting is also very important. We are working on a new batcher that reduces the drawcall setup cost. That should be in on 2018.2. Currently only substractive mixed lighting is working. We will add support to other modes in 2018.3 while also looking for some room for performance shader wise.

    Subtractive mode bakes main directional light in the lightmap. That is supported on LWRP and should get you good static-on-static shadows. For static-on-dynamic we are also adding support to occlusion probes in 18.3. We are adding support to Baked Indirect and Shadow mask modes on 2018.3.

    Premise of LWRP is to get better performance on both dynamic and static geometry. However, we can improve more on realtime lighting that we can on baked. On baked you can benefit from reduced setup drawcall cost with the new batcher I mentioned. LWRP is already setup for that but it requires engine changes that are only available in 18.2
     
  30. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    365
    @DavidSWu @Play_Edu @TsvetanTsankov

    We just fixed the VR issues. Just spoked with Tim about a new package release. We are doing one Tuesday (18.2). We are waiting some engine changes to be backported to 18.1 to make the 18.1 C# backport fix to that as well.
     
    Adam-Bailey likes this.
  31. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    365
    Thanks! I'll take a look at that.
     
  32. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    365
    Hey, I'll take a look at that as well. I've planned to spend the next week sweeping a lot of bugs reported either here, on the github and fogbugz. Will prioritize them and let you guys know when they are fixed.
     
    pcg likes this.
  33. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    365
    We have already some preliminary work on a tile friendly deferred rendering that showed some good performance improvements and we want to tackle that work.

    Good things is that we are doing a major refactor that makes the pipeline modular and extensible: https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/1337

    Next step is to add pluggable renderers so anyone could add a Forward+ pipe very easily.
     
    GameDevCouple_I and Reanimate_L like this.
  34. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,528
    will this PR be going into any preview package anytime soon? It sounds like it will make writing shaders easier due to the structs
     
  35. _watcher_

    _watcher_

    Joined:
    Nov 7, 2014
    Posts:
    112
    Point Light > Shadow Type > Hard Shadows | Soft Shadows
    "Realtime shadows for point lights are not supported. Either disable shadows or set the light mode to Baked."

    It is supported in the HD Rendering pipeline. Will this be supported in the Lightweight RP?

    Im asking because it mentions existing support for "Realtime Point Light" for "Lightweight Pipeline" in a table here:
    https://blogs.unity3d.com/2018/02/2...er-pipeline-optimizing-real-time-performance/

    And HDRenderPipeline/Lit doesnt really support Sprites, so its impossible to test realtime 2D Sprite lighting with Point lights and available shaders, right?
     
    Last edited: May 17, 2018
  36. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    365
    @Reanimate_L I've spoke with our mobile team today about the state of compute in mobile and the feedback I've got is that it's rather unstable wildland making a Forward+ not very attractive on mobile.
     
    Reanimate_L likes this.
  37. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    365
    We are generating one package on Tuesday. I guess this PR will be available on a following package. We have to make sure it doesn't introduce any regressions since it's a big refactor. I can poke you when that is available.
     
    GameDevCouple_I likes this.
  38. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    365
    It will be available in 18.3.
     
    _watcher_ likes this.
  39. adamzl

    adamzl

    Joined:
    Feb 24, 2018
    Posts:
    19
    I started from the LWRP template and started to notice after awhile a significant reduction in resolution. I went through the settings to try and bring the Game window image up to the fidelity of the Scene window but was not able to. Is this the intended fidelity of LWRP?

     
  40. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,613
    You have scale 1.5x in the second image. (it's the scroll bar at the top). Drop it down to 1x.
     
  41. adamzl

    adamzl

    Joined:
    Feb 24, 2018
    Posts:
    19
    You are right, combined with the "Low Resolution Aspect Ratios" checkbox that was making it so I couldn't reduce below 1.5x. Thank you for the help.
     
  42. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,528
    That would be brilliant thanks!
     
  43. Suduckgames

    Suduckgames

    Joined:
    Nov 28, 2016
    Posts:
    121
    Just to give some feedback to you,

    I just had a new project in 2018.2 with a terrain, when I passed to the lightweight pipeline , it went pink ( that was supposed to pass, but I would expect a promtp asking for upgrade shaders when possible)

    However, I create a new tree and it was pink, I create a new project with LWRP and added a terrain and a tree, and the tree is pink, I would expect to have a LWRP ready shader with the tree.

    Really good work with this version guys, Look to get more updates!
     
  44. Glaswyll

    Glaswyll

    Joined:
    Feb 13, 2014
    Posts:
    65
    I'm having an issue with LWRP:



    Fiddling with the settings on the Scriptable Object doesn't seem to have any effect.
     
  45. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    247
    I have encountered a severe problem on LWRP. I don't know what am I doing wrong, but I can't make UI Canvases to render in build. Come see the screenshots. On build the background image (through camera-space canvas) fails to render, resulting in incorrect image.
     

    Attached Files:

  46. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    310
    I had all UI fail to appear in the build while there’s a second camera active anywhere (I had a few with RenderTexture targets alongside my main camera)
     
    Last edited: May 24, 2018
    Kolyasisan likes this.
  47. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    247
    Well, guess that's the problem then. I have the second camera render the Depth texture of the cube and project it as a shadow. That's definitely a bug, hope it'll be fixed soon.
     
  48. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,528
    Is this still incoming @phil_lira ?
     
  49. Laurens-Paladin-Studios

    Laurens-Paladin-Studios

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

    I've been experimenting with LW RP lately in Unity 2018.1.1f1 using the package manager. Its a great update, but there are two issues that I noticed:

    1) As I use "Instanced Properies" in any of the LWRP shaders, the shader code does not compile. I'm using Amplify shader editor to create the shaders. Is this a known issue or is it something I need to pick up with the Amplify team?

    2) When I add the new post processing stack to my camera (without any post processing effects enabled) the camera will render a depth pass which adds significant amount of draw calls. Since we are planning on only using Bloom and Vignetting it feels like rendering a depth pass is unnecessary overhead.

    Thank you very much in advance,
    Laurens 't Jong
     
  50. WotC_DavidB

    WotC_DavidB

    Joined:
    Nov 8, 2017
    Posts:
    2
    I'm noticing an issue where instancing seems actually slower with LWRP even with the built-in shaders.

    I just create a test scene with 1000 instances of the Stanford bunny (each having some 34k verts). Each has slightly different position but otherwise is identical to the prefab it is spawned from.

    They all use an identical material.

    When I flip instancing on that material perf takes a hit despite this being what I would assume to be a nearly ideal case for instancing.
     
Thread Status:
Not open for further replies.