Search Unity

Feedback Wanted: Lightweight Render Pipeline

Discussion in 'Graphics Experimental Previews' started by phil_lira, Sep 28, 2018.

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

    Bartek_Gudowski_Friend_Factory

    Joined:
    Feb 18, 2019
    Posts:
    54
    P_Jong likes this.
  2. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    554
    Looks like ScriptableRendererFeature and ScriptableRenderPass are how you are going to implement it, check the Scripts folder in this repo for starters.

    But this question brings up a relevant point: In theory, LWRP could just offer us the "mirror camera" option via rendering object, I think it's a good feature to add.

    "Less glue code and easier render pass", I believe this should be the motto for LWRP 5.x;

    (5.x has largely limit us to a few selected API for good reasons, but I expect it goes further to offer easier solutions to common problems.)

    (I am happy to write my own render pass though, just want to make sure ScriptableRendererFeature and ScriptableRenderPass will not simply go away in 6.x like IBeforeCameraRender in 5.x)
     
    Last edited: May 6, 2019
    ROBYER1 and Blarp like this.
  3. Andre_Mcgrail

    Andre_Mcgrail

    Unity Technologies

    Joined:
    Dec 9, 2016
    Posts:
    167
    Yes we know about this :) , hence the RenderObjects(Experimental) and all. The issue is that it does no longer render to the DepthPrepass meaning things like Screen Space Shadows(Cascades) and DOF etc will not work correctly since it is using the `CameraDepthTexture`. Once we make sure we can get the RenderObjects to also contribute to the depth preps without too much overhead(and fix the UI/UX issues) we will bring it out of preview.

    This unfortunately hasn't been updated for a while, the original authors have been put onto other things. We are very tight on resources and it might be a while before this is updated, you will be able to grab a more updated PlanaReflections from the Boat Attack demo.
     
  4. Andre_Mcgrail

    Andre_Mcgrail

    Unity Technologies

    Joined:
    Dec 9, 2016
    Posts:
    167
    ScriptableRenderPass will stay for some time, the ScriptableRenderFeature most likely will change in the future, but really right now it is more just a data container, and the ScriptableObject, as for the logic of the rendering it is all in the ScriptableRenderPass.
     
    bitinn likes this.
  5. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    396
    I just want to reiterate one big important matter. LWRP is out of preview. This means no more breaking C# API or shaders. It's safe to write your own render pass library using ScriptableRenderPass and ScriptableRendererFeature.
     
    joshcamas and bitinn like this.
  6. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    554
    Thx Andre and Phil.

    Quick question: is custom ScriptableRenderPass better than beginCameraRendering if you want to add a pass like planar reflection?

    The boat attack still use latter I assume because the new API wasn't available then.
     
  7. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    223
    That's understandable. However - please spend 5 minutes updating the readme to make it clear that it's broken on newer versions of the LWRP.

    It will save people from wasting their time trying it.
     
  8. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    396
    It depends. If you have different visible renderers/lights for the reflected camera, then you should do what boat attack does, call LightweightRenderPipeline.RenderSingleCamera. This will do culling then execute the camera renderer. (which renders all enqueued render passes, setup lights, etc)

    If you know you have the same visible renderers/lights then you can add a render pass that renders objects (opaques, skybox, transparents or anything else that you need) with a custom camera matrix.
     
    bitinn likes this.
  9. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    791
    Hi Phil

    Will we ever have some way to submit a renderer for an additional rendering pass with custom material? We have some effects that require us to render a renderer twice with another material, so we add the other material onto the renderer. But there is a whole lot of issues with this especially with dynamic effects that require procedural materials etc... Having the manage the renderers list of materials and having multiple effects coexist is a big hassle.

    I was excited about the Render objects pass, but the issue with it is that it does all the rendering entirely before or entirely after certain stages. I would ideally have our render operations sort correct in and amongst the other materials in the scene. Is there some way to achieve this effect?

    Secondly I was wondering when the RenderObjects pass will support renderer layer mask filtering instead of layermask? I tried to implement it myself but saw that the SRO filtering functions don't yet accept Renderer Layer Mask?
     
  10. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    554
    Reporting a LWRP 5.13.0 bug (perhaps also a Unity 2019.1.1 bug) that I really don't have a clue about:

    case 1152557 details a problem where LWRP 5.x Lit shader appears to be fully black in standalone build and can't be troubleshooted with Frame Debugger. I have tried everything I can think of, including instance shader stripping, shader preloading list, disabling SRP batcher, even tried direct gameobject reference, the rendering is simply bugged.

    Below is comparison between editor play mode and standalone build. The extra screenshot for standalone build is to show the before/after when we enable Frame Debugger: it stops rendering DrawMeshInstanced objects, which I believe is another bug (you can see editor shows these draw calls just fine.)

    Screen Shot 2019-05-08 at 11.40.46.png Screen Shot 2019-05-08 at 11.41.39.png Screen Shot 2019-05-08 at 11.42.05.png Screen Shot 2019-05-08 at 11.39.45.png Screen Shot 2019-05-08 at 11.42.16.png
     
    Last edited: May 8, 2019
    phil_lira likes this.
  11. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    198
    Hi @phil_lira ,

    my project uses LWRP with Lightmap in Linear Color space. (Unity 2019.1.0f2, LWRP 5.7.2)
    It works fine in the editor and Standalone build, but on Android the scene looks darker and almost black on lightmap area.

    I read 'Gamma Textures with linear rendering' manual. It says Linear rendering isn't always supported. But it also says

    So, if my project was built using linear color space and successfully ran on the target device, it means the device does support linear rendering. I'm not sure why my scene looks darker on Android device.

    Some other people in this thread said that Android doesn't support Lightmap properly on Linear color space, but not sure if that's a verified answer. It would be really helpful if you could verify this issue.
     
    phil_lira and fherbst like this.
  12. JohnKP-Mindshow

    JohnKP-Mindshow

    Joined:
    Oct 25, 2017
    Posts:
    33
    I think I just ran into this issue as well (or something similar). Trying to use ScriptableRendererFeature/ScriptableRenderPass to achieve object selection without raycast/colliders by rendering each object with a narrow FOV camera and a unique color using an OverrideMaterial with my custom shader in the pass.

    This is working really well, but when I try to augment the color to also encode the depth to get a world position of the selection, I'm noticing that the depth buffer is always returning nothing. Was trying to use the R and G channels to identify the object, and then the B channel to store the Linear01Depth (which I could then convert to world coordinates back in C# using the near/fear clip plane values).

    Do I need to make a custom depth pass on my feature as well, or any ideas why the depth texture would always return 0 for me on my custom feature/pass?

    Strangely, if I look at the Frame debugger, it shows valid data in the depth texture for the camera. Reading this data straight from the texture and setting all channels of the color to the depth texture still results in nothing (When I would expect it to render the depth texture in red)
     
  13. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    410
    I'd also like to ask again about the Colorspace issue. We are using LWRP to develop for Oculus Go & Quest (so, Android VR), and the scene becomes a lot darker (like would be expected with wrong color space). What's the current status of this? I'm finding very disparate information online.
     
    phil_lira likes this.
  14. Eyeofgod

    Eyeofgod

    Joined:
    Jun 25, 2010
    Posts:
    126
    We are trying to modify the lightning attenuation function that looks very bad on device, but since 2019.1 each time the editor is opened the LWRP files are overwritten. Which is the workflow to modify LWRP?
     
  15. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    198
    hey, check this comment and see if that helps your situation. It worked for me.
     
  16. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    396
    Issue is how we can reference the renderers in a renderer feature. Renderers live only in scene and the feature as scriptable object is not bounded to any scene.

    If we expose a way to inject render passes, say in, the BeginCameraRendering would that solve your problem?[/QUOTE]

    Correct. Each of those render passes will call context.DrawRenderers and sorting will happen per DrawRenderers.
    We have planned to expose more control of the "built-in" passes in LWRP renderers so you could choose different filtering/drawing settings when rendering the opaque/transparent passes.

    We could expose it. Currently you can do it yourself if you create your own render pass and set the rendering layer mask in https://docs.unity3d.com/2019.1/Doc...ing.FilteringSettings-renderingLayerMask.html
     
  17. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    396
    Thanks for sharing it. Seems like it doesn't repros on windows but I can reproduce it on MacOS. Will poke around.
    Do you know if this is a regression introduced recently?
     
  18. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    396
    Thanks for bringing it up. I'll prioritize to take a look at it.
    Here's the public version to track it" https://issuetracker.unity3d.com/is...-demo-scene-is-much-darker-when-using-opengl3
     
    NGC6543 likes this.
  19. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    554
    I just tried 5.7 and 5.10, both black like 5.13

    Also, I find my custom shader based on LWRP shader library works, while LWRP default Lit / Unlit shader doesn't.

    The green ones are LWRP Lit and Unlit, the rest is a custom shader using LWRP library (hence same SRP batch):

    Screen Shot 2019-05-10 at 21.10.37.png Screen Shot 2019-05-10 at 21.10.54.png Screen Shot 2019-05-10 at 21.13.26.png Screen Shot 2019-05-10 at 21.13.43.png

    (I can't reproduce this issue with a new project, not idea why.)

    (Another observation: LWRP shaders are not searchable when you create a ShaderVariantCollection and try to add them, so I can only create they by using the "Save to asset" option under Graphics settings.)
     
    Last edited: May 10, 2019
  20. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    198
    Hi, thanks for your reply!
    As I have mentioned in this post, postprocessing causes the scene to be look darker. The same scene, LWRP and lightmap in linear color space rendered just fine on an Android device when the postprocessing layer component attached to a camera was disabled.

    I’ll do some more tests and if the problem becomes more specific, I’ll submit a report then. Thank you!
     
    phil_lira likes this.
  21. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    410
    @NGC6543 @phil_lira

    Unfortunately I have the issue without using lightmaps at all...
    I still tried what you suggested (clear lighting cache, baked Lightmaps and then killed them again), but the problem persists.
     
  22. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    198
    Looks like my post causes misunderstanding to you, sorry. It was the postprocessing component that causes the darker look on Android device, at least in my case.
     
  23. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    554
    I received reply from QA confirming this bug and it has to do with LWRP Lit/Unlit shader on Metal API and color gamut Display P3 support. When all 3 conditions are met, the build will render material as black.

    Just something to keep in mind before fix is released.
     
  24. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    4,263
    This makes a lot of sense to me.

    I imagine this is going to be a per-model, rather than global setting, right? For example a drop-down menu in the "Model" Inspector tab, where I can specify what mesh components should be kept for that particular model.
     
  25. fusecore

    fusecore

    Joined:
    Oct 3, 2013
    Posts:
    14
    I'm experiencing a big difference in expected editor behaviour when using LWRP materials.
    I've built a level editor tool which relies on the editor selecting objects through culled back faces.
    However with LWRP materials, the editor selects the culled object instead.

    This seems like an unwanted side effect?
     
  26. spakment

    spakment

    Joined:
    Dec 19, 2017
    Posts:
    27
    The LWRP is a fantastic new addition, really useful to have this level of control!

    Editor suggestion: I've just started upgrading a project to LWRP in 2018.4 (so using 4.10-preview) and the profiler groupings are a bit awkward to monitor as the render pipeline is inside the scripts grouping.

    Would it be possible to add in a new grouping in the profiler for the render pipeline? Currently its all grouped within scripts and means when doing "general" profiling the rendering (green) section looks less taxing and the scripts section (blue) looks more taxing in the profiler than you would expect.
     
  27. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    396
    Seems like the issue is fixed in 2019.2+. I'm trying to follow-up if a backport will be done for 2019.1
     
  28. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    396
    Interesting. Could you submit a bug report so we investigate this further?
     
    Last edited: May 13, 2019
  29. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    396
    Ah, just checked it and the "RenderPipelineManager.DoRenderLoop_Internal" is under scripting category. I'll check what can be done. The other LWRP rendering markers are under "Rendering" which is expected.
     
  30. PartyBoat

    PartyBoat

    Joined:
    Oct 21, 2012
    Posts:
    82
    So now that Unity announced that the LWRP is production ready I decided to check it out again on 2019.1.2f, testing both the verified (v5.7.2) and latest version (v5.13.0).

    Can anyone comment on why the LWRP is still allocating around 1KB of garbage every frame (in a build)? Currently, without the preview of incremental garbage collection turned on, the LWRP's aggressive memory allocation causes frequent GC spikes in the default or empty scene. For comparison, in a similarly empty setup built-in doesn't allocate at all.

    This issue was brought up over a year ago, and it seems very little has been done in the area since. Personally I would never consider using something that allocates such a large amount of garbage per frame. Is making the LWRP GC free on the roadmap? It seems to me that matching performance with built-in would be at least a minimum for what is considered to be production ready.

    ---

    As an aside, in a fresh project trying to make a build after installing LWRP v5.13.0 will end in a failure to build. I needed to remove and reinstall the LWRP before I could get it to build successfully, and even then I ended up with
    Non matching Profiler.EndSample
    errors when it did. I know this version isn't "verified" for 2019.1, but it doesn't particularly inspire me with confidence in the production ready status of this package.
     
    JamesArndt, Vak_HD and fherbst like this.
  31. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    309
    Is anyone using LWRP with hololens? As far as I can see, the camera transform of the main camera GameView is broken as soon as you initialize Windows Mixed Reality with the LWRP.

    I submitted a bug regarding this, Case 1152916, but it seems such a minimal repro (make new scene with camera, enable WindowsMR, press play, enable LWRP, press play and observe badness) that I'm surprised nobody else is reporting it?
     
  32. MJQStudioWorks

    MJQStudioWorks

    Joined:
    Oct 12, 2012
    Posts:
    169
    There's no shadow support for pointlight LWRP?
    I hope they add support for it.

    if there is shadow support for pointlight, when will they add it? what version.
     
  33. fusecore

    fusecore

    Joined:
    Oct 3, 2013
    Posts:
    14
    Submitted a bug report, supposedly I'm getting an email with case nr but its been 24 hours now and nothing.
     
    Peter77 likes this.
  34. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    396
    @spakment to get back to you about the Profiler grouping. I've asked Profiler team to expose API so we can fix it. It's in their roadmap now.
     
  35. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    396
    You are absolutely correct to call us on this. We spent all resources to get the render pass API finish in order to get out of preview.

    I'll take a look at the memory allocations asap.

    About the Profiler.EndSample issue, it's fixed and a package should be out soon with it.
     
  36. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    396
    Plans is to start work on it around 2020.1
     
    MJQStudioWorks likes this.
  37. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    396
  38. Tony707

    Tony707

    Joined:
    Jun 15, 2015
    Posts:
    37
    Hi there,

    We just gave LWRP a try and we have an issue with our workflow. We used to setup all our baked point lights (dozens) in our scene in the editor, but we only generate the lightmaps at build time (We tried to use the auto progressive lightmapper but it still is very slow to regenerate lightmaps each time we change something). With LWRP it looks like the max pixel light count is applied in the scene view where it wasn't with the built in renderer. Is there a way to bypass this to get a correct preview of the level in the scene view ? Or do you have any idea how we could improve our workflow when using LWRP ?

    Thank you,
     
    phil_lira likes this.
  39. PartyBoat

    PartyBoat

    Joined:
    Oct 21, 2012
    Posts:
    82
    I'm glad to hear this is all on the agenda. Thanks for the response!
     
  40. rajantande

    rajantande

    Joined:
    Mar 24, 2015
    Posts:
    20
    Hi,

    We're currently using the LWRP with 2018.4.0 and we're keen to use the 2018.4.x LTS releases for our game. Are there any plans to provide the production versions of the LWRP to 2018.4.x users?

    Thanks
     
  41. Cec

    Cec

    Joined:
    Apr 7, 2014
    Posts:
    47
    Hello,
    I tried to use LWRP (for iOs build) in an AR project.
    Unfortunately, I have very different results comparing what I can see in the editor. See below :



    The material seems to be overburned. I tried to fiddle with light (only one directional ligth), indirect ligthing, material itself... no way to reproduce the exact visual feedback I have in the editor.

    By the way, I'm using Unity 2019.1.2f1 + LWRP 5.10.0 (same result as 5.7.2)

    Is this a know issue ? What am I doing wrong ?
    Thanks very much for little help.
     
  42. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    410
    Regarding the material upgrader: I though that now that everything is "production ready" that is something that would be fixed. Still, for example old "Default Material" materials are not upgraded to the new "Default Material", breaking entire example scenes for a lot of scripting-related packages that didn't bother with creating materials in the first place (just placing some Spheres / Boxes etc.).

    upload_2019-5-16_12-44-56.png
    this is after upgrading materials to LWRP

    I guess there is a menu option missing for "Upgrade Scene Materials to LWRP" contrary to just "selection" or "all".

    Also note that selecting the "Default-Material" manually (by double-clicking on it from any renderer) and then using "Upgrade selected materials", it seems to work - until, of course, you restart the Editor where the Default-Material is reset (since it's not persistent). There's also no warning that you are upgrading a non-persistant material...
     
    Shizola likes this.
  43. Horus_Sungod42

    Horus_Sungod42

    Joined:
    Oct 30, 2014
    Posts:
    67
    Quick question: can you blend between reflection probes in LWRP? The tooltip says only for deferred probes, implying that you cannot.

    Thank you
     
  44. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    303
    Hi,

    I noticed that LWRP is out from preview ready for production in 2019.1, however LWRP VR is still in preview in 2019.1.
    I'm facing this issue with LWRP VR on cardboard.
    Roughly when is LWRP VR is planned to be out of preview?
     
  45. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    554
    Horus_Sungod42 likes this.
  46. Horus_Sungod42

    Horus_Sungod42

    Joined:
    Oct 30, 2014
    Posts:
    67
    Tis' what I thought. Cool that they are still researching that.

    Thank you for the answer. I'll check that chart, it might have some more info than the one I saw on unity's blog.

    EDIT: read the document and it says vertex lights are supported? How can I make a pixel light into a vertex light in LWRP?
    (before it was setting it to not important, but it does not seem to do that anymore. I think the light importance is just to determine which light is culled if you go above the limit)
     
    Last edited: May 17, 2019
  47. BAIZOR

    BAIZOR

    Joined:
    Jul 4, 2013
    Posts:
    73
    FURKANKAHVECI likes this.
  48. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    322
    Has any consideration been given to exposing more control over the built-in fog accessible from the lighting tab?

    I'd like to create a fade-to-skybox effect, but the post-process solutions all fall into difficulties with transparent materials, whereas the built-in fog works nicely across the board with the forward renderer. So something like capturing the skybox etc. with a scriptable render pass, using that as the fog colour.

    Everything I've tried required editing the Lighting and LitForwardPass .hlsl files, which would be nice to avoid if possible.
     
  49. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    396
    Sadly no other workaround until we increase the light limits. It's on a roadmap as a feature coming in short term.
     
    Gekigengar and Tony707 like this.
  50. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    396
    To give one update on this: I have a working branch with all heap allocs fixed except some GetComponents. These will require a fix in trunk that will come soon to 2019.3. I'm checking if it can be backported to 2019.2. Once that lands LWRP will have no runtime heap allocs.

    I've kind of jumped the gun on this one and started the fix without having a proper ticket case :D. Could you open one. i'd deeply appreciate.
     
    fherbst likes this.
Thread Status:
Not open for further replies.