Search Unity

Feedback Wanted: Lightweight Render Pipeline

Discussion in 'Graphics Experimental Previews' started by Tim-C, Feb 19, 2018.

Thread Status:
Not open for further replies.
  1. purnaprakash

    purnaprakash

    Joined:
    Feb 6, 2017
    Posts:
    2
    It works properly when I used Standard Shader but there is depth problem on semi-transparent textures due to disabled ZWrite value . So I modified the Standard (Physically Based) lwrp Shader and change the ZWrite value to on (already set Surface Type to Transparent and Blending Mode to alpha). This thing resolve depth issue but I am facing base problem mentioned above (Fade In-Out Effects issue).

    I am not a native speaker so if you have any confusion please let me know
     
  2. Andre_Mcgrail

    Andre_Mcgrail

    Unity Technologies

    Joined:
    Dec 9, 2016
    Posts:
    147
    This should currently work fine, I managed to run the boat demo on WebGL 2, with post etc, try with the latest package and try start with some of the simpler post FX(FYI I had LDR colour grading, bloom, chrome abs and vignette).

    AO is a tricky one, it's definitely on our 'nice to have' list right now, but as we are trying to focus on stabilisation and documentation this most likely will be pushed to 2019.x due to LWRP only having Colour and Depth, this leaves little room to make something both performant and passable visually.
     
  3. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    re: 2018.2: We are still backporting what we can and what makes sense, but the code between 2018.2 and master is starting to diverge quite a lot so some things we are not backporting as it will be 2x the implementations.
     
  4. Cogsy

    Cogsy

    Joined:
    May 16, 2018
    Posts:
    3
    I seem to be experiencing a huge frame drop when using the Lightweight Render Pipeline on some Android devices but not others, I can't tell if it's just better hardware or the variableness of so many different android devices. Seemingly older hardware can run fine, and a newer android device has its frames reduced to 2FPS from 30. I know it's the pipeline because of our source control, on the version I have where I implemented it, the frame drop occurs, but not on the commit before it.

    Could I be possibly doing something wrong or missing something? Lightweight is supposed to be FASTER not slower on mobile, what gives? All I've done is create a new LWRP asset, and assign in in the Graphics settings pipeline. I've also done the Edit > Render Pipeline > Upgrade project materials to lightweight materials, and all my shaders are set to the Lightweight versions, but I've done nothing past this.
     
  5. Clyde_Coulter

    Clyde_Coulter

    Joined:
    Jul 14, 2014
    Posts:
    57
    I'm having trouble with a couple of models on Android Galaxy 8, os=8.0.
    The display shows shadows, but not the model. Everything looks good on Windows 10.
    Unity 2018.1.6f1 LWRP
    I'll update this once I finish downloading 2018.1.9f1 (downloading it now) and try it out there.
    Some models display well, others not. Simple models.
    Also, no audio on Android.

    Update:
    I installed and used 2018.1.9f1 and still having problems with some models.

    (I'm embarrassed to say that the audio worked after turning up the volume on my wife's Galaxy, I don't have my own smart phone).
    The dark red oval shows where a house should be, the shadow is there and I can crash the rocket into it, so the box collider is there.


    Missing model draw, but shadows appear (ignore the rocket debris from previous attempts)
     
    Last edited: Aug 2, 2018
  6. Clyde_Coulter

    Clyde_Coulter

    Joined:
    Jul 14, 2014
    Posts:
    57
    Hmmm, the reflection probe seems to have its x and z swapped somewhat in the Android version (2018.1.9f1 LWRP Shader Graph Reflection Probe)
    On Windows 10, my water reflections are correct and flow downward (-z direction) but on the Android they stretch to the right of the reflected object.
    (I should say that when the project type is switched to Android, Play mode shows the reflections go to the right) I have checked that the reflection probe is still following the camera correctly.
    (Looks like Dropbox is not a good way to share photos)


    The Windows Platform


    Android Platform


    And, here's my WaterShader graph
     
    Last edited: Aug 2, 2018
  7. Clyde_Coulter

    Clyde_Coulter

    Joined:
    Jul 14, 2014
    Posts:
    57
    Here, I uploaded the photos to photobucket.
    I should note that the material using this shader graph is assigned to a plane with a scale of x=4, y=1, z=2


    Windows Platform


    Android Platform


    And the WaterShader shader graph
     
    Last edited: Aug 2, 2018
    konsic likes this.
  8. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    383
    It does count. I'll add the tutorial scene to my performance tests. However it will take some time to do that since we are now working mostly on QA and API stabilization now.
     
  9. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    383
    I'll start backporting some of the fixes we have in master soon. From what I read in you previous messages I believe the fix you want is related to the Graphics Emulation breaking rendering (_LightIndexBuffer warning). This will also be backported to 2018.2.

    We are making a strong push to get LWRP in a good state and out of experimental as soon as possible. That means we deliberately decided to drop on adding more features for now in favor of working on API stabilization and QA. There will be more features coming to it later. It will eventually supports all major rendering features Builtin pipeline supports.

    Due to some API refactors, the code bases are changing quite fast which means backporting issues might be the same amount of work as reimplementing them in the old code base. We will decide on which issues to backport based on severity. As things are moving quite fast we also encourage people to stay on the latest Unity releases if you can.

    I just wanted to make sure you all know the feedback and bug reports you are giving are extremely useful to us. We are listing and adapting to it.
     
    elbows likes this.
  10. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    383
    Regarding "receive shadows" property some people have been asking. I've just made it work, however instead of configuring in the renderer inspector this will be configured per material. You'll find the option to enabled/disable receive shadows in the material inspector for the lightweight standard physically based shader and simple lighting one.

    What if effectively do is control is by a shader_feature. If you don't use it you won't pay the cost of extra shader variants.
     
  11. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    383
    Our platforms team is looking into Hololens and LWRP atm.
     
    JoshVIZfire and GameDevCouple_I like this.
  12. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    383
    The LWRP asset controls some quality settings as well. Take a look at it and uncheck things you don't need. What maybe is happening is that you have with the LWRP asset higher quality settings/rendering thatn with the builtin pipeline. f.ex. if you only need shadows on directional lights you can safely untick local shadows options and so on.

    We also use some of these settings to disable shader variants. Disabling what you don't use will make building faster and consume less device memory.

    Feel also free to open a ticket for the performance hickups. We will be interested in looking into them.
     
  13. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    383
    @Clyde_Coulter Could you open bug cases for the two issues you mentioned. It will be easier to figure out what's happening once we have the repro projects.
     
    Clyde_Coulter likes this.
  14. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    544
    Thank you Phil, Tim and Andre for replying, I really appreciate it.

    I am looking forward to the next LWRP 2.x-preview release, for now I am bouncing between built-in forward rendering and LWRP, and try to delay my work on custom material/shader for as much as possible (They appear to be the main blockers when switching rendering pipelines.)

    ====

    Personally, I have been using a test scene to compare performance between Built-in Forward and LWRP Forward, and see around a nice 10~20 fps bump on Intel GPU, but it's not without some caveats:

    - I am not able to get the same shadow resolution as built-in forward rendering using the same shadow distance: LWRP provide more precise control on directional shadow atlas, but with a maximum of 4096 + my shadow distance (150), I am seeing a lower resolution shadow when compared to the "high resolution" shadow setting from built-in pipeline. I need to shadow distance to around 50 in LWRP, in order to maintain the same shadow quality (see screenshot below).

    - The shadow position is offset more in LWRP for unknown reason: I know receive shadow is still broken at the moment. But the extra position offset feel weird to me (see screenshot below). LWRP also gave a darker color for shadow that's illuminated by other point light, no sure this is to be expected.

    - LWRP 2.0.8-preview seem to come with it's own Post Processing Stack: That or there is a bug in package manager, as I am seeing a strange error message (see screenshot below), and I have to remove existing Post Processing Stack to fix this error. And strangely, my Post Processing Layer still work after the removal.

    - I am not 100% confident about the bump in FPS, but at least we know there isn't any slowdown, so it feel promising: the main reason I am skeptical is due to shadow resolution setting and broken receive shadow - so LWRP got some unfair advantage here. Secondly, macOS will throttle performance due to heat within 30 seconds, so measuring average fps without vsync is not easy.

    ====

    Screenshots:

    fps with built-in forward pipeline (using Intel GPA)

    built-in.png

    fps with LWRP forward (using Intel GPA)

    lwrp.png

    Shadow offset with built-in pipeline:

    Screen Shot 2018-08-02 at 23.21.48.png

    Shadow offset with LWRP

    Screen Shot 2018-08-02 at 23.21.58.png

    Shadow resolution in LWRP when using the same shadow distance as built-in pipeline (shadow resolution is set to "high" in built-in; directional shadow atlas is set to 4096; there are only 1 shadow-casting directional light):

    Screen Shot 2018-08-02 at 23.52.47.png
     
    Last edited: Aug 2, 2018
    elbows likes this.
  15. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    544
    I run out of attachment limit, so here is the error I got when using both LWRP 2.0.8 and Post Processing Stack 2.0.10, on Unity 2018.2 (removing Post Processing Stack package via package manager, and the error is gone, and post processing still works):

    Screen Shot 2018-08-02 at 22.04.56.png
    Screen Shot 2018-08-02 at 22.04.48.png
     
  16. OtoriScorp

    OtoriScorp

    Joined:
    Mar 9, 2016
    Posts:
    29
    Hi Team,
    Is there an ETA on GPU instanced shader for particles using LWRP?

    Thanks!
     
  17. Clyde_Coulter

    Clyde_Coulter

    Joined:
    Jul 14, 2014
    Posts:
    57
    OKAY!
    I figured out the problem with missing models on Android with 2018.1 LWRP
    I noticed that some of my "powerups" showed up and some did not. The base models for the powerups used LWRP Standard (physically based) shader, but some had "Enable GPU Instancing" turned on and some turned off. The ones that had it turned off displayed correctly.
    So, I turned GPU instancing OFF on the house and it displays correctly on the Android (Galaxy 8, os 8.0)
     
  18. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    Yeah... The same as material.... Unless I misunderstood that...
     
  19. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,361
    Pipelines dont have their own copy of post-processing 'built in' as such, but rather packages have the concept of 'dependencies' which automatically tells Unity what other packages need to be used with them, and means you do not need to add these other packages yourself. This is the same with things like Shader Graph, and the shared Pipeline Core that both LW and HD pipelines use.

    If you want to see what dependencies a particular package has, you can look in the appropriate Packages folder in the project browser, at the file called 'package', in the dependencies section of that file. eg Packages\Lightweight Render Pipeline\package. So for example with LWRP 2.0.8, these are its dependencies, so your proejct is already using Post Processing package version 2.0.8:

    "dependencies": {
    "com.unity.postprocessing": "2.0.8-preview",
    "com.unity.render-pipelines.core": "2.0.8-preview",
    "com.unity.shadergraph": "2.0.8-preview"
    },

    edited to add - And I believe (but am not 100% sure) that normally it doesnt matter if you also happen to have installed one of its dependencies manually yourself using Package Manager UI etc. But what does matter is that exactly the right version is used, so for example in your case you probably got errors because you were trying to use 2.0.10 version of PostProcessing but LWRP 2.0.8 needed to use PostProcessing 2.0.8. Other circumstances where this stuff can go wrong is if something like an older version of PostProcessing was already in your project via non-package means, eg was installed manually in Assets folder in the past.
     
    Last edited: Aug 3, 2018
  20. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    544
    Thx, but again, I would argue there are things to be improved here:

    - If LWRP has any peer dependency* on Post Processing Stack, then Package Manger should really resolve it correctly (it's out of the scope of LWRP team, of course.)

    - If LWRP does import** it's own version of Post Processing Stack package, I would like to see it listed in the project list. For now it isn't. (Again, out of the scope of LWRP team, but I expect a flatten dependency like Unity Assets, not a nested hierarchy of packages).

    There are of course multiple ways of handling package dependency and I hope Unity model theirs after npm.

    *peer dependency as in: LWRP is not dependent on Post Processing but only work with a certain version of Post Processing API, same as the term in npm's package.json definition.

    **import as in: If a package is being used, I should see it as a folder under Packages (in this case the Post Processing Stack is still available but not shown in package list or the project manifest, I have no idea why and I know this is not the right venue for such a discussion.)

    Screen Shot 2018-08-03 at 19.26.17.png

    Screen Shot 2018-08-03 at 19.30.12.png

    I have opened a thread for package manager discussion here:

    https://forum.unity.com/threads/peer-dependency.543636/
     
    Last edited: Aug 3, 2018
  21. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,973
    Thank you so much, I would love to get an update on this whenever you/they hear anything, as we have some live projects that could benefit from the new pipeline greatly.

    We already have some shaders etc written in new pipeline, its just that it cant build. Very excited to finally transition to it when we can!
     
  22. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    485
    seems like PostProcessing changed its assembly name between 2.0.8 and 2.0.10.
    that is a breaking change. MAJOR version should have been incremented if you are following semver
     
  23. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    146
    Well, Yoshihiro did a cool AO that is not based on HDRP compute shaders, working with LWRP post processing:
    https://github.com/beinteractive/LWRPAmbientOcclusion
     
    MythrilMan51 and Clyde_Coulter like this.
  24. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
  25. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    Yep. This was a mistake. We are being much stricter on this moving forward.
     
  26. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,720
    I'm get a bunch of garbage every frame with the LWRP

    upload_2018-8-7_19-56-15.png

    This is profiling a build, not editor

    3.0.0 preview
     
    Ratatoeskr and kurtalanwilson like this.
  27. kurtalanwilson

    kurtalanwilson

    Joined:
    Mar 28, 2018
    Posts:
    2
    I'm getting GC allocs every frame under "RenderPipelineManager.DoRenderLoop_Internal() in the editor. I'm wondering if it's normal or not.
     
    Ratatoeskr likes this.
  28. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    any news on light weight lensflares?
     
  29. Pr0x1d

    Pr0x1d

    Joined:
    Mar 29, 2014
    Posts:
    27
    Still waiting on the shadows fix, does anyone know something about it or know how to fix it. For people who maybe dont know the shadows only render from world position 0,0,0 so I can move with camera further away and shadows will stop rendering.
     
  30. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    upload_2018-8-9_13-52-10.png
    JUST what I was blabbering about... Done by hacking lighting.glsl in the shader library of the LWRP package.
     
  31. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    Now for baked light maps....
     
  32. Pr0x1d

    Pr0x1d

    Joined:
    Mar 29, 2014
    Posts:
    27
    [LWRP Mixed lighting on direction light doesnt work properly]

    Today I was recreating how the game lighting should be done, I am currently working on MMORPG project, and I want to run it on any pc and maybe somewhere in the future even on other devices. Thats why I am using LWRP, then I though having baked lighting would be a lot faster so I changed the Direction Light to baked but no shadows were casted on the dynamic objects and ofcourse player. Then changed to Mixed lighting becaus I knew from using it in my old projects that it works just fine, after changing to mixed things got weird, first of all is that dynamic objects dont receive shadows from static objects, second of all the shadows from dynamic object are casted over the baked shadows. Tried experimenting with Lighting Setting but nothing changed.

    The question here is if its only my bug or its something known for sometime that I didnt saw in posts etc. and if its fixable or when It will be fixed, plus adding image in old RP and LWRP. Thanks

    OLD RP.png
    (Old Rendering Pipeline)

    LWRP.png
    (LWRP)
     
  33. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    I bet light probes could help with that.
     
    artfish likes this.
  34. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    Now WHAT shader's used for baked lighting?
     
  35. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122

    Couldn't do THIS either

    In Unity's Shader graph as well...
     
  36. Torigas

    Torigas

    Joined:
    Jan 1, 2014
    Posts:
    63
    I had something similar and disabled shadow cascades in the LWRP asset. That worked for my 2.5D game where i could set the shadow depth to the visible range without any aliasing - obviously it's not a solution for true 3D games.
    Glad I'm not the only one with this problem.
     
  37. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    Anyone got any alternatives for lensflare? Taken that Unity wants to get rid of flares.
     
  38. ChaoticBox

    ChaoticBox

    Joined:
    Mar 6, 2015
    Posts:
    6
    Regarding scripting, I'm curious as to why so many settings in LightweightPipelineAsset are read-only at runtime. It's nice that we can set up a few preset assets and swap between them, but the lack of flexibility and fine grain control is frustrating.

    It would be nice to be able to tweak shadowmap resolution and other performance-critical settings at will, especially while testing, to (e.g.) check impact on different mobile devices. Or to have a few low/medium/high presets but still allow users to tweak certain individual settings as many PC games do.

    Alternately, a way to build a LightweightPipelineAsset with non-default settings entirely in code would work. I don't see any way to do that right now?
     
  39. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    When you do a build we strip unused shader variants. @felipe can offer more information here but some settings can not be changed at runtime as the shaders needed are not included in the build.
     
  40. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,973
    @Tim-C any update on hololens support for 2018.2? Please remove it from list of supported platforms if your latest release will crash on any built out project, as it is not right to claim it is a viable build target.
     
  41. ChaoticBox

    ChaoticBox

    Joined:
    Mar 6, 2015
    Posts:
    6
    I see on GitHub that a bunch of "Keep-Variants" fields have been added but either aren't exposed or aren't present in the version compatible with 2018.2. A mutable subclass where those are enforced might be a solution - my hope is to have at least a bit more flexibility for performance profiling before settling on per-device presets.
     
  42. Andre_Mcgrail

    Andre_Mcgrail

    Unity Technologies

    Joined:
    Dec 9, 2016
    Posts:
    147
    Unfortunately this is the compute based AO, the MSVO(Multi Scale Volume Obscurance) is a compute based solution, this GitHub just allows the effect to be used.

    There is nothing stopping you from writing your own custom bloom post effect using the post processing stack v2

    We have fixed this on the GitHub version of LWRP, also in package versions for 2018.3, which I know still isn't publicly available which but it is on its way.

    It is known, currently none of the mixed lighting modes(although only subtractive is selectable)work fully, we are looking into the best way to support them on lower hardware as doing what we previously did is going to add another layer of complexity that we would like to avoid.

    The current lens flares in builtin are very very old, they are not efficient, especially on mobile devices, there is work being done on both a cheap replacement for mobile and a more advanced post processing version, though both of these are a long way off yet.

    Hi, do you have a bug report number I can have a look at, I will ask the XR team tomorrow what the status is.

    I see where you are coming from, we will have some discussion about how best to support this as I do see it being crucial for iterative optimisation, but at the same time we need to be careful about how much can be updated on the fly as we can quickly loose performance/memory if mis-used.
     
    Last edited: Aug 16, 2018
  43. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    upload_2018-8-16_20-57-10.png Got an alternative thanks to Unity's particle system.... Now if I could put THAT onto another layer as if overlay... And perhaps an image effect as an alternative.
     
  44. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,973
    No because any build, even a cube will reproduce this. No need for a bug report, no project can run it. Have tried at home, at work, multiple pcs, OS etc. Have tried existing projects and fresh ones.

    Currently you just cannot build out for hololens using 2018.2 and the LWRP, so instead of trying to follow a bug just make a blank project with these, deploy to hololens and hey presto you will see the crash!

    I would file a bug with full attached project but really given that we have tested this extensively we are very sure you will not need one to come across this.
     
  45. JoshVIZfire

    JoshVIZfire

    Joined:
    Jul 26, 2018
    Posts:
    14
  46. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,973
  47. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    262
    Do I properly understand that something like having motion vectors would be impossible by design?
     
  48. macrod

    macrod

    Joined:
    Dec 9, 2012
    Posts:
    22
    Don't draw opaque and alpha test in the same queue.
     
  49. Deleted User

    Deleted User

    Guest

    Hi everyone! How many realtime light sources can i get working on lwrp on android? Currently on pc i can have working 8 light sources, however when i switch platform to android, only one light source remains working. Using Unity 2018.2.5, lwpr 3.0.
     
  50. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    190
Thread Status:
Not open for further replies.