Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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. castana1962

    castana1962

    Joined:
    Apr 10, 2013
    Posts:
    400
    Thanks equalsequals !!!
    Regards
     
  2. Spacew00t

    Spacew00t

    Joined:
    Mar 24, 2013
    Posts:
    21
    Not sure if this has been posted yet, but I get this issue when using the LWRP and ShaderGraph 4.9.0 with Unity 2013.3.3f1 on OSX 10.13.6 with Metal enabled in editor:

    Code (csharp):
    1. Shader error in 'Hidden/Lightweight Render Pipeline/CopyDepth': failed to open source file: 'CopyDepthPass.hlsl' at line 22 (on metal)
    2. Compiling Vertex program with _DEPTH_NO_MSAA
    3. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
    Everything is pink. Lemme know if you need more specific information, rolling back to 4.8.0 which works fine for now.
     
  3. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    We could not reproduce this issue. Could you open a bug report with a repro project so we take a look at it?
     
  4. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Hi all,

    LWRP 5.3.1 is out. Here's the changelog

    to highlight some cool things:
    • We reworked particles shaders to support distortion and soft particles + fixed many particle shader issues. We added a new built-in shader
    • Baked Lit. This shader doesn't do realtime lighting but sample GI from lightmaps or light probes.
    • We reworked the all LWRP shader material inspectors to be consistent and add few more options like Render Face (Front, Back, Both) and exposed Render Queue priority for sorting.
    • Bunch of bugfixes and performance improvements in terms of bandwidth for mobile.
    • Documentation for all shader/lighting models are in the package now.
     
    hippocoder and scvnathan like this.
  5. desertGhost_

    desertGhost_

    Joined:
    Apr 12, 2018
    Posts:
    259
    My team at work is targeting high end desktop PC systems and would like to use SRP when upgrading to 2019.1 (after 2019.1 has left beta). If possible we would like to avoid using HDRP because it is still in preview and we were therefore planning on extending the LWRP for our project.

    We currently use camera stacking (because it is simple and the performance overhead is not an issue on our platform) in our project. Will this solution that you are prototyping be ready for 2019.1? Would it be possible for you to put it on GitHub if it doesn't ship with 2019.1?

    Thanks.
     
    Last edited: Feb 3, 2019
    phil_lira, Heckmouse and Karearea like this.
  6. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,047
  7. MrMetwurst2

    MrMetwurst2

    Joined:
    Jul 16, 2009
    Posts:
    253
    I modded the LightweightRenderPipelineAsset.cs to add set to the supportsCameraOpaqueTexture like so...

    Code (csharp):
    1.         public bool supportsCameraOpaqueTexture
    2.         {
    3.             get { return m_RequireOpaqueTexture; }
    4.             set { m_RequireOpaqueTexture = value; }
    5.         }
    and can turn Opaque Texture on and off now easily in code (for better performance on older phones) by switching the bool on and off on my LWRP asset.

    Is there a reason this isn't enabled by default?
    Should I be doing this differently?
    Is there any side issues this may cause that I'm not aware of?

    Cheers!
     
  8. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Hi regarding LWRP 5.3.1 there's an issue in package manager that's causing it to not show in the UI.
    The issue has been fixed and it coming in the next 2019.1 beta (monday or tuesday I guess)

    Meanwhile, if you want to get it now you have to edit the manifest.json in your project Packages folder to point to 5.3.1
    cc @Prodigga
     
    Prodigga likes this.
  9. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Short answer is that LWRP doesn't have any changes in those versions. The issue is that we have to release SRP/HDRP/LWRP/ShaderGraph/VfxGraph together, so it might be the case HDRP has changes and then it has to bump a new LWRP package even if LWRP doesn't have any changes. :(
     
    Immu and ibyte like this.
  10. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    This is already supported in 5.3.1 package. You can also override that settings per-camera.
     
  11. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Hi all (cc @desertGhost_ )
    Regarding the lack of Camera Stacking in LWRP and the Render Pass architecture. We are working on a solution to ship with 2019.1.

    There's a lot of feedback we received regarding this and we shifted our roadmap to tackle these issues and work on a set of examples on how to do rendering in LWRP.

    We are trying to cover most scenarios. To make sure we cover them, we greatly need your help. If you rely on camera stacking please send a message to me directly with what you are doing and the camera setup that you use to achieve that in built-in.

    Thanks
     
  12. MrMetwurst2

    MrMetwurst2

    Joined:
    Jul 16, 2009
    Posts:
    253
    Of course I can!! Wow. Thanks :)
     
  13. StefDevs

    StefDevs

    Joined:
    Jan 20, 2014
    Posts:
    23
    I came here just now to inquire about this topic. What timing!

    I came to LWRP hoping to find the flexibility needed to replace my camera stacking solution (which seems horribly redundant for my use case) and unfortunately, after digging through the api, it doesn't seem to be there yet. So I'm very glad to see this post! DM-ing in a moment.
     
  14. MrMetwurst2

    MrMetwurst2

    Joined:
    Jul 16, 2009
    Posts:
    253
    Hey Phil. I can't see where to turn this off via script on the Camera. I can access the depthTexture setting but not opaqueTexture.

    upload_2019-2-8_23-2-36.png
     
  15. ChannexDK

    ChannexDK

    Joined:
    Apr 14, 2015
    Posts:
    15
    We are seeing the exact same thing when changing to PS4 as target. It's a very odd bug, since the file is actually there? I tried to copy the CopyDepthPass.hlsl file from utils to root shader folder and even though I obviously get a meta collision, it actually works (no pink output in editor)
     
  16. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    154
    You have to add the LWRPAdditionalCameraData component alongside the Camera you want and enable the OpaqueTexture that way.
     
  17. MrMetwurst2

    MrMetwurst2

    Joined:
    Jul 16, 2009
    Posts:
    253
    Thanks for the tip. Unfortunately it was already on the Camera...
    upload_2019-2-9_17-8-53.png

    I'm on 4.9.0 btw
     
    Last edited: Feb 9, 2019
  18. MrMetwurst2

    MrMetwurst2

    Joined:
    Jul 16, 2009
    Posts:
    253
    Is it possible to change the Main Shadow resolution via script as well?
     
  19. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    154
  20. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Yes but only in 5.2.3 version and up.
     
  21. studentutu

    studentutu

    Joined:
    Oct 22, 2017
    Posts:
    105

    Good afternoon, also we have found a bug with LWRP with enabled opaque texture on one camera - when using multiple camera setup with one camera ortho for 3d world and a second camera (no additional camera textures) with ortho only on UI - the screen on IOS is a complete mess.

    Our setup - Unity 2018.2.20f1, LWRP - 3.0.0.

    We are trying to fix this issue by using only one Ortho camera with additional Opaque texture and HDR, but now we have another problem - Canvas is being overridden each time camera rotates, which results in images being visible overdrawn with each frame and it causes images to be redrawn on top of each other with incorrect sorting order even when images are being layered correctly one after another in the hierarchy.
    To be noted: we are using a custom shader that uses Opaque texture for the blur effect as our first background image on the canvas.
    Please, tell us if we are using it wrong or is it a known issue?
     
    Last edited: Feb 11, 2019
  22. studentutu

    studentutu

    Joined:
    Oct 22, 2017
    Posts:
    105
    We have exactly the same issue - 2018.2.20f1, LWRP 3.0.0 -preview, IOS - fixed it by changing the initial scale on the models - we have imported models with large size and scaled them down in Unity on the objects transform to something like 0.002 on all axis. This results in rendering the vertices somehow too litle little for LWRP. Try changing the model import setting - initial size to the scale on the transform. Now objects transform should have 1 on each axis in scale!
     
  23. essimoon2

    essimoon2

    Joined:
    Nov 13, 2013
    Posts:
    195
    Hey guys!
    I'm just getting started with LWRP and I'm struggling a bit on what's the best approach to modify the LWRP in terms of actual rendering.
    I'd like to get the CameraDepthNormals texture in post processing and some other stuff. What would be the best approach to get this done, since it doesn't seem right to just modify the code inside tthe Packages folder.

    Is there any planned interface to inject code or modifiy the render loop from one's project?
     
  24. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    228
    Hi all,
    I tried to upgrade my existing project to LWRP, but failed.
    I have to force OpenGLCore due to an external library that I'm using, and that causes the Game view to turn black when the LWRP asset is assigned to Scriptable Render Pipeline Settings.

    I'm currently using Unity2018.3.5f1 with LWRP v4.9.0-preview, on an iMac.

    I tested this by creating an empty project, force Graphics API to OpenGLCore, and then import LWRP package, create the LWRP asset and assigned it. As soon as the asset is assigned, the Game view turns black, and the camera doesn't renders to it.

    I'm not sure if this was an intended behaviour(I don't believe so... does it?!)
     
  25. castana1962

    castana1962

    Joined:
    Apr 10, 2013
    Posts:
    400
    Hi
    I am trying the BoatAtack Unity LWRP project and when I opened it into Unity2019.2.0a4 , I cannot see well The Terrain game object and I got this error

    Please include Nature/Terrain/Diffuse shader in Graphics settings.UnityEngine.Camera:Render()

    I got the error in LightweightRenderPipeline.cs ( line 224)

    var cullResults = context.Cull(ref cullingParameters);

    I was looking for about this topic in Internet and I found it
    https://answers.unity.com/questions/919590/unable-to-find-shaders-used-for-the-terrain-engine.html
    I did it but I cannot fix it
    For it, Could anybody help me to fix it?
    Thanks in advance
    Note. Please see the picture in add
     

    Attached Files:

    Last edited: Feb 14, 2019
  26. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Hey there, the customizable passes are really cool! I have been toying with them. I had a question, and maybe its a dumb one so bear with me..!

    There are 2 instances where we need to render a camera into a RT but we only need to render one or two renderers that we know wont be culled etc. Is there someway to skip the entire rendering pipeline and just clear the RT and render this small list of renderers into it, and be done with it?

    I wrote a ScriptableRenderPass that just has a list of Renderers and in Execute it adds those renderers to a cmd buffer that it renders. (buf.DrawRenderer). I set the cameras Culling mask to 'nothing' so the camera does..nothing.. but I don't know if this is the most optimal way.

    I guess what I want (and not sure if I need) is a way to say 'remove all render passes and use only this render pass' instead of 'here is an additional render pass'
     
  27. so_n7

    so_n7

    Joined:
    Sep 21, 2017
    Posts:
    1
    Hi
    I use 2019.1.0b3 & LWRP 5.3.1.
    If you set it like the following, the scene view becomes very dark.
    When you turn on HDR or change color space Linear,it will be normal.
    Am I wrong setting somewhere?

    Create new project(LWRP) and
    Camera : Attach PostProcessLayer
    LightweightRenderPipelineAsset : HDR off
    Player Settings : color space Gamma
    Platform : PC(Windows)

    I found LWRP 5.3.0 changelog:
    Fixed rendering in the gamma color space, so it doesn't appear darker.
     
  28. Arnklit

    Arnklit

    Joined:
    May 18, 2015
    Posts:
    48
    Sorry if this has been cleared up elsewhere, but is there a known issue with using lightprobes for in the LWRP? Using Unity 18.3.6f1 and LWRP 4.9.0 dynamic objects appear to not be affected by the light probes at all. Using Unity 19.1.0b3 beta and LWRP 5.2.3 the light probes do affect dynamic objects, but only a tiny amount.

    LWRP 5.2.3
    LWRP.PNG
    Legacy Renderer Standard.PNG
     
  29. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    154
    That looks more like the problem is that the object is not receiving Shadows. The LightProbe information looks like it's being overwhelmed by the direct lighting, which would be occluded by the Cube if it were casting a Shadow on the Sphere.
     
    hippocoder likes this.
  30. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    228
    Hey,
    Have you assigned a new material for the cube, or did you use the default one?
    As you can see from the inspector, that the default color for LWRP's default material is set to 'Gray', unlike the standard shader('white').
     
    hippocoder likes this.
  31. Arnklit

    Arnklit

    Joined:
    May 18, 2015
    Posts:
    48
    LWRP only supports "Subtracktive" mode shadow baking where static objects don't cast shadows and you are supposed to get shadows through lightprobes, as you can see it works in the Built-in Unity renderer where the object takes on the shading of the nearest lightprobes. https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html

    Yes I have assigned a new white material. And the Material colors are identical in screenshot from the Built-In renderer.

    EDIT: Typo
     
  32. chriscode

    chriscode

    Joined:
    Mar 2, 2015
    Posts:
    48
    Tried ligthweight render pipeline. Not great success. Lights in project stopped working and performance even worse on device.
    Have reported bug for lights not working. In new project they work okay. Guess it's just not ready, still in preview.
     
  33. RadPirates

    RadPirates

    Joined:
    Mar 13, 2017
    Posts:
    4
    The possibility to use ShaderGraph and the gain in performance are quite cool. I'll be waiting for Shadowmask support.

    Any update on this?
     
    chrismarch likes this.
  34. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
    Is there any way how to make lens flares working? Or is there any replacement for this?
     
  35. antoineConffx

    antoineConffx

    Joined:
    Jan 17, 2019
    Posts:
    8
    Hey I'd like to report an issue that happens with the default LWRP VR Template for 4.9.

    Enabling MSAA with a Color texture in the LWRP pipeline asset causes the transparent objects to not render anymore.
    Enabling/Disabling Depth texture does not make a difference.
     
  36. Andre_Mcgrail

    Andre_Mcgrail

    Unity Technologies

    Joined:
    Dec 9, 2016
    Posts:
    244
    in LWRP we do not support a CameraDepthNormals texture, only CameraDepthTexture. This can be used like any normals global texture.

    Yes, currently we are working on a more modular system so injecting your own code/passes will be much easier and not require to edit existing LWRP files.

    Does this happen on 19.1 with a newer LWRP? LWRP is coming out of preview in 19.1 and a lot of work has been done for bug fixing and performance so it is the recommended version to be using, especially since support for 18.3 LWRP has ended.

    Yes this was very new changes to Unity that also needed to be made in SRPs, I need to update the BoatAttack demo with the latest package, but if you make sure to pull the Packages/6.0.0 branch of the boat demo and try update LWRP to the latest available it should fix the issue you are seeing.

    What you are doing is right with the custom pass and a list of renderers, and about this issue of saying only render this pass, as I noted above, we are making a very easy system to control what is actually happening from a pass pov. With this you will be able to just execute your custom pass and ignore all existing LWRP passes if you want, we will be showing some stuff at GDC and a package should follow not too long after.

    No this is broken still :( but we have it in our bug tracker and will be looking to fix it after GDC

    Mixed lighting support is flakey as is, there is work being done to support it fully and should make it into 19.1, the key thing missing is the occlusion data stored in the probes, so they don't get 'shadowed'.

    Did you enable additional lights on the render pipeline asset? Please have a look here at the docs for lightweight they might help you with this if in a new project you get additional lights fine.

    We will be posting/updating our public roadmap soon, but we aim to have feature parity with builtin this year.

    Not yet unfortunately, this is something I want to look into adding personally in the BoatAttack demo(nothing speaks nice sunny islands than a giant lens flare) but there are no plans at this stage for anything official on the roadmap.

    There has been a lot of work on the XR side of things happening, but I do state this is only going to be present in 19.1 as LWRP is no longer supported in 18.3, the issue you are seeing is due to the MSAA resolve. If you 100% must stay in 18.3 the upside to SRP is that it is all open, so you could find the fix on the SRP git repo and try a back port yourself, otherwise I would very much suggest upgrading to 19.1 as we will be supporting the 19.x versions of LWRP(5.x.x and newer) for many years to come.
     
    optimise and castana1962 like this.
  37. castana1962

    castana1962

    Joined:
    Apr 10, 2013
    Posts:
    400
    Hi Andrew, first, thanks to answer me. On the other hand, I am trying your project with SteamVR plugin and my HTC Vive headset and I see it ok in my Game tab but when I played it I see it in inverted way, for it Did you try it in any VR ?
    Thanks for your time
    Alejandro
    Ps. I posted this problem in the VR Unity forum but I did not get any answer yet... more info here
    https://forum.unity.com/threads/i-saw-the-unity-scene-inverted-in-my-htc-vive-headset.632428/
     
  38. Andre_Mcgrail

    Andre_Mcgrail

    Unity Technologies

    Joined:
    Dec 9, 2016
    Posts:
    244
    Yes we have run this in VR lately with latest LWRP running on 19.1, the water did not render correctly though but this was on mobile VR which it is not really setup for. Which LWP /Unity version did you try?
     
    castana1962 likes this.
  39. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    514
    I'm so confused, it doesn't matter what I do I can't get more than one light to render. I'm using Unity 2018.3.5 with LWRP 4.10. I've got additional lights set to 4. I have three directional lights in my scene, the main light with the highest light intensity is working, but I can toggle the other two on and off and I see no visual change. They do not affect the scene at all.
     
  40. castana1962

    castana1962

    Joined:
    Apr 10, 2013
    Posts:
    400
    Yes, I had the same problem with the water.... I try it with Unity 2019.1.0a1 and Steam VR plugin 2.2.0 and the LWRP package installed in the project ( 5.2.1 version)
    Did you get also the Scene inverted when you see with the VR heaset and Ok in the Game tab ? What Unity version did you use?
    Thanks
    Alejandro
     
  41. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    514
    I understand that the directional light with the most intensity is treated as the main light, but I can't see the affects of any other lights in the scene. Like If I put the main light at intensity 1 at a bright white colour, then another directional at intensity 0.8 bright red, I don't see any of the red light at all. This is both in the editor scene view and at runtime in the editor.

    I saw something about graphics emulation issues.. is this related?

    I'm running on mojave on a mac, my platform is set to iOS, but I see no improvement changing it to standalone. My graphics emulation menu when on the iOS platform has metal and open gl 2 greyed out and only No Emulation selected. My colour space is Linear. I've got graphics API set to just Metal for iOS.

    Is there anything else I'm missing?
     
  42. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    514
    But if I am turn disable the white light the second red light kicks in and works!?
     
  43. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    228
    Hi @Andre_Mcgrail , thanks for your reply.

    And yes, it still happens on Unity2019.1.0b4 with LWRP v5.3.1.
    Though I didn't tested with standalone build, similar issue occurs on Android with Graphics API set to OpenGLES 2.0 only. I submitted a bugreport before. Case ID is 1127252.
     
  44. antoineConffx

    antoineConffx

    Joined:
    Jan 17, 2019
    Posts:
    8
    Thanks for the feedback, will look at that :)
     
  45. antoineConffx

    antoineConffx

    Joined:
    Jan 17, 2019
    Posts:
    8
  46. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    Hello,
    Do you have an ETA on when the mobile VR compilation will be improved? Today it seems there is no shader stripping. A compilation takes ages. My projects took 2 hours to compile, I switched back to the "old" forward renderer, it takes 5 minutes now. I already submitted an issue 6 months ago. I really hope you'll be able to fix that for 2019.1.
     
  47. FuzzyOnion

    FuzzyOnion

    Joined:
    Aug 22, 2014
    Posts:
    33
    Relatively minor issue regarding Render Textures - can't seem to do any texture filtering other than 'point' on Android. Makes the Lightweight Pipeline unusable for my Oculus Go project unfortunately. I'll miss using the new shader graph, incredibly fun to play with.
     
    Last edited: Feb 28, 2019
  48. antoineConffx

    antoineConffx

    Joined:
    Jan 17, 2019
    Posts:
    8
    Replace all instances of multi_compile with shader_feature. That should greatly reduce variant build times
     
  49. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    @antoineConffx what is the difference between those two keywords? Why is it not by default?
     
  50. antoineConffx

    antoineConffx

    Joined:
    Jan 17, 2019
    Posts:
    8
    As far as I understand it,
    multi_compile compiles all the variants but it's meant to be stripped by user scripts such as the blog post that talks about shader stripping optimizations.
    shader_feature will automatically strip unused variants but if you have dynamically created objected with shaders that were not compiled at build-time then you can have hitches because you'll have runtime shader compilation happening.
    To go around that you need to have good shader variant collections.

    Someone correct me if I'm wrong, but that seems to be working pretty well for me.
     
    noio likes this.
Thread Status:
Not open for further replies.