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
    LWRP 4.0.0-preview is out

    Upgrading to this version requires Unity 2018.3.0b3.

    This version changes the light attenuation computation to be physically based. This change means that you don’t have to increase the range of your light to control the attenuation. Instead, you should control the attenuation with the light intensity. Baked GI has changed to match the realtime attenuation. When you upgrade to LWRP 4.0.0-preview, it is likely that you have to upgrade your light settings as well.

    We are pushing work to have LWRP out of preview as soon as possible. Therefore for this version, we focused most of our time in API design to implement much feedback we received over the past months and evolve both our C# and shader API to be more easy to use, extensible and flexible.

    This version introduces API breaking changes. Breaking changes are the reason we bumped the major version number. If you didn’t fork LWRP or authored custom shaders without using ShaderGraph, upgrading your shaders to this version requires some work. We apologize for the nuisance, but this is required so we can evolve. Once out of preview, there won’t be any more breaking changes.

    Please check the changelog to help you upgrade shaders to version 4.0.0-preview and reach out in this thread with upgrading issues so we can help you.

    If you authored custom shaders, please make sure you update the shader variants in your shader to match the new ones.

    // -------------------------------------
    // Lightweight Render Pipeline keywords
    #pragma multi_compile _ _MAIN_LIGHT_SHADOWS
    #pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
    #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
    #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
    #pragma multi_compile _ _SHADOWS_SOFT
    #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE

    These multi_compile keywords are stripped from the build depending on:

    1. Settings in the LWRP asset that is assigned when you build your project, f.ex, if you disable Additional Lights in the asset, LWRP strips all related variants from the build.

    2. LWRP strips invalid variant combinations. f.ex _MAIN_LIGHT_SHADOWS_CASCADE defined but not _MAIN_LIGHT_SHADOWS are invalid and therefore stripped
    3. Unused passes. If you select in the asset you don’t support shadows then all shadow caster passes are stripped from the build. Same with meta pass that is only used for baking lightmaps.

    I’ve updated the LWRP Physically Based shader example to 4.0.0-preview. You can use that as well to help you upgrade your shaders.

    State of the Docs

    Lack of documentation was one of the significant feedbacks we received, and we are putting much effort into writing them. We will layout them in phases soon. Meanwhile, use this post as a reference.

    The LWRP Forward Renderer
    LWRP cull lights per-object, and they are all shaded in a single pass. Compared to Built-in forward renderer, LWRP shades multiple lights with less overdraw and less draw calls.



    LWRP (on the left) renders GI and all realtime lights in the same pass. Light attenuation is physically based. Built-in render pipeline (on the right) renders GI and a directional light in a base pass. Each additional light is rendered with an additional pass additively. Attenuation is not physically based and is affected by both light intensity and range. The image difference is purely because of the light attenuation difference.

    Below are a couple of shots from Angry Bots 2 comparing Built-in render pipeline and LWRP. This shot was taken in package 3.3.0-preview when light attenuation was the same so they are pretty close to each other. This scene has a shadow-casting directional light + 2 point light and 2 shadow-casting spot lights.




    Compared to Built-in, LWRP renders that specific frame with about half as many draw calls.
    If you are unsure of what Batches and SetPass calls mean in that image, check this guide.

    This is how LWRP shades a scene. It chooses the brightest directional light as the Main Light. This light is shaded outside the light loop in the shader and it has a dedicated set of shader variables/shading path in order to shade it as fast as possible. This makes possible to scale rendering up for multiple lights without adding shading overhead to games supporting a single directional light.

    Shading of additional lights happens in a loop. We want to avoid branching on light-type, and we cannot classify them in a forward renderer. We perform a generic shading function that works for directional, point and spot light types.

    There’s a current issue with Graphics Emulation that prevents LWRP to store a large amount of lighting data efficiently. This issue limits the number of lights LWRP can shade. There is currently a limit of 1 main light + 4 additional lights per-object. Also, if you have more than 16 lights visible by the camera, LWRP omits some of them. Once we fix the Graphics Emulation issue, these limits will only impact GLES2.0 and GLES3.0

    We have also updated the LWRP asset to make it more clear and easily configurable. It’s very important to check the settings in the LWRP asset because it controls quality and passes in your rendering. Configure the asset to support only the least features your game requires for better performance.






    What about other rendering approaches?

    It’s on our roadmap to support a mobile-friendly deferred renderer based on this approach. Currently, if you want to use a different shading strategy than standard forward rendering you can override the LWRP render pipeline to do so.


    We provide ScriptableRenderPass class that you can use to create custom-render passes and inject that in LWRP. There are two ways of injecting custom render passes in LWRP. You can inject them at specific points in the default renderer. Take a look at the LWRP default renderer to see some injection points. Boat Attack uses that to render special water effects. Alternatively, you can completely override the LWRP renderer by implementing your own IRendererSetup. A renderer setup is a script that can be attached to a camera and it executes all ScriptableRenderPasses registered in it. You can use this to implement a Forward+ renderer with compute in LWRP for instance.

    VR and Lightweight Render Pipeline

    There are currently some issues with MSAA and PostProcessing in VR. There’s also a current issue with Daydream devices. Although they support multi-view, Google blacklisted multi-view on these devices due to driver issues. There was no other strategy to fall back in SRP because Multi View is deprecated. The effect is that they render black.

    We added single pass double wide as the fallback to SRP in 2019.1, and we might backport it to 2018.3.

    Built-in Shaders
    All unlit shaders from built-in render pipeline work with LWRP. Because the lighting strategy is different, the built-in lit shaders don’t work with LWRP. We provide a new set of lit shader with LWRP. These shaders are distributed along with the LWRP package. When LWRP package is installed you can see them by going in Unity to your project window under the folder Packages/Lightweight RP/Shaders or you can check them in Github. LWRP provides Lit, SimpleLit, and Unlit shaders that cover most of the Unity built-in render pipeline shaders.

    We provide a Material Upgrader utility that upgrades Built-in shader to LWRP. It’s in the Unity toolbar at Edit -> Render Pipeline -> Upgrade project materials to Lightweight RP materials.

    Custom Shaders

    If you are writing custom shaders we recommend using our new Core RP shader library. This is a modern library written in hlsl. LWRP further extends the Core SRP shader library with additional functions specific for it. You get the Core RP and LWRP shader libraries installed on your computer when you install these packages. They can be located in Packages/Core RP Library/ShaderLibrary and Packages/Lightweight RP/ShaderLibrary. Alternatively you can also check their source in Github: CoreRP, LWRP

    The most important things when writing custom shaders are:

    1. Make sure you add the multi_compile pragmas as in this shader example. If you want to remove some of them because of shader compiler variants you can disable settings in the pipeline asset instead and the keywords will be stripped.

    2. Include “Packages/com.unity.render-pipelines.lightweight/Core.hlsl” in all your shaders. This will include shader variables and most utility functions you need. Think of it as legacy UnityCG.cginc.

    3. If you are doing lit shaders include “Packages.com.unity.render-pipelines.lightweight/Lighting.hlsl”. This will include, GI, Lighting, IBL and shadow functions.

    4. Material shader properties are not defined in Core shader library or LWRP shader library. This means _Color, _MainTex, _MainTex_ST, and all variables in the Properties section of a shader must be defined by the shader itself. If you define all those properties in a CBUFFER names UnityPerMaterial, SRP can cache the material properties between frames and reduce significantly the cost of each draw call. Each of LWRP shaders define theirs constants in a *Input.hlsl. You can check LitInput.hlsl for an example.

    5. Invest some time learning the new shader library. Docs are not done yet but all the source code is there. You can check LWRP shaders for reference.
    All built-in shader variables described in this page *except* Lighting variables work with LWRP.

    Don’t reference LWRP lighting shader variables in your shader. Instead we provide two functions to initialize a Light struct that has all lighting information you need for shading a light. These are GetMainLight, and GetAdditionalLight and they are defined in Lighting.hlsl

    Light struct is defined as follow:

    struct Light
    {
    half3 direction;
    half3 color;
    half distanceAttenuation;
    half shadowAttenuation;
    };

    If you have any feedback on the shader API we would be glad to know. This is the chance to help shape the API to better suit your usage. We want to provide an easy to use and flexible API.

    Performance
    We are benchmarking LWRP and Built-in on several mobile devices and a few test projects. The process very slow given the amount of architecture fragmentation for platforms we support. Optimizing for a GLES2 capable device is completely different work than doing for a Vulkan one, and yet more different than PC and consoles.

    We just found out that there was a performance regression on some android devices between 2.X and 3.X. We are yet about to re-run our tests in 4.X version.

    We want to make sure to fix this performance regression before sharing a detailed data with benchmarking. Overall, compared to built-in you should expect at this point:

    1. PC, Consoles, Mobile (Vulkan and Metal), and VR
      1. Slightly better performance with a single directional light.

      2. Considerable better performance with multiple lights. We are investigating some issues with performance on some devices next week.
    2. Mobile (GLES3+)
      1. About same performance with a single directional light.

      2. Some devices have better and some worse performance. We are investigating this issue as well and figuring out perf regressions.
    3. Mobile (GLES2)
      1. About same performance with a single directional light

      2. Worse performance issues depending on the scene with multiple lights. GLES2 enforce support in their specs for dynamic indexing in pixel shaders. Most mobile GPU manufacturers support it though. We are working with them to figure out which GPUs we can patch our shaders to support dynamic indexing. This is more likely to only land in 19.1. So, if you are in GLES2 and LWRP it’s ideal to fallback to either single directional light or shading additional lights per-vertex.
    The matrix of different architectures and different games rendering styles makes it really hard to cover all performance cases. It’s extremely important to have your help in this. If you are using LWRP and have worse performance compared to built-in render pipeline, please open a bug report with your test scene, LWRP version and the device you tested. We will figure out what is happening and improve it.

    When comparing performance between LWRP and Built-in renderer please make sure:
    1. Built-in is set to forward renderer as it is the only renderer we support for now

    2. Make sure the Quality Settings in Built-in match LWRP. Quality Settings in LWRP are configured in the LWRP asset.

    3. If you using a Android 7.0 or above capable device make sure to check Sustained Performance mode in Player Settings.

    4. If you are on a mobile device that does not support Sustained Performance mode make sure you give some minutes for the device to cool down between profiling sessions. This happens because mobile GPUs have passive cooling system. When they overheat the CPU and GPU clocks down to cool down and this impacts severely performance.
    Current Limitations
    • Currently only one directional light is supported. We’ll add support to shade additional directional lights in the light loop. This is coming soon.

    • Light culling layer for the main directional light is not yet implemented. Main light is not culled per-object and there’s currently no efficient way to implement this in a single pass renderer for all platforms. We are working on changes to engine to allow support for efficiently doing this. This is most likely coming only in 19.1.

    • Due to issues with Graphics Emulation we are limiting shading to 1 main light + 4 additional lights per-object. Also, there’s a limit to at most 16 visible lights globally. This limit will be removed once we fix the Graphics Emulation issue. This way we can store light data in StructuredBuffers for platforms that support it. We are investigating a workaround for the issue for 18.3. Otherwise it will only be fixed in 19.1

    • There’s currently no built-in support for postfx AO. A user has added support to MSVO in LWRP

    • Motion Vectors and Camera Normals are not supported yet. This makes some post effects not supported in LWRP.

    • Speed Tree shaders are not yet ported to LWRP.

    • Particles shaders are not yet fully ported to LWRP.

    • LPPV, Mixed Lighting Mode, Occlusion Probes are not supported. This is most likely only coming in 19.2

    • Point light shadows are not supported. This is most likely only coming in 19.2

    • Camera Relative rendering is not supported. This is most likely only coming in 19.3

    • Box Projection and Reflection Probe blending is not supported. This is most likely coming in 19.3.

    • Detail maps and parallax is not supported in the built-in LWRP shaders yet.

    • Realtime GI is not supported.
    That's it. Please let us know of any issues you have.
     
    Last edited: Nov 16, 2018
  2. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    239
    Thanks for explanation, it is very useful. The same post for the state of hdrp 4.0.0 will be great.
     
  3. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
  4. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    322
    Hi, thanks for the hard work on this- really exciting update. Currently lack of motion blur support is the only factor limiting me from moving to the LWRP, does the ‘yet’ imply the feature is on the roadmap?
     
    Shorely and phil_lira like this.
  5. P_Jong

    P_Jong

    Joined:
    Jun 14, 2017
    Posts:
    52
    I'm so excited about this update. My current VR game under development is making use of the LWRP. I'm really loving the quality and high performance with the LWRP. I'm hitting 90 FPS with 73+% headroom on the Rift and the Go compile is getting a solid 60 FPS. I just wished Oculus would jump on board and update their Avatars to be compatible with the LWRP. I've had to use Shader Graph to make new shaders for the avatar. For now I'm ok with it and not letting this hold me up. I really enjoyed the talk by Tony Parisi and Brad Weiers at Oculus Connect 5! So glad I made it to their talk.
     
    phil_lira likes this.
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    6,130
    Please write some sort of reference or tutorial on how to modify/customize the LWRP. I did some tests in really early LWRP releases and I was able to figure stuff out, more or less. But in more recent versions I am more or less lost, since it seems the complexity of the set-up has gone up quite a bit (or I'm simply missing some piece of understanding that will make everything click).

    My intent is to take the final LWRP and make my custom one, removing all features we don't use (which is most of them :p ). But at this point, it seems so complicated, I might be better off writing one from scratch.
     
    Shorely and P_Jong like this.
  7. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,336
  8. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,336
    -When will it be available via the package manager?

    -Once camera relative rendering works in the LW SRP, do I need to change my unlit shader code?

    -Also, can you make a MixFog() version which supports half4 colors, so I don't have to do a conversion?

    Currently:
    Code (CSharp):
    1. half4 col = //compute the color using a texture with alpha channel (unlit transparent object).
    2.  
    3. //Conversion
    4. half3 color = col.xyz
    5.  
    6. MixFog(color, fogFactor);
    7.  
    8. return half4(color, col.w);
     
    Last edited: Sep 29, 2018
    P_Jong likes this.
  9. Ascii

    Ascii

    Joined:
    Sep 13, 2014
    Posts:
    3
    So MSAA is still a no-go for VR in LWRP?
     
  10. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    It's on our roadmap but we don't have an idea yet when it's coming.
     
    Karearea likes this.
  11. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    I have one that's for an older version. I'll polish it up and update for 4.0.0-preview.

    What features you want to removed? You can disable a lot of features in the LWRP asset and the pipeline will be smart enough to strip down the cost of them. Let me know if there's something you want to strip that's not covered there.
     
    Jes28 and P_Jong like this.
  12. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    It's updated now.

    It's already available. Are you having issues seeing it?

    It will be transparent as long as you don't reference matrix variables directly. Instead these functions and MACROS for matrices and space transforms. https://github.com/Unity-Technologi...lines.core/ShaderLibrary/SpaceTransforms.hlsl

     
  13. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    There was an issue fixed related to MSAA in 4.0.0-preview. I'm not sure if all issues were related to this. I'll check. Meanwhile I encourage to try and let me know if you have issues with it.
     
  14. Fallc

    Fallc

    Joined:
    Mar 13, 2015
    Posts:
    48
    Any ETA for the PostProccessing + VR?
     
    Tesrym likes this.
  15. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    322
    Thanks for the response @phil_lira - does the mixed lighting mode that might make it in 19.2 include distance shadowmasks?
     
  16. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    6,130
    We use all custom CG vert/frag shaders, baked lightmaps, light probes and our own post processing. No actual realtime lighting at all, no reflection probes (we do our own cubemaps). Performance is actually okay with our setup, but I can't help feeling like the CPU side could be much cleaner, which is why I have an interest in using SRP.

    But I kinda feel like what I'm trying to do is so removed from LWRP, I might as well write my own. But I currently lack the know-how to do one from scratch.

    With all that said, I haven't had too much time spent with new SRP stuff, so I'll probably have more specific questions/suggestions when I find the time to play with them more.
     
  17. P_Jong

    P_Jong

    Joined:
    Jun 14, 2017
    Posts:
    52
    I see it tonight (Saturday Sept 29th at 7:09 PM Eastern). It was not up on Friday at 11 pm Eastern. I kept trying. Interestingly I observed the top most LWRP version go from 3.3.0 to 3.0.0 So maybe some changes were still taking place in the background. But I got 4.0.0 tonight. I'm off to go work with it and Unity 2018.3.0b3.
     
  18. battou

    battou

    Joined:
    Jan 25, 2011
    Posts:
    142
    Still cant see it in Package Manager, it only lists 3.0.0 as latest. Im using 2018.2.10f1
     
  19. P_Jong

    P_Jong

    Joined:
    Jun 14, 2017
    Posts:
    52
    LWRP 4.0.0 requires Unity 2018.3.0b3. Make a backup of your project. Download and update it to 2018.3.0b3. Or just create a new project in 2018.3.0b3 and try it out.

    Package Manager looks a bit different now in 2018.3.0b3. It used to have two tabs: In Project, and All.
    Now its one tab, Packages with some drop down options. So make sure you select "All packages" (default)
    in the drop down.

    Edit 10/3/18: Well it looks like my work around broke with Oculus Integration 1.29. The only Shader Graph shader that is getting displayed is the base. The hands, body and head are back to being pink. At this point I'm just going to wait till Oculus comes out with a LWRP compatible local and remote avatars.
     
    Last edited: Oct 4, 2018
  20. battou

    battou

    Joined:
    Jan 25, 2011
    Posts:
    142
    Thanks!
     
  21. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,336
    Yes, it is not available. I can only see LWRP 3.3.0 in the package manager. I am using 2018.3 b3 and the latest package manager UI.

    Edit:
    Never mind. I had to tick "show preview packages" in the package manager menu.
    I also fixed the fog, thanks.
     
    Last edited: Sep 30, 2018
    P_Jong likes this.
  22. ALL-CAPS

    ALL-CAPS

    Joined:
    Jun 23, 2014
    Posts:
    8
    I am having the same issue with LWRP 4.0.0 as I did LWRP 3.3.0. If I alter a camera's Viewport Rect, it results in a black screen on many android devices. The device is still responsive and the game doesn't crash, just renders black.
    I am using the viewport rect manipulation to ensure a 16:9 aspect ratio on all devices.
     
    khusainova_olga likes this.
  23. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    Can you raise a bug with your project?
     
  24. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    PostProcessing with double wide / PC works. SPI is still being worked on.
     
    P_Jong likes this.
  25. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    402
    Originally not. But we can add that to the backlog. It's hard to promise anything two releases away but we'll work towards that.
     
    Jes28, P_Jong and Karearea like this.
  26. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    322
    Thank you very much!
     
  27. ALL-CAPS

    ALL-CAPS

    Joined:
    Jun 23, 2014
    Posts:
    8
    Hey Tim I have now submitted an example project with the bug, here is the link https://fogbugz.unity3d.com/default.asp?1086900_k561amm57q5m9e32 (Case 1086900)

    let me know if you have any questions, or if you have a suggestion which might alleviate this issue.

    PS: I just noticed a minor mistake in the example bug project where the red camera was on depth 1, but should be depth 0, for the bug to be visible.
     
    Last edited: Oct 2, 2018
  28. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    154
    I was very happy to see that latest version, as well as ability to cloud build for the beta 2018.3. But then I started to see this kind of errors on cloud build...
    Any ETA on making the whole thing compatible? Is this aknowledged issue ?

    [Unity] Shader error in 'Lightweight Render Pipeline/Simple Lit': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at Library/PackageCache/com.unity.render-pipelines.lightweight@4.0.0-preview/Shaders/SimpleLitInput.hlsl(4) (on glcore)
    518: [Unity] Shader error in 'Lightweight Render Pipeline/Simple Lit': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at Library/PackageCache/com.unity.render-pipelines.lightweight@4.0.0-preview/Shaders/SimpleLitInput.hlsl(4) (on glcore)
    519: [Unity] Shader error in 'Lightweight Render Pipeline/Simple Lit': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at Library/PackageCache/com.unity.render-pipelines.lightweight@4.0.0-preview/Shaders/SimpleLitInput.hlsl(4) (on glcore)
    520: [Unity] Shader error in 'Hidden/Lightweight Render Pipeline/CopyDepth': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at Library/PackageCache/com.unity.render-pipelines.lightweight@4.0.0-preview/Shaders/Utils/CopyDepthPass.hlsl(4) (on glcore)
    521: [Unity] Shader error in 'Lightweight Render Pipeline/Lit': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at Library/PackageCache/com.unity.render-pipelines.lightweight@4.0.0-preview/Shaders/LitInput.hlsl(4) (on glcore)
    522: [Unity] Shader error in 'Lightweight Render Pipeline/Lit': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at Library/PackageCache/com.unity.render-pipelines.lightweight@4.0.0-preview/Shaders/LitInput.hlsl(4) (on glcore)
    523: [Unity] Shader error in 'Lightweight Render Pipeline/Lit': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at Library/PackageCache/com.unity.render-pipelines.lightweight@4.0.0-preview/Shaders/LitInput.hlsl(4) (on glcore)
    524: [Unity] Shader error in 'Hidden/Lightweight Render Pipeline/CopyDepth': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at Library/PackageCache/com.unity.render-pipelines.lightweight@4.0.0-preview/Shaders/Utils/CopyDepthPass.hlsl(4) (on glcore)
    525: [Unity] Shader error in 'Hidden/Lightweight Render Pipeline/CopyDepth': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at Library/PackageCache/com.unity.render-pipelines.lightweight@4.0.0-preview/Shaders/Utils/CopyDepthPass.hlsl(4) (on glcore)
    526: [Unity] Shader error in 'Hidden/Lightweight Render Pipeline/CopyDepth': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at Library/PackageCache/com.unity.render-pipelines.lightweight@4.0.0-preview/Shaders/Utils/CopyDepthPass.hlsl(4) (on glcore)
    527: [Unity] Shader error in 'Hidden/Lightweight Render Pipeline/CopyDepth': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at Library/PackageCache/com.unity.render-pipelines.lightweight@4.0.0-preview/Shaders/Utils/CopyDepthPass.hlsl(4) (on glcore)
    528: [Unity] Shader error in 'Lightweight Render Pipeline/Lit': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at Library/PackageCache/com.unity.render-pipelines.lightweight@4.0.0-preview/Shaders/LitInput.hlsl(4) (on glcore)

    etc...
     
  29. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    What version of unity does cloudbuild use? it needs to be at least beta 3.
     
  30. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
  31. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    154
    I'm targetting 'latest 2018.3 beta'
     
  32. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    what do the logs say about the version. we dont have much to do with cloud build
     
  33. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    154
    Hmm [Unity] Initialize engine version: 2018.3.0b3 (cc0086a8e10c) ?
    Here's the complete log. http://www.mediafire.com/file/tttrxbaszkncosq/log.txt
    There's few other issues that might be the cause of the actual failure of the builds of course, but the whole package manager and LWRP are still very much sending tons of errors ^^'

    btw, I do target various platforms (linux, windows, mac), and my cloud was working before I started integrating the whole LWRP/Package manager.

    Also, since 4.0.0 (and now 4.0.1). I'm getting those strange errors that are triggers by the editor :/


    EDIT: Actually, that's exactly the kind of errors that are in the cloud build logs since I use LWRP.

    Other type of error that randomly triggers in the editor with LWRP. And always in Cloudbuild, since the beginning:
    [Unity] Shader properties can't be added to this global property sheet. Trying to add _GrabTex (type X count X)
    And there's no way to find the origin, the error disappears after some time or when selecting all game objects.
     
    Last edited: Oct 3, 2018
    ROBYER1 likes this.
  34. Tesrym

    Tesrym

    Joined:
    Dec 2, 2012
    Posts:
    55
    hippocoder, VOTRUBEC and Immu like this.
  35. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    19
    With 4.0.1 my dynamic objects don't receive a directional light anymore after baking lightmaps.
    Doesn't matter which settings I use where, the result is always the same. It's not possible to use lightmaps + directional light in LWRP:


    Might be related:
     
  36. ChaoticBox

    ChaoticBox

    Joined:
    Mar 6, 2015
    Posts:
    6
    Change the msvo.GenerateAOMap call to:
    Code (CSharp):
    1. msvo.GenerateAOMap(cmd, cam, AmbientOnlyAO, null, false, false);
     
    hippocoder likes this.
  37. Livealot

    Livealot

    Joined:
    Sep 2, 2013
    Posts:
    105
    Any ETA for Oculus support for LWRP for VR?
     
    P_Jong likes this.
  38. EricLowry

    EricLowry

    Joined:
    Apr 12, 2015
    Posts:
    7
    Looks like we're going to have to wait a bit more for _Stencil support for UI usiage of shaderGraph?
     
  39. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    Looking at the full log I see this:

    Code (csharp):
    1.  
    2. [Unity] Assets/Scripts_IFSCL/autres/XMLHandler.cs(25,13): error CS0246: The type or namespace name 'GameOptionsManager' could not be found (are you missing a using directive or an assembly reference?)
    3. [Unity] Assets/Scripts_IFSCL/autres/XMLHandler.cs(25,37): error CS0103: The name 'GameOptionsManager' does not exist in the current context
    4. [Unity] Assets/Scripts_IFSCL/autres/XMLHandler.cs(78,23): error CS0103: The name 'GameOptionsManager' does not exist in the current context
    I think this is probably the root issue. The shader path resolution won't work if there are compile errors (currently, this is being changed)
     
    ROBYER1 and Immu like this.
  40. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    72
    I am trying to push a video into the Albedo or MainTexure of a shader in LWRP. I can do this fine if using the built in Lightweight shaders in Unity, but whenever I try to make a custom Shader , it won't work. Even with something very simple like making a PBR Graph shader and directing the video to the Albedo, nothing. Also I was trying to make Texture2D node feed into a Texture2DSampler node feeding into an Albedo. Again , nothing. But with the builtin shaders it works fine. Tried to duplicate one the built in shaders in order to customize it, but it doesn't seem possible to duplicate it.
     
    Last edited: Oct 5, 2018
    P_Jong likes this.
  41. P_Jong

    P_Jong

    Joined:
    Jun 14, 2017
    Posts:
    52
    Rather than duplicating one of the built in shaders , try modifying this LWRP Physically Based example on GitHub

    https://gist.github.com/phi-lira/987857a10f0a141a82843827a6bd6865

    That's what I've used as my starting point.
    But only a little bit so far. I'm ver new to editing shaders, and prefer using Shader Graph.
     
  42. P_Jong

    P_Jong

    Joined:
    Jun 14, 2017
    Posts:
    52
    I'm looking at the LWRP water shader that is in the Boat Attack demo. I love it! I've tried to make something like this in shader graph but it does not look good. Will it be possible to some day make a good LWRP water shader in shader graph? Or is water just one of those complex things that will always require a bit more custom shader work?
     
  43. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    72

    - yes , the only problem for me is that I want to edit it in the ShaderGraph, which I don't seem to be able to do with this shader.
     
  44. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    72
    _and I also seem to unable to get this shader to compile for some reason
     
  45. Tesrym

    Tesrym

    Joined:
    Dec 2, 2012
    Posts:
    55
    No post processing for OpenVR (beta 3 and 4. Pipeline 4.0.1)
    To replicate:
    -Use Unity Hub, create new project from VR Lightweight RP template.
    -Install OpenVR from the package manager.
    -Run template example scene.
     
  46. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    154
    Thanks @Tim-C
    Meanwhile, still on that question, any idea ?

    Other type of error that randomly triggers in the editor with LWRP. (In Cloudbuild too), since the beginning:
    [Unity] Shader properties can't be added to this global property sheet. Trying to add _GrabTex (type X count X)
    And there's no way to find the origin, the error disappears after some time or when 'selecting' all the game objects. It clearly one of my shaders, I get that, but I don't know which one it is, what 'this' global property sheet is refering too :/

    So far I'm trying to delete all objects one by one, to try find which shader is causing that. But that's never ending search, completely in the blur °-°

    EDIT: I saw maybe this can be related, https://issuetracker.unity3d.com/is...when-using-a-projector-with-a-specific-shader, but could we have an explanation about why this won't be fixed? or at least improved to give a more detailled error message?

    Other subject, on build, there's those warnings in the log:
    WARNING: Shader Unsupported: 'Lightweight Render Pipeline/Lit' - Pass 'Meta' has no vertex shader
    WARNING: Shader Unsupported: 'Lightweight Render Pipeline/Simple Lit' - Pass 'Meta' has no vertex shader
    WARNING: Shader Unsupported: 'Lightweight Render Pipeline/Unlit' - Pass 'Meta' has no vertex shader
    Something I didn't updated correctly or warning only due to preview?
     
    Last edited: Oct 11, 2018
  47. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    269
    Is there a particular reason that Enlighten is not supported on LWRP? Or is it coming eventually?
     
  48. renardmf

    renardmf

    Joined:
    Jun 29, 2012
    Posts:
    46
    Yes, I was experiencing this too with both 3.3.0 and 4.0.1 in 2018.3b5. Has anyone found a work around for this?
     
  49. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    561
    Hi all,

    I am thinking of using SimpleLit to further capitalize on LWRP performance on Intel GPU devices. Is there any existing performance benchmark?

    Another question is whether keeping PBR shader in preload shader list (and not using them) will incur any noticeable performance penalty?

    (I have been looking at various way to maintain 60fps and limit laptop heat, and so far I haven't been able to get both with PBR shader scene: I can get stable 60fps but GPU temp will reach 90-100 celsius within minutes, fan noise ensures and may trigger heat throttling; I can low my goal to stable 30 fps then GPU temp will hover nicely around 60-70 celsius... In both case I am talking about a MBP 2015 + Intel GPU + game running at 720p: I see no chance of getting retina resolution to run at stable 30fps on Intel GPU, not for long at least)

    (And I am testing on LWRP + Metal + IL2CPP already.)
     
  50. NicTda

    NicTda

    Joined:
    Jan 11, 2018
    Posts:
    10
Thread Status:
Not open for further replies.