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

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    From C# you can use CommandBuffer.SetGlobalFloat https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer.SetGlobalFloat.html

    and here's the ShaderGraph docs for Properties: https://github.com/Unity-Technologi....shadergraph/Documentation~/Property-Types.md
     
  2. tom_painter

    tom_painter

    Joined:
    Nov 8, 2018
    Posts:
    13
    OK thanks @phil_lira , I'll wait until the 19.1 then and take another look

    I've noticed that most non-raytracing graphics engines (like renderman back in the day) have big problems with glass, but it would be great if we can have a nice box of tricks to help us along to get the best we can with low powered architecture.

    Also Ive had quite a few editor crashes, not sure if thats the 2018.3.0b9 or the 4.0.1 LWRP package?

    keep up the great work. the boat attack demo's tropical water looks absolutely amazing.
    :)
     
  3. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    561
    Hi @phil_lira

    Do you know how does one create a CustomEditor for LWRP camera component? I just want to listen for FOV setting changes with OnInspectorGUI, but the usual CustomEditor process doesn't work because LWRP is already overriding it with LightweightRenderPipelineCameraEditor.

    I believe I should be using CustomEditorForRenderPipeline to declare custom editor for SRP? but what should I inherit? I tried Editor and CameraEditor, neither of them append the label:

    https://gist.github.com/bitinn/58bc53c9b567cdd3f27318756b78189d

    Ref:

    https://github.com/Unity-Technologi...itor/LightweightRenderPipelineCameraEditor.cs
     
  4. khusainova_olga

    khusainova_olga

    Joined:
    Jun 26, 2018
    Posts:
    1
  5. CerebralFrost

    CerebralFrost

    Joined:
    Mar 28, 2017
    Posts:
    11
    Not sure if this is specific to the LWRP, but so far I haven't found anything in a quick search.

    Using Unity 2018.3.0b10, and LWRP 4.1.0, with VR enabled on an Oculus Rift, and Single Pass Instanced enabled, Terrain doesn't seem to render properly. I've tried with terrain instancing on and off, and the result is the same - no terrain is rendered in the right eye, and a very distorted terrain is rendered in the left.

    Right Eye (From the Frame Debugger XR.Blit pass):
    RightEye.png

    Left Eye (From the Frame Debugger XR.Blit pass):
    LeftEye.png
     
  6. Ryan_McMahon

    Ryan_McMahon

    Joined:
    Oct 11, 2015
    Posts:
    1
    The Scene Depth node was added to Shadergraph so people can make effects that require a camera depth texture, correct? For me in my LWRP scene the node only outputs completely black (0) or white (1) instead of a gradient between the two based on the depth. I made sure that Depth Texture is checked on both the main (and only) camera and the Pipeline Asset. If this was not the intended use then when will Camera Depth Texture be added to Shadergraph? Thanks for your hard work!
     
  7. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    561
    Can confirm the issue with Emission baking is now fixed in 4.2.0-preview (you need to be using 2018.3 beta to get that of course.)

    Also the issue with LWRP Asset "Per Object Limit" is fixed too.

    Screen Shot 2018-11-17 at 15.53.34.png
     
    phil_lira and Tesrym like this.
  8. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    561
    Screen Shot 2018-11-17 at 15.59.50.png

    One question regarding "Per Object Limit" remains: the latest doc still claim 8 lights per pixel/vertex. Is it going to be true for 2018.x releases? Or just future 2019.x releases?

    I am very much fine with 4 lights per pixel/vertex, just want to make sure the doc is reflecting the current status and future roadmap.
     
  9. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    189
    What shader is used for the Animation Preview window? (the one that shows the mecanim guy) Mecanim guy shows up all pink & the ground plane is pink. The root motion arrows are shaded correctly.
    2018.3.0b10 & LWRP + CoreRP 4.2.0
    I've tried recompiling all shaders and checking for errors but nothing so far.
     
  10. LeGiangAnh

    LeGiangAnh

    Joined:
    Nov 10, 2013
    Posts:
    113
    Hi all. Is there any way to use the new 4.2.0 version for Unity 2018.2? Upgrading our project to new Unity version is quite risky for us.
     
  11. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    561
    AFAIK, no.

    2018.3.0b users can't use 5.x-preview neither, AFAIK each major increment actually depends on Unity core engine changes.
     
  12. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    343
    I m using lwrp 3.0 using lwrp standard shader and depending on what direction i am viewing the objects appear completely black or with the texture they should have
    About fps i get less fps with lightweight than with normal rendering
    About when lwrp will stop being a preview?
     
    Last edited: Nov 20, 2018
  13. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    561
    AFAIK 2019.1:

    https://forum.unity.com/threads/fee...-render-pipelines.470095/page-21#post-3873061

    https://forum.unity.com/threads/lwrp-4-0-1-preview-is-out.562291/page-3#post-3869758

    I have argued for a stable release within 2018 LTS timeline, hopefully they can make something happen:

    https://forum.unity.com/threads/fee...-render-pipelines.470095/page-21#post-3873364

    https://forum.unity.com/threads/lwrp-4-0-1-preview-is-out.562291/page-3#post-3870511
     
    Immu, hippocoder and dienat like this.
  14. ivank

    ivank

    Joined:
    Nov 16, 2013
    Posts:
    43
    Hello @phil_lira ,
    I run into trouble when testing Unity 2019.1a8 with LWRP 5.0.0.
    When trying to publish/build WebGL, the following error messages appear (exact wording and whole scene setting please see in attached picture) and the build attempt is unsuccessful:
    "Library\PackageCache\com.unity.render-pipelines.lightweight@5.0.0-preview\Runtime\LWRPAdditionalLightData.cs(19,37): error CS0246:
    The type or namespace name 'MenuCommand' "
    ...and also 'MenuItemAttribute' and 'MenuItem'..."could not be found (are you missing a using directive or an assembly reference?)"
    Scene set to WebGL, with default background, light and camera, added one cube, painted with "standard" LWRP Lit material.

    I post it here as it seems its just a minor omission in the LWRP package(?) even when it prevents to use the WebGL platform completely.
    Or does this post belong better to 2019 forum? Or even to bug report?

    Another minor but annoying error related to LWRP - whenever any "standard" LWRP Lit material is created in Material folder and/or appears in the Inspector, error messages saying the Material doesn't have a texture property '_ParallaxMap', '_DetailAlbedoMap' and '_DetailNormalMap' begin to pop up (also visible in the attached picture).

    Sorry for long and not quite entertaining post:)
     

    Attached Files:

  15. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    if you update (via package manager) to 5.1.0 this should be fixed.
     
    ivank likes this.
  16. ivank

    ivank

    Joined:
    Nov 16, 2013
    Posts:
    43
    Thanks for the info, @Tim-C !
    I can confirm that with the LWRP 5.1.0 both above mentioned problems are gone.
     
  17. Captain_Flaush

    Captain_Flaush

    Joined:
    Apr 20, 2017
    Posts:
    33
    If I select a propriety in a subgraph to not be exposed anymore, it still gets exposed when I use that subgraph node.
    I would need this feature to make some subgraphs that use global variables and simplify my shaders.
    Right now I define a global variable in the subgraph, and I need to redefine it in the shader and relink it to the subgraph.
    Am I missing something here?
     
    Last edited: Nov 21, 2018
  18. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    885
    P_Jong and Shizola like this.
  19. ChannexDK

    ChannexDK

    Joined:
    Apr 14, 2015
    Posts:
    9
    Would it be possible to somehow support UI-only cameras? Since UGUI is pretty much hacked (ok, not properly exposed) into the rendering pipeline, it's basically impossible to render a canvas into a rendertexture without using a unity camera. The problem is, that doing so requires a full culling pass on the scene which takes up quite a bit of CPU in the current version (LWRP 4.3 / 2018.3).

    A possible design could entail being able to skip the culling pass entirely by including that into the IRendererSetup interface and expose the emitCanvasDataForCamera so that it can be pushed by a renderpass. But this is obviously just a guess, based on the available source code.
     
  20. ALL-CAPS

    ALL-CAPS

    Joined:
    Jun 23, 2014
    Posts:
    8
  21. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    So we've been talking about this over the last few days here, and this is something we want to support, but not quite like you are describing. One of the biggest issues in old unity rendering is that you need a separate UI camera. What this leads to is needing to do multiple cull calls and multiple render executions. This is a performance killer.

    What we want to do is this:
    1) Have a custom (injectable) pass for rendering UI
    2) This pass references a camera for it's settings (UI camera or something)
    3) The pass is rendered at the correct place in the pipeline (before or after post depending on what you want)
    4) The pass will use the settings from the UI camera (isometric or whatever other settings).
     
    VOTRUBEC likes this.
  22. BolverkGames

    BolverkGames

    Joined:
    May 21, 2015
    Posts:
    1
    Sounds like a reasonable solution. It would be really awesome to be able to just render the UI into a rendertexture without the whole camera setup, but I understand that might not be possible without rewriting huge portions of the canvas rendering.

    Do you have any idea when a faster UI rendering path would be available? Right now the rendering takes up 3-4 ms CPU time on our console build (of which 0.3ms is the actual rendering - the rest is basically culling and setup) which is really hurting us (being a VR title!). I am having a hard time figuring out a workaround since the current design is so closed.

    (Channex replying - forgot to change login -woops!)
     
  23. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    If you use screen space overlay or world space UI you won't have this problem. The only type of UI that has this issue is screen space camera. For VR most people go with a world space UI that is parented to the main camera. I know this is not ideal, but it is a workaround till we get a fast path for screen space camera mode in lwrp.
     
  24. ChannexDK

    ChannexDK

    Joined:
    Apr 14, 2015
    Posts:
    9
    I'm afraid that's not quite possible with the UI we are going for (we have shipped several VR titles, so we are well aware of the worldspace UI). Basically we render the UI in lowres (this is the step causing all sorts of problems), upscale and apply various effects and then show the rendertexture on a 3D model. So really what I am after is a way to render the UI into a texture which seems basically impossible in the current design. I'm obviously not using any of the input mechanics in the UI system (not really designed for VR in the first place), so it's really only the rendering I'm after.

    So if you can point me to any kind of workaround where I can postprocess (+upscale) the UI and render it on a 3D model, it would be awesome. Like I pointed out, I really just want some way of bypassing all other processing of that specific camera. I have already made a custom IRendererSetup on my UI cameras to cut down on passes, but unfortunately, like we discussed, the UI only injects itself during the regular culling phase - and it's not even possible to cache/save the culling result as far as I can tell (since the camera would always only "see" the UI canvas, that could have been a workaround, albeit a bad one).

    Another alternative would obviously be to render the UI geometry by hand (using a commandbuffer), but I can't really see a way to get hold of the geometry created by the canvas/canvas renderer. SetMesh() on canvas renderer is mostly undocumented, but it seems to do the opposite: Render 3D geometry into the UI - is this correct?

    I have attached an image showing our UI process (warning: Coder art!)
     

    Attached Files:

  25. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    72
    I have been using the LWRP and everything has been going great until my last build. Now all the screens are having a transparent red overlay of some sort!. Any idea what might be going on here? It looks fine in the editor, it is only on the device that it looks like this.
    I tried resetting the built in shader settings in the Graphics Settings as suggested somewhere but it did not achieve anything.

    Top image is what it should look like. Lower image shows what all scenes are now looking like
    Screen-normal.png Screen-red.png
     
  26. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    what does it look like in the frame debugger?
     
  27. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    72
    Debugger.png

    I am not so familiar with the frame debugger. For some reason it is unable to connect to the device player.
     
    Last edited: Nov 29, 2018
  28. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    561
    Sharing a weird issue: after upgrading to Unity 2018.3.0b12 and LWRP 4.3.0-preview (from 2018.3.0b11 and 4.2.0), lightmap baking and viewing Lit material with emission throws following errors, BUT they appear to work in scene/game view.

    I ended up removing the Library + Temp + obj folders, then reimport the repo again, things are fine after that.

    So the upgrade process appears to created some invalid cache, at least on macOS and Metal.

    Screen Shot 2018-11-29 at 23.23.07.png
    Screen Shot 2018-11-29 at 23.23.17.png
    Screen Shot 2018-11-29 at 23.26.02.png
     

    Attached Files:

    P_Jong likes this.
  29. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    72
    I can confirm that I just identified the problem here. I was using the AVProVideo for IOS plugin, and the screen was going red when I had "“Use YpCbCr420” " selected
     
    phil_lira likes this.
  30. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    Hi bitinn. You cannot override the LWRP Camera editor. The reason is not being called is because that editor you created is not being used.

    I suppose you could comment out the attribute in LWRP camera editor, do a new editor inheriting from the LightweightRenderPipelineCameraEditor, but even if that works I don't recommend doing that.

    We could perhaps think of a way to provide you a callback to listen to editor changes. Would that be useful?
     
  31. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    We will increase that limit. We are just trying to figure out how to do it without a performance regression on gles2/gles3.0
     
  32. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    We will not allow Depth Only and Don't Clear modes in LWRP. We are still discussing what to replace it with. The reason is that thse options come with a hidden bandwidth cost for mobile. Users usually use this to achieve camera stacking, i.e, the current camera reading from a previous camera result.

    In most of the cases this should be done as a custom render pass in the renderer.
    Could you share details of what you are trying to achieve so we can provide you an alternative that works with LWRP?
     
  33. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    561
    That would be useful, by the way, my goal was pretty narrow: I wanted to drive my scene view camera's FOV by listening to game view camera's FOV change, so my need is exclusively for editor mode, not play mode.

    (I imagine in play mode I will only drive game view camera's FOV by user input, and never the other way around.)
     
  34. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    561
    I reported a new issue case 1105661: which has to do with Unity 2018.3.0b12 causing a very slow and probably unintended repaint of inspector window when viewing certain LWRP material (using only default Lit Shader, and emission toggle is enabled), making the scene view navigation and even the whole editor laggy.

    Let me know if it lacks any info.

    actual-repo-repaint-time.png
     
    Last edited: Dec 1, 2018
    Astarorr and phil_lira like this.
  35. ChaoticBox

    ChaoticBox

    Joined:
    Mar 6, 2015
    Posts:
    6
    I touched on this in the old LWRP thread but I'm still wondering if LWRP will ever be truly scalable at runtime. It supports hot-swapping config assets but it now uses the asset assigned at build-time to strip shaders so you can easily shoot yourself in the foot...

    The asset still only supports a few runtime tweaks, and it seems even those are broken in players unless you clone, tweak and replace the current asset. Things like shadow resolution and even opaque downsampling size really need to be freely tweakable at runtime to scale quality across a range of devices without resorting to creating dozens of assets for every possible combination (and hoping those will even work after shader stripping).

    A mutable "no strip" mode would also be really useful for profiling features and settings on actual devices. Right now this is a huge pain.
     
    bitinn likes this.
  36. VOTRUBEC

    VOTRUBEC

    Joined:
    Dec 17, 2014
    Posts:
    47
    Hi Phil, I was using the previous mentioned "hack" to get AO in the Post Processing working with the LWRP. But in the latest update 4.4-preview, the classes, that were needed to achieve the hack, have had their protection levels tightened, breaking the hack. I hope this means that AO is going to be re-enable in Post Processing for the LWRP? The very nature of the game I'm building means that the users are going to have mid to high level iOS devices, with short game play intervals. So in my case, the visual quality is of (slightly) higher concern to me than a high framerate (think check in once or twice a day, make a move, close app). The scene is also dynamically generated and lit, so prebaking isn't an option at this stage.
     
  37. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    154
    Hi there, small questions,
    First, when are we going to have clear changelog ?
    https://docs.unity3d.com/Packages/c...ines.lightweight@4.4/changelog/CHANGELOG.html
    Because github doesn't have the clearest changelog either..

    Second, why now all my meshes disappear if postprocessing is enabled with LWRP 4.4.0 + Post Process 2.1.1 (or 2.0.20) ?
    (https://answers.unity.com/questions/1510421/post-process-v2-post-process-layer-hides-all-meshe.html)

    With errors like these


    Eitherway, very disappointed to lose so much time on such a random mess :(

    Thanks
     
    Last edited: Dec 2, 2018
  38. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    561
    You mean this changelog? You need to view it through release tag:

    https://github.com/Unity-Technologi...tweight/CHANGELOG.md#440-preview---2018-11-30

    Also note that because all SRP version are bumped together, sometimes LWRP might bump version but doesn't contain changes (AFAIK).

    As for your errors, try removing Library/Temp/obj folder and reimport the whole repo, or simply reimport all SRP related packages by right-clicking on them and select reimport, might work. It works for my case.
     
  39. renardmf

    renardmf

    Joined:
    Jun 29, 2012
    Posts:
    46
    Hello,

    Thanks for fixing the LWRP VR post processing issue, it will help the project I am working on a lot! But now, it seems like I am having some depth drawing issues related to transparent shaders in VR. It seems to happen with world space ui or just a mesh with a shader set to transparent, but objects in front of the camera will draw a lot closer to the camera than they should be and there is also some weird render eye artifacts happening as well. I am running Unity 2019.1a10 with the 5.1.0 Render Pipeline project.

    Thanks again!
     
    phil_lira likes this.
  40. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    All settings that don't control shader stripping are exposed in 5.2+ version. I'll backport this to 4.X.

    Regarding the asset shader stripping. We have planned to check stripping based all assets included in the build.
     
  41. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    What classes have gone internal/private that you need for this?

    We have planned for next year reworking on post processing effects for mobile, AO being the highest priority one since it's missing in LWRP. This is either 19.2 or 19.3.
     
    noio likes this.
  42. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    I'm glad it worked out. Can you open a bug report for this issue? Then we can get back to you as soon as it's fixed.
     
  43. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    154
    Ah well, there's no release tag in the link when clicking on the changelog button of the package in package manager, so it leads to an error page.
    Hence why I was confused, I indeed go to the github page manually otherwise.
    But I'm kinda surprised not to see even an entry to say 'numberversion: date : bump' even if there's no notable change in the changelog.
    (edit: well, now those entries have been added, but a bit late ^^)

    I had to reimport the whole project library a few times, Since I'm using collaborate and they've some hiccups lately, I think that was the source of my problems. It's sorted for now. Thanks
     
    phil_lira likes this.
  44. VOTRUBEC

    VOTRUBEC

    Joined:
    Dec 17, 2014
    Posts:
    47
    Hi Phil, at a quick glance, it looks like:
    internal sealed class AmbientOcclusionRenderer : PostProcessEffectRenderer<AmbientOcclusion>
    internal sealed class MultiScaleVO : IAmbientOcclusionMethod

    Out of curiosity, and I might be showing my naivete here, but has AO been hobbled because it simply doesn't work with the LWRP, or that the performance is so bad, it was excluded? If there's a hack that gets it working, why the hoops?
     
  45. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    Looks like you are running LWRP from Github/staging as we don't have a 4.4.0-preview public version yet. We haven't done QA on that one yet, so I'd recommend staying on 4.3.0-preview for now.
     
    Immu likes this.
  46. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    We just figured out there's an issue while setting the cache for these asset settings. We are working on a fix for it asap.
     
  47. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    MSVO is not supported natively because it depends on compute and in mobile compute is not realiable on all platforms.
    I poked PostProcessing team and these classes were moved to internal because there's public API wrapping their behaviour. BakeMSVOMap could be used instead.

    https://github.com/Unity-Technologi...essing/Runtime/PostProcessLayer.cs#L645..L662

    Here's an example of how to use it (HDRP). So that's all that's needed.
    https://github.com/Unity-Technologi...nderPipeline/HDRenderPipeline.cs#L1924..L1937
     
    VOTRUBEC likes this.
  48. Raali_Oloth

    Raali_Oloth

    Joined:
    Jul 29, 2013
    Posts:
    22
    Hello, i have set soft shadows in my lwpr settings asset but it seems like shadows are always hard in standalone windows builds but not in the editor.
    What can be the problem? (i deleted all quality settings but one that i use)
     
  49. janloehr

    janloehr

    Joined:
    Jun 30, 2017
    Posts:
    8
    Hey,

    I don't know if this was reported already. I'm using a Little different camera setup and need to play with the camera matrix. This messes with Realtime-Shadows. Recently Unity introduced the Physical Camera Setting (which does exactly what I need as well), so you can reproduce it fairly easy by following those steps
    1. create an empty Project with LWRP
    2. open the sample Scene
    3. set the Directional Light to produce Realtime-Shadows
    4. set the camera to be physical
    5. Play with the Lens Shift Y value (X is fine)
    upload_2018-12-6_19-53-51.png

    Shadows will go crazy
    upload_2018-12-6_19-53-35.png

    Interesting thig is, that the Scene as well as the camera preview can deal with it, it's just the game view (and the build of Course)
    upload_2018-12-6_19-58-14.png

    I'm on 2018.3.0b12 with LWRP 4.3.0
     
  50. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    25
    Hi there,
    Is there a problem on Metal-iOS to generate mipmaps for a rendertexture? I'm writing a reflectionshader to make things blurry, so i am creating mipmaps on cam script. It just works if i switch to openlg-ios, but not works and displays very ugly texture on Metal?
     
Thread Status:
Not open for further replies.