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

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

    Fallc

    Joined:
    Mar 13, 2015
    Posts:
    48
    Are there any plans to fix the postprocessing for the LWRP with VR in 2018.3? I've already send a bug report and QA told me that there are not certain if the issue is also gonna be fixed for LWRP 4.x.
     
  2. renardmf

    renardmf

    Joined:
    Jun 29, 2012
    Posts:
    47
    Submitted the bug for the transparent shader issue which it seems like it was fixed in 2019.1a11. Although now it seems like using regular Singe Pass Stereo (Not instanced) is causing the image to render upside down in that version. I just submitted a bug fix for that as well.

    Also, not sure if it was reported already or mentioned in this post. But Unity Editor Preview windows like the Animation Preview doesn't clear the camera so you get weird doubling effects in those previews.
     
  3. skeptika

    skeptika

    Joined:
    Dec 31, 2011
    Posts:
    108
    Just wanted to provide the feedback that so far, changing to LWRP has gone fairly flawlessly. Really well done!

    The only issue blocking me is the lack of Mixed Mode lighting (Shadowmasks in particular). That seems like a rather large feature to punt down the line! 19.1 is still alpha (much less beta, much less final, much less patched up), so planning on 19.2 likely puts this basic feature months out? Overall, really good work, the transition has been fairly painless, but Subtractive lighting really doesn't cut it in most game scenarios!
     
  4. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
  5. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Could you post a screenshot of your LWRP asset settings (shadows section) + your game screenshot? Shadow quality will depend on soft shadows + resolution + shadow volume size
     
  6. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    That sounds like a bug. I haven't seen this reported. Could you open a case? This way we will get back to you with updates.
     
  7. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Could you point me out to the issue so I can follow up on this one?
     
  8. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    I'm glad it upgraded nicely for you. Baked Indirect will be available in 19.1. It's planned to be done this week. Shadowmasks unfortunately will be only for 19.2+. We are taking the approach of developing LWRP from bottom-up in terms of features. Some features will be missing in LWRP but we'd rather focus on Q&A and performance and deliver a pipeline that has some missing features but it's stable than rushing features in and risk quality.
     
    Karearea likes this.
  9. Fallc

    Fallc

    Joined:
    Mar 13, 2015
    Posts:
    48
    Postproccessing doesn't work at all with VR and LWRP 4.x . I remember that this was already fixed in LWRP 3.x or LWRP 2.x. The Case Nr is 1105704.
     
  10. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Most likely you only need to do functions to initialize a SurfaceData and InputData to get a custom lighting model. Take a look at https://github.com/Unity-Technologi...lines.lightweight/Shaders/LitForwardPass.hlsl

    We plan to make it easier to customize light models, but this is a bigger discussion that also involves ShaderGraph. Meanwhile, we also welcome all kinds of feedback/suggestions regarding this. The easier/more flexible we can make it for you the better.
     
    noio and bitinn like this.
  11. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Thanks. I've asked around. As soon as I have more info I'll get back to you.
     
    Fallc likes this.
  12. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Hey guys,

    We are giving a strong push to look at performance issues in LWRP. If you have a game/project that is performing worse in LWRP than Built-in please submit it as a bug. It will help us improve LWRP performance as most likely this will catch scenarios not caught by our performance tests.
     
    MadeFromPolygons likes this.
  13. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Are 4.x and 5.x mostly on par in term of performance at the moment?

    (We are stuck with 4.x for the foreseeable future, but curious to know; Also I hope the cause for slow inspector repaint when emission is enabled has been identified, aka case 1105661)
     
  14. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    240
    Hey phil_lira, regarding performance / eventually ram leak / even crash, I've got this very problematic crash issue with LWRP (which I though initially to be about 2018.3 beta):
    Feel free to take an eye on the case here https://forum.unity.com/threads/zwwaitformultipleobjects-issue.593755/
    (case 1108269)

    Also, an other issue I've got with latest LWRP:
    upload_2018-12-11_17-44-49.png
     
    Last edited: Dec 11, 2018
  15. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Again, re-import the LWRP folder should fix your problem :)

    I don't know why it kept happening with Unity 2018.3 beta/rc, but at least here a workaround.
     
    P_Jong likes this.
  16. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    240
    Considering the fact that's been happening for more than 4 months, that i've been testing 10+ versions of LWRP and reimported the whole project even more times. I can confirm that didn't fixed it at all ^^"

    I mean, for the zwaitformultipleobjects crashes.
    For the other issue, you're probably right. Just realized you were probably talking about that other one.

    By the way, does anyone has a single idea what that zwaitformultipleobjects crashes are ?
     
  17. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    154
    I'm noticing a lot of broken Editor views (preview, material thumbnail, ShaderGraph nodes) when running the game in LWRP and SPS VR.

    I've isolated the problem to the LightweightRenderPipelineCore's IsStereoEnabled, which does not take into account the other CameraTypes. I'll be filing a bug.

    Edit: I've submitted the bug report under case 1109009.

    The fix is actually quite trivial:

    Code (CSharp):
    1.             //bool isSceneViewCamera = camera.cameraType == CameraType.SceneView; // Wrong.
    2.             bool isGameCamera = camera.cameraType == CameraType.Game || camera.cameraType == CameraType.VR;
    3.             return  XRGraphics.enabled &&
    4.                     isGameCamera &&
    5.                     (camera.stereoTargetEye == StereoTargetEyeMask.Both);
    This also fixes the issue where run-time Reflection Probes break in VR.
     
    Last edited: Dec 12, 2018
  18. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Ah I was referring only to your screenshot problem, the failed to open source file problem. For your actual issue you need to wait for a Unity team response. I have never seen it.
     
  19. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Hi, I am reporting yet another issue with LWRP that I believe is actually caused by Unity core bug, but since it's pretty prevalent and I haven't found an open issue for it, I decide to report here as well:

    First check this short clip:


    What happened? Well, when implementing a Scriptable Render Pass, IBeforeCameraRender's ExecuteBeforeCameraRender will pass a camera object that is supposed to be the main camera of game view for rendering.

    Problem is, it wasn't the main camera of game view, it was the main camera from scene view! (And it doesn't always happen, entering play mode or toggling scene view effect can trigger it, at least on macOS with Intel GPU.)

    Just to be sure, I added an extra field and reference the main camera instead, and now game view render correctly (of course, the scene view will then be broken):


    I remember seeing this issue when watching Andy's boat attack demo:


    And I face a similar issue when using an asset store tool involving GPU instancing and LWRP: https://forum.unity.com/threads/released-gpu-instancer.529746/page-12#post-3951187

    I don't know what's going on, so I open a case 1109127, hopefully someone can look into it.

    Many thx.
     
    Last edited: Dec 13, 2018
    P_Jong likes this.
  20. brianchasalow

    brianchasalow

    Joined:
    Jun 3, 2010
    Posts:
    208
    Hi there @phil_lira , wanted to post and share my impressions of the LWRP, as it stands in the latest LWRP from the git repo, with ARKit 2.0 Plugin and iOS/Metal. Some of this has to do with the Post Effects v2 pipeline- is there a different thread for that? Should I make a bug report of all these things/ how many of them are already known?

    1) FinalPass.shader, Line 119. Needs target 5.0 rather than 3.0 to compile. Sometimes i'll get a build error, if i toggle FXAA off/on again sometimes it'll build. I can overwrite FinalPass.shader to force it to build, but it'll get re-written on Unity application load.

    2) This was a hard one to track down. When creating a custom Post effect using the Post effects v2 stack, the filename of the post FX need to match the class name of the
    PostProcessEffectSettings
    and not the
    PostProcessEffectRenderer<MyType>,
    or the effect you created will get DELETED from the asset/scene on build or reload of unity- it essentially won't serialize properly. If this isn't a bug and by design, you should make a warning about class name not matching file name.

    3) I ported the same exact effect to the post effects v2 pipeline + LWRP, and compared it to the legacy pipeline.
    Post effects v2 pipeline, when built to iOS/ARKit and rendered to texture [EDIT: or when not rendered to texture. Tried it without, still has same issue], has a built-in latency, feels delayed. The same technique/scene works fine on legacy pipeline. This one in particular made me switch back to legacy. I can't track down where the frame lag is coming from- it makes post effects seem to lag behind the opaque imagery by at least a frame.

    [EDIT 2] : I think this is caused by the GPU doing too much work. I saw a similar delay in legacy/2018 if I worked the device too hard. So, the LWRP has some unmanageable mobile overhead, it would seem...

    4) IBeforeRender, good. IBeforeRender interface not existing before Unity2019a.x, bad. Timeline for backport to 2018?

    5) GetPassToEnqueue should be allowed to return null and handled gracefully in editor at least, no?
     
    Last edited: Dec 14, 2018
  21. Heckmouse

    Heckmouse

    Joined:
    Nov 7, 2014
    Posts:
    27
    I'm using a two camera setup + camera culling masks to render my 3d UI elements in Orthographic while the rest of the game is rendered with a perspective camera.

    I just updated to Unity 2018.3 and it seems to have broken this functionality with the LRP. Is this something I should expect or does this sound like a bug?
     
  22. Jick87

    Jick87

    Joined:
    Oct 21, 2015
    Posts:
    124
    Posted this earlier today. I think it should help.
     
  23. Heckmouse

    Heckmouse

    Joined:
    Nov 7, 2014
    Posts:
    27
    Thank you for the heads up Jick87. What a shame, this completely destroys my game. I guess its back to the old rendering style.
     
  24. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    154
    Could you not just create a custom Render Pass that uses the View/Projection matrices of the Ortho Camera? Using additional Cameras will generate additional and potentially unnecessary overhead that can be avoided by just specifically issuing these render calls from inside the main Camera's loop.
     
    Heckmouse likes this.
  25. Heckmouse

    Heckmouse

    Joined:
    Nov 7, 2014
    Posts:
    27
    Thanks for the tip! Tho I'm afraid figuring that out will take me a more than few hours and now I'm spooked that this is all changing too much at the moment to be worth the effort.
     
  26. Fallc

    Fallc

    Joined:
    Mar 13, 2015
    Posts:
    48
    Hey Phil, is there any update on this?
    Otherwise, I would now start to inject the posteffects on my own with a ScriptableRenderPass.
     
  27. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    154
    @phil_lira @Fallc

    It's literally turned off for Stereo Cameras: DefaultRendererSetup.cs line 197

    That being said, I've seen some odd behaviour with some of the Stack's effects.
     
    Fallc likes this.
  28. Fallc

    Fallc

    Joined:
    Mar 13, 2015
    Posts:
    48
    Thank you very very much, this clears to biggest obstacle for our next release!
     
  29. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    146
    Late to the party... I don't know if this's the problem with the render pipeline or Unity's Shader Graph But I see there's a problem with our shader graph's premultiply blend mode.... It's acting like it's alpha blend.... Even though it's meant to be completely different...
     
  30. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    228
    Hi, I'm not sure my issue is related to LWRP itself, but as I do use LWRP for my project, I'll ask for help in this thread.

    I recently upgraded my project from 2018.2 to 2018.3. And the LWRP package was also upgraded from v3.0.0-Preview to v4.6.0-Preview.

    Before upgrading the project, the built app runs smooth on my target device (Mac Mini 2014). After the upgrade, the framerate drops due to huge GFX.WaitForPresent spikes. I tried to find the cause for this, and found out that disabling the MSAA in the LightWeight Pipeline Asset fixes this issue. It was set to '4x'(default), but caused no problem for Unity2018.2 and LWRP v3.0.0-Preview.

    Furthermore, setting it to '2x' causes the built app to crash on the target device. The GFXDeviceWorker thread crashed with a message below :
    Setting it back to '4x' doesn't cause the app to crash, but causes huge spikes on GFX.WaitForPresent.

    So I'll have to stick to the disabled MSAA for now. But I really want the MSAA back to my project.
     
  31. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    5.x has SRP batcher option available in the asset. That will give considerable performance boost if the game is CPU bound due to drawcalls.

    It's a troublesome feature to backport to 18.3. Depends on multiple c++ side PRs.
     
    bitinn likes this.
  32. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Hi Immu, I've checked the case. It's in triage phase pending more information. Could you help with repro steps so we can forward this to the correct team. (lwrp or core graphics)

    Regarding the shader compiler error. Does reimporting the shader fixed the problem?
     
  33. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Hey Joseph, thanks. I've opened a PR with your fix: https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/2667

    You can also open PRs for SRP if you feel like it. I'd gadly take review and take them.
     
  34. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Thanks for reporting that. I'll wait for triage and take a look at it. It seems like an issue in LWRP.
     
    P_Jong and bitinn like this.
  35. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584

    Thanks for the feedback.

    4) It will be backported. I have plans to do some backports to 2018.3 today.
    5) Definitely. Will do that as well.

    Regarding the PostFx feedback, I've poked PostFx team about it.
     
  36. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    On LWRP it's working in 19.1 (5.x). It's forcebly disabled in 18.3 (4.x) because to work across all VR platforms it depends on the backport some other changes to 18.3. There has been some discussion about the backports and it was decided they will be done. This PR is about to land on LWRP 4.x that re-enables it once the dependencies are in place.
     
  37. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Could you open a bug report for this? We will take a look and get back to you once we have a fix or answer.
     
  38. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Could you open a repro project for this. I've been taking a look at some MSAA issues recently. Will gadly take a look at this.
     
  39. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
  40. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    154
    I see some commits concerning stereo instancing in a branch, if that's what you're referring to.

    Under normal SPS the stack works, at least Bloom + Color Correction, by removing that hardcoded disable. This is SRP 4.x, 2018.3.0f2.

    I did have to make one additional change, which is in the RenderTexture creation Pass the base Descriptor will never allow for HDR (ARGBHalf). This is because when it gets the base RenderTextureDescriptor it just returns the XRSettings default which is ARGB32.

    Not sure if that was intended as I can understand that you may just be trying to avoid the extra bandwidth cost and potentially the additional ROP hit on some hardware?
     
    Last edited: Dec 22, 2018
    phil_lira likes this.
  41. zorrendor

    zorrendor

    Joined:
    May 27, 2017
    Posts:
    5
    Hi there, I have a question how to use Graphics.DrawProceduralIndirect with LWRP. I found the way to add callback endFrameRendering() in the end of Render() method from LightweightRenderPipeline.cs but it's not from the box and I need to update the file all the time when I download new version of the package. It would be nice if you could add the callback into the package or explain how to use procedural drawing without it. Thank you.
     
    phil_lira likes this.
  42. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Will there be examples of how to do the to make the scriptable render pass?

    "Users need to create a ScriptableRenderPass and inject in LWRP code to render things that require different camera matrices/fov. These vary on a case by case scenario, f.ex, rendering weapons in an FPS."

    Because im an artist and dont know how to program this and use playmaker for code, so I won't have a programmer to fix this for me.

    I just need it to be as simple as before, creating an additinal 2d camera on top of a 3d camera wich is partented to a camera holder object. this allowed me to make many nice effects.

    If its not easy to do I will not be switching to the SRP anytime soon.
     
  43. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    146
    As sent to you right now with some examples of my claim.
     
  44. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,684
    P_Jong and zorrendor like this.
  45. zorrendor

    zorrendor

    Joined:
    May 27, 2017
    Posts:
    5
    Thank you very much. I made ProceduralDrawing working with simple script. I hope it will be helpful for people:
    Code (CSharp):
    1. public class HexaspherePass : MonoBehaviour, IAfterOpaquePass
    2. {
    3.     private HexaspherePassImpl hexaspherePass;
    4.  
    5.     public ScriptableRenderPass GetPassToEnqueue(RenderTextureDescriptor baseDescriptor, RenderTargetHandle colorAttachmentHandle, RenderTargetHandle depthAttachmentHandle)
    6.     {
    7.         return hexaspherePass ?? (hexaspherePass = new HexaspherePassImpl());
    8.     }
    9. }
    10.  
    11. public class HexaspherePassImpl : ScriptableRenderPass
    12. {
    13.     public static Action<CommandBuffer> OnAfterOpaquePass;
    14.  
    15.     public HexaspherePassImpl()
    16.     {
    17.         RegisterShaderPassName("LightweightForward");
    18.     }
    19.  
    20.     public override void Execute(ScriptableRenderer renderer, ScriptableRenderContext context, ref RenderingData renderingData)
    21.     {
    22.         if (OnAfterOpaquePass != null)
    23.         {
    24.             CommandBuffer commandBuffer = CommandBufferPool.Get();
    25.  
    26.             OnAfterOpaquePass(commandBuffer);
    27.  
    28.             context.ExecuteCommandBuffer(commandBuffer);
    29.             CommandBufferPool.Release(commandBuffer);
    30.         }
    31.     }
    32. }
    33.  
     
    hugokostic and phil_lira like this.
  46. Deleted User

    Deleted User

    Guest

    Hi!

    We are having difficulties to get the Beffio Medieval Kingdom to work on the Unity LWRP 4.6.0.
    It has all worked good until LWRP 3.3.0 and we need now instruction on a upgrade path for the shaders.

    I followed the guide on this thread how to migrate custom shaders but there are a lot of errors.

    I´ve added the new libraries and replaced the old ones as per below:
    #include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
    #include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Lighting.hlsl"
    //#include "LWRP/ShaderLibrary/Core.hlsl"
    //#include "LWRP/ShaderLibrary/Lighting.hlsl"
    //#include "CoreRP/ShaderLibrary/Color.hlsl"
    #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/color.hlsl"
    #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
    #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/functions.hlsl"
    //#include "CoreRP/ShaderLibrary/UnityInstancing.hlsl"
    //#include "ShaderGraphLibrary/Functions.hlsl"
    #include "Packages/com.unity.render-pipelines.lightweight/Shaders/LitInput.hlsl"

    and added the new mandatory #praga multi_compile lines as instructed.

    The shader compile error I get in Unity is:
    undeclared identifier 'TangentToWorldNormal'

    (but I believe that's a consequence of another fault).

    Please advise on any direction for fault seeking.

    I've attached the modified shader.

    Many thanks!
     

    Attached Files:

  47. FURKANKAHVECI

    FURKANKAHVECI

    Joined:
    May 12, 2013
    Posts:
    27
    How can i download latest preview (beta) LWRP, to stable unity 2018.3.x ?
    I want latest version without downloading github software including git project 4.x gb size of alll render junk pipeline files. Any good, step by step documentation or video ? Please
     
  48. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    This shader is made with Amplify Shader Editor, you will have a better luck migrating it with ASE instead. Which I believe do support 4.x LWRP.
     
  49. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Go to Window -> Package Manager and download from there.
     
  50. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    My scene looks really dark and I am getting RGBA4 unsupported errors if I try to run LWRP in OpenGL2 - anyone else?

    19.1a12, 5.2.3
     
Thread Status:
Not open for further replies.