Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

LWRP: 4.6.0-preview (18.3) & 5.2.1 (19.1) are out

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

  1. Andre_Mcgrail

    Andre_Mcgrail

    Unity Technologies

    Joined:
    Dec 9, 2016
    Posts:
    111
    We are planning to have a better AO solution for LWRP, in the form of a post effect, this will mean much easier to configure and will not require baking it in(dynamic objects will work too) but right now the current Unity AO solutions are too heavy for mobile usage. There are some very dirty versions you can do quite easily as a post effect with only a depth map, but the results are very basic. We are hoping to find a nice intermediate this year which works well on both a 10 year old phone and still look pretty nice.
     
  2. lxmllr

    lxmllr

    Joined:
    Mar 27, 2018
    Posts:
    4
    Trying to bump this again with something a bit more specific..

    So this chunk was taken from the LWRP.cs Render() function:
    Code (CSharp):
    1.             SortCameras(cameras);
    2.             foreach (Camera camera in cameras)
    3.             {
    4.                 BeginCameraRendering(camera);
    5.  
    6.                 foreach (var beforeCamera in camera.GetComponents<IBeforeCameraRender>())
    7.                     beforeCamera.ExecuteBeforeCameraRender(this, renderContext, camera);
    8.  
    9.                 RenderSingleCamera(this, renderContext, camera, camera.GetComponent<IRendererSetup>());
    10.             }
    I know you guys have said you're working on documentation but getting a look at something in-progress would be better than nothing at all right now. It's been kinda hard to hunt and peck around the files to figure it out for myself. Any kind of info about this array of cameras getting passed in, how it is supposed to be used, and if this is the correct spot to start extending it's behavior? Thanks again.
     
    Last edited: Jan 8, 2019
  3. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    56
    LightweightRenderingPipeline seems to be incompatible with Unity 2019.
    In 2018 my project was working fine with LWRP, but nowI am just getting a pink screen and loads of errors such as:

    Library/PackageCache/com.unity.render-pipelines.lightweight@5.2.3/Editor/ShaderGraph/LightWeightPBRSubShader.cs(5,19): error CS0234: The type or namespace name 'Graphing' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
     
    Last edited: Jan 9, 2019
  4. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    370
    Right click on the package folder and select reimport all and that should fix it. For me, it fixed some of my projects and other when I update to the latest 2019.1 Alpha a13. Not sure why but it's something to keep in mind if you are on an older version.
     
  5. lxmllr

    lxmllr

    Joined:
    Mar 27, 2018
    Posts:
    4
    I'm sorry, but
    isn't really enough for me to go on. How do I add a ScriptableRenderPass? How do i Inject the RP code?
     
  6. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    364
    lxmllr likes this.
  7. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    364
    One more question (not holding my breath since my previous 2 Qs wasn't getting answers...):

    UNITY_USE_NATIVE_HDR, this flag is only used once in the entire SRP project, but has no documentation. Is it referring to HDR flag on camera or the HDR flag on LWRP asset? Is it hardware dependent?

    It's used to decide whether indirect specular should decode HDR environment to RGB. But the result is returned as such:

    Code (CSharp):
    1.  
    2. #if !defined(_GLOSSYREFLECTIONS_OFF)
    3. half mip = PerceptualRoughnessToMipmapLevel(perceptualRoughness);
    4. half4 encodedIrradiance = SAMPLE_TEXTURECUBE_LOD(unity_SpecCube0, samplerunity_SpecCube0, reflectVector, mip);
    5.  
    6. #if !defined(UNITY_USE_NATIVE_HDR)
    7. half3 irradiance = DecodeHDREnvironment(encodedIrradiance, unity_SpecCube0_HDR);
    8. #else
    9. half3 irradiance = encodedIrradiance.rbg;
    10. #endif
    11.  
    12. return irradiance * occlusion;
    13. #endif // GLOSSY_REFLECTIONS
    14.  
    In particular, I don't understand why encodedIrradiance.rbg is returned when the flag is set, does Unity store HDR environment image differently? As in storing Blue color in Green channel as Sky is more likely Blue or something?
     
  8. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    290
    That's a bug. Thanks for reporting it. We have a PR on github to fix it.
     
  9. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    290
    Reflection Probes (as lightmaps) might be encoded in native HDR texture (16bit per channel or BC6H) or encoded in either RGBM or dLDR. If UNITY_USE_NATIVE_HDR is set that means the texture is not encoded and we just sample it without decoding. Otherwise we decode by calling DecodeHDREnvironment and that depends on the encoding type (RGBM/dLDR) and the colorspace.

    As for how they are encoded. It depends on the platform and your project settings.
    Settings that affect it are LightmapEncoding in PlayerSettings -> Other Settings.
    For mobile, it will default to dLDR, unless you override the Texture Compression setting. Then it will depend if the device supports and in the PlayerSettings.
     
    bitinn likes this.
  10. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    290
    Regarding the ScriptableRenderPass architecture. This piece of API we left under experimental namespace because we are not yet comfortable with it. We are investigating how to make it easier to setup and inject custom render passes. That's why we didn't start writing docs on it yet.

    If you used it and have feedback on it now it's the time to help shape the API :D
     
  11. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    120
    Any news on premultiply yet? I hate talking like a broken record, but the blend mode's bugged, Acting more like an alpha blend.
     
  12. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    364
    I am seeing some strange behavior with Reflection Probe baking when using a metallic = 1, smoothness = 1 material.

    I adjust environment light bounce between 2 and 5, and the black faces remain.

    Screen Shot 2019-01-13 at 3.28.07.png Screen Shot 2019-01-13 at 3.28.14.png

    Is this a known issue for LWRP 4.6.0 + Unity 2018.3?

    The more confusing thing is the face might bake just fine in some cases:

    Screen Shot 2019-01-13 at 3.49.07.png Screen Shot 2019-01-13 at 3.49.21.png

    I will open a ticket later, not sure this is hardware dependent or not, but I am on macOS + Metal API + Intel GPU.

    EDIT: This issue is now reproduced in 2018.3.1f and opened as case 1116857
     
    Last edited: Jan 13, 2019
    phil_lira likes this.
  13. luniac

    luniac

    Joined:
    Jan 12, 2011
    Posts:
    446
    Shadowmask lighting coming to LWRP?
     
  14. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    290
    Hey Mythril, sorry about that. What's the issue you're seeing, I might have missed it. Does you have a case number. We support premultiply in the Lit shader.
     
  15. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    290
    It will be supported. I don't have an ETA for you atm but we are working on a public roadmap for LWRP so we can make clear what's missing in comparison with Built-in and when it's being supported.

    Most of the work in 19.1 will be focusing on adding features to LWRP so it to becomes feature parity with Unity. The exception are some Built-in features we want to deprecate, but we will look to provide alternatives for things like GrabPass, ShaderOverride, Camera Stacking, and so on.
     
  16. castana1962

    castana1962

    Joined:
    Apr 10, 2013
    Posts:
    276
    Hi
    Sorry for my ignorance but I am working with VR projects and I am interested in learning about LWRP, for it, Could anybody advice about course or tutorial about it?
    Thanks in advance
    Castana
     
  17. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    107
    Hi LWRP preview 4.7.0 has been released (2018.3.1.f1) but I don't see any notes in the changelog.
    Could we have details before I update from 4.6.0 ?
     
    Shorely likes this.
  18. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    364
    Shorely likes this.
  19. Shorely

    Shorely

    Joined:
    Dec 17, 2018
    Posts:
    133
  20. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    364
    Visually, it allows you to do things like planar reflection via some coding:

    https://github.com/UnityTechnologies/LWRPScriptableRenderPass_ExampleLibrary

    Programmatically, it allows you to do extra processing before or after rendering of a scene, the goal is to make use of current render result to do some tricks like above, so it's like post processing, but not necessarily the whole screen.

    AFAIK this entry refers to "adding a new API" that's compatible with LWRP 5.x (Unity 2019.x) releases. Not the ability to do extra rendering, which was already possible using an older API.
     
  21. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    364
    I said it in another thread I might as well say it here:

    - Quick note: don't use GitHub release that wasn't released officially via Package Manager unless you know the package like the back of your hand.

    - Reason: there are times they haven't passed the QA test, meaning, only consider the Package Manager version to be final.
     
  22. Shorely

    Shorely

    Joined:
    Dec 17, 2018
    Posts:
    133
    Argh. Brilliant. Does that mean it could be used for blurring a specific object based on its rate of rotation? Just as a random example ;)

    https://forum.unity.com/threads/radial-single-object-motion-blur-lwrp.609652/
     
  23. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    107
    Thanks bitinn ;)

    By the way, with this latest version, with unity cloud build, I receive this error for LINUX (windows and mac compiles fine):
    Code (CSharp):
    1. [Unity] -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Unity.RenderPipelines.Lightweight.Runtime.dll
    2. 22: [Unity] Library/PackageCache/com.unity.render-pipelines.lightweight@4.7.0-preview/Runtime/DefaultRendererSetup.cs(2,42): error CS0234: The type or namespace name 'LWRP' does not exist in the namespace 'UnityEngine.Experimental.Rendering' (are you missing an assembly reference?)
    3. 23: [Unity] Library/PackageCache/com.unity.render-pipelines.lightweight@4.7.0-preview/Runtime/DefaultRendererSetup.cs(41,22): error CS0246: The type or namespace name 'IBeforeRender' could not be found (are you missing a using directive or an assembly reference?)
    Maybe I just need to reimport the project. I will and edit this if anything changes.
     
  24. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    290
    Hi, regarding 4.7.0-preview. It's not in our production repository yet, only in staging. Before moving from staging to production we do release QA.

    What's holding it from being released is that we found some issues in mobile VR with that version.
     
  25. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    290
    Thanks for sharing.
    That is caused by a namespace error when backporting the PRs required for AR... We will have to fix it.
     
  26. Nikodemus

    Nikodemus

    Joined:
    Nov 28, 2014
    Posts:
    14
    Will 4.7.0 fix postprocessing in VR?
     
    castana1962 likes this.
  27. Nikodemus

    Nikodemus

    Joined:
    Nov 28, 2014
    Posts:
    14
    Rendering from a second camera in 2018.3.1 with 4.6.0 preview to a rendering texture does not work in LWRP and VR mode. The second you turn on the VR camera the texture stops updating or turns black. It works as normal in a non-VR mode so this is a game breaker if you want to have a scoped rifle for instance in VR.
    *EDIT*
    2019.1 seems to solve the above but creates new issues instead.
     
    Last edited: Jan 15, 2019 at 7:36 PM
    castana1962 likes this.
  28. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    120
    It would be case 1112145, Unless Alpha's not meant to be a back buffer image in Premul.
     
  29. castana1962

    castana1962

    Joined:
    Apr 10, 2013
    Posts:
    276
    Hi
    Sorry for my ignorance and my little English but I am interested in using it for my own VR projects, for it, Do you know if it would be VR ready soon? Thanks for your time
     
  30. beinteractive

    beinteractive

    Joined:
    Apr 10, 2014
    Posts:
    21
    Last edited: Jan 16, 2019 at 8:42 AM
  31. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    290
    We are testing a new package today. 4.7.0-preview is a no-go for production.

    We re-enabled Post and VR in 4.7.0-preview but found out that it was not properly tested on mobile. So, we will disable post processing for mobile until VR and Postprocessing team fix it. On PC it should be fine, but please let us know if you find any issues.

    There are still a few issues. The major ones I'm aware of are:
    1) Shader variants in VR are causing long build times.
    2) PostProcessing on mobile is disabled.
    3) SRP Batcher is not compatible with VR yet.

    If you are experiencing more issues please create a bug report and feel free to report also here the case number. These issues sometimes depends on multiple teams to fix and this way I can stay on top of them.
     
  32. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    290
    *Depth Only* and *Don't Clear* are not supported in LWRP because we don't support camera stacking.
    In 19.1 we are replaced camera Clear Flags with Background Type to be clear about this and don't allow you to select configurations that don't work in LWRP.
    https://docs.google.com/document/d/1GDePoHGMngJ-S0Da0Fi0Ky8jPxYkQD5AkVFnoxlknUY/

    To prevent that clearing issue in 18.3 we changed Don't Clear to behave same as Solid Color. A new package is coming out soon with this.
     
    Shorely likes this.
  33. beinteractive

    beinteractive

    Joined:
    Apr 10, 2014
    Posts:
    21
    Wow, It's a big change.

    Can I see any ScriptableRenderPass injection example? (ex: Render a scene in perspective -> Render some models in orthographic as overlay -> Render uGUI)
     
  34. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    290
    The best thing we have in terms of examples is this atm: https://github.com/UnityTechnologies/LWRPScriptableRenderPass_ExampleLibrary

    This API is still under experimental namespace because we want to be able to make it simpler and also provide some built-in scripts for things that require special tricks/projection like guns in FPS.

    Also, atm Screen Space - Camera render mode is not supported but we will add support to it.

    Later this week I'll post a doc with some WIP public roadmap and feature comparison table between LWRP and Built-in.
     
    bitinn likes this.
  35. Shorely

    Shorely

    Joined:
    Dec 17, 2018
    Posts:
    133
    Sorry to bother.

    All other things being equal, is LWRP faster than Built-in on devices?
     
  36. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    120
    And I see what you mean. Works for PBR... Not for unlit.... Bizarrely enough.
     
  37. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    290
    Hi all, here's a WIP document to compare current state (2019.1) of LWRP and Built-in in terms of features, along of ETA for features. The items flagged with "In Research" means we don't have it in the plans for 2019 roadmap.

    We are working on getting a public roadmap with cards as well so you can vote and help us prfioritize the work on the most important features.

    https://docs.google.com/spreadsheets/d/1nlS8m1OXStUK4A6D7LTOyHr6aAxIaA2r3uaNf9FZRTI/edit?usp=sharing

    Let me know what you think. We will also add this to package docs.
     
    bitinn likes this.
  38. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    290
    Regarding performance. I'm working on a project with some baseline performance tests (fillrate of different shaders, batching/cpu cost and bandwidth cost). so we can test wide on devices and share results with you. Hopefully I can share this soon.

    I have recent performance tests with 5.3.0 on an iPhone 6S.

    1) A fillrate test rendering 2.5x native resolution comparing LWRP Lit vs Standard Lit with 1 directional + 4 lights:
    LWRP renders with about 4ms less than Builtin (13.x vs 17.x ms) - GPU time.
    2) A bandwidth test rendering shadows + opaque + transparent + post + msaa + HDR.
    LWRP renders about the same GPU time but is consuming more bandwidth than Built-in (161MB L/S vs 148.2MB L/S)
    I'm atm looking at reducing bandwidth cost in LWRP, in fact 5.3.0 comes with a few improvements in that area.
    3) I didn't finish yet a batching baseline performance test of LWRP vs Builtin, but another dev shared with results on SRP Batcher on and off in LWRP, which should be pretty close comparison to Builtin. In a scene with 1024 renderers casting shadows using 1024 diff materials. On an S8 Adreno LWRP with SRP Batcher is taking 38.5ms (CPU Time) vs without SRP batcher (56ms). To give more context about this. SRP Batcher is coming enabled by default with 5.3.0. It currently supports only Vulkan and Metal but the work to support GLES3 is in progress.
     
  39. Shorely

    Shorely

    Joined:
    Dec 17, 2018
    Posts:
    133
    PLEASE!
    How do I edit one of these materials that are the default materials when creating a new blank scene, making a cube, and it having an non-accessible default material upon it:

    Screen Shot 2019-01-18 at 2.25.25 am.png
     
  40. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    73
    Can you not just create a new material and assign it to the cube?
     
  41. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    73
    Is there no support for D3D for the SRP Batcher, or am I misunderstanding? I have turned it on in our branch of 4.x and it appeared to be doing *something*, though I may be imagining things.

    In regards to the performance testing, I too have been seeing higher bandwidth costs than expected with LWRP. We won't be moving to 2019.x for this initial release, so 5.x is not an option for us. I'm not requesting a back port to 4.x, but do you think a back port is possible? I can merge code myself in our local branch but I know there may be some core engine dependencies.

    Speaking of the Shader Variants in VR, this was so crippling to our iteration that we actually stripped Standard Shaders all together and have instead opted to only use ShaderGraphs. If there is anything else you can speak to, or would like some additional insight as to what we are seeing I'm more than happy to help.
     
    Last edited: Jan 17, 2019 at 5:15 PM
    Shorely likes this.
  42. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    364
    So you have tried the mini profiler and it didn't change anything?

    https://forum.unity.com/threads/srp-batcher-in-2018-2.527397/#post-4099828

    I can see SRP Batcher helped to reduce draw call on my end, but I am using Metal API (not enabled by default in 2018.3, but can be enabled at runtime apparently)

    Screen Shot 2019-01-18 at 11.32.59.png Screen Shot 2019-01-18 at 11.33.13.png Screen Shot 2019-01-18 at 11.35.22.png Screen Shot 2019-01-18 at 11.35.39.png
     
  43. Shorely

    Shorely

    Joined:
    Dec 17, 2018
    Posts:
    133
    How do you find the Shader Graph to be? I'm coming from 3ds Max and its many renderers. I don't know much about shaders/materials in Unity. Almost nothing. Have been avoiding them until now... but must.face.them.now... it.is.my.destiny!
     
  44. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    73
    Results were inconclusive using the Stats window and better diagnostics tools like RenderDoc and NSight weren't revealing anything further, hence my inquiry.

    Our Render loop and Material definitions are quite well optimized as it is, so I'm not ruling out that even if it does work with D3D, it may have little to no effect in our case.

    On a side note, I see on a re-read that @phil_lira mentioned it doesn't work with VR yet, so it actually wouldn't matter in our end use-case.
     
  45. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    370
    If you've used any other material/shader editor before you should be fine. It's basically the same for all of them in any engine you use, path/raytracers included (except these have some other advanced features built into their master nodes but they share a lot)

    If you're completely new don't worry. there's a lot of tutorials out there that you can use to learn from (keep in mind it doesn't have to be Shader Graph specific). I would suggest starting off with recreating a basic version of the standard shader. Basically just adding texture inputs and tiling.
     
  46. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    73
    I don't actually use ShaderGraph, but the Content Creators on our team do. They are making cool things with it, but I have had to make modifications and additions, as well as custom Master Nodes to really be able to unlock them.

    It is as intuitive as a node editor can be, but it is somewhat limited in its current state. It mostly serves as a surface abstraction, rather than a full-blown Shader Editor at this point.

    Still, very good, because it puts the power in the Artists hands and unblocks them from waiting on someone like me who otherwise has to hand write everything.

    There are performance concessions that you'll make, too, as naive implementation on top of a node abstraction will never be as efficient as hand-optimized HLSL.
     
  47. Shorely

    Shorely

    Joined:
    Dec 17, 2018
    Posts:
    133
    This is the bit I'm worried about. That I'll get carried away with the shiny and not know what it's doing to rendering times.
     
  48. Shorely

    Shorely

    Joined:
    Dec 17, 2018
    Posts:
    133
    I've used Unity's Timeline, Animator and Animation (legacy) systems. Seemingly inspired by what they perceived of other systems. Yet without any of their benefits. So... I dunno... I'm imagining it will be, like much of Unity's ideas on UX and UI, un-design.
     
  49. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    73
    C'est la vie. The first step is always making it work/look right. Making it fast comes after. And if it comes to needing advanced low level optimizations, then that's where you seek out help from the community and use it as a learning opportunity.

    "Premature optimization is the root of all evil." - Knuth
     
  50. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    290
    4.8.0-preview version is available through package manager. It contains a couple of bugfixes + enabled support for non-mobile PostProcessing in VR. VR team is working on to add support to mobile VR and postprocessing and once done we can enable it in LWRP.

    This will be the last version for 18.3. I know this is not what many of you want to hear but supporting it further will consume a lot of resources that we are putting in 2019 cycle to get LWRP out of preview, stable and performant.