Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Feedback Wanted: Lightweight Render Pipeline

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

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

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    554
    I have figured out the reason for my problem: SH lights are sampled from Light Probe and since Light Probe is baked only, I can't have real-time SH lights neither.

    However, I ran into another issue:

    I can't seem to get Emissive to work using Baked GI, somehow with LWRP, Light Probes aren't including static emissive objects. LWRP Lit shader doesn't offer a GI option for Emission, I am assuming they are default to "Baked"? Or are they default to "None"?

    EDIT: asked on Reddit, unfortunately no one has a clue so far.

    https://www.reddit.com/r/Unity3D/comments/9tstc3/lwrp_does_emissive_material_contribute_to_baked_gi/

    EDIT2: I think this is a bug too? because in code BakedEmissive flag is set.

    https://github.com/Unity-Technologi...ht/Editor/ShaderGUI/LitShaderGUI.cs#L228-L232
     
    Last edited: Nov 3, 2018
  2. Tesrym

    Tesrym

    Joined:
    Dec 2, 2012
    Posts:
    55
    There is a limit of 16 lights?? You need to tell me how I can get those, because 4 is all I get.
     
    Last edited: Nov 4, 2018
  3. Tesrym

    Tesrym

    Joined:
    Dec 2, 2012
    Posts:
    55
    On the topic of baking lights, light bounces breaks when upgrading from 4.0.1 to 4.1.0.
    Only directional lights bounce on 4.1.0.
     
  4. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    554
    well, it's 16 visible lights on screen, but only 4 per object so far.

    (the doc somehow claim 8 light per object, but it's not possible with LWRP asset yet)
     
  5. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    554
    That would explain my problem with Baked GI, I am hoping LWRP team somehow maintain a known issue page somewhere (say trello?) because it's pretty time consuming to prepare a bug report, I don't want to waste anyone's time submitting known issues.

    EDIT: seem to be the case, no emission or baked point light bouncing in GI. My issues are now reported as case 1097667 and 1097669...

    Screen Shot 2018-11-04 at 21.37.46.png

    Screen Shot 2018-11-04 at 21.38.26.png
     
    Last edited: Nov 4, 2018
    Fallc likes this.
  6. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    322
    Thanks for these samples- super useful.

    Just a note with HDR active, if highly emissive objects (or very bright specular objects) pass in front of a surface with this blur effect, they are blurred into the RT and show as a fringe.

    Adding

    Code (CSharp):
    1. opaqueDesc.colorFormat = RenderTextureFormat.Default;
    2.  
    ..to BlurGrabPass.cs on line 91 immediately after opaqueDesc is declared fixes it.
     
  7. Captain_Flaush

    Captain_Flaush

    Joined:
    Apr 20, 2017
    Posts:
    31
    Hello,

    Been testing the LRP for a few weeks now. The main bug that really bothers me is that dynamic lights do not work the same on PC and mobile both on 4.0.1 an 4.1.0. Originally I thought that not all the dynamic lights get rendered on mobile, but after some tests, I've noticed that their falloff is very different on mobile. I've built a simple scene to test this.
    - Here is a screenshot from PC
    16 Lights Shadows PC.PNG - Here is a screenshot from Mobile
    Mobile lights bug.jpg

    In this case the material used is the default Lit Material on a plane, howver it reproduces with Shader Graphs materials as well.

    Thanks,
    Mihai
     
    juan-jo likes this.
  8. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    554
    Screen Shot 2018-11-06 at 19.39.14.png Screen Shot 2018-11-06 at 19.39.33.png

    Watched UniteLA roadmap and finally see 2019.1 for a stable LWRP.

    I just hope 2018 LTS won't be stuck between a semi-outdated version of LWRP that no Asset Store packages will support (anything that rely on the core shader for shader generation, like Amplify Shader Editor or Toony Colors Pro 2)
     
  9. phil_lira

    phil_lira

    Unity Technologies

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

    Sorry for being away for a while. I'll catch up on the thread and reply individually, by first let me say a couple of words on state of LWRP:

    While being experimental some breaking changes will still happen unfortunately. This is not the ideal scenario as we don't have a way on package manager to require a beta version of Unity. These changes are necessary so we evolve the API based on the feedback received and I apologize for the inconvenience. The good news is that LWRP and SRP Core is coming out of experimental in 19.1. After that no more breaking changes.

    Here's some Known Issues & Limitations that are on my radar at the moment. There are more issues being looked at but these are the ones I remember on top of my head that people reported in this thread or to me from other sources.
    - Light layer culling is not working for the Main Light. This requires engine changes. I have a PR waiting on LWRP side for those engine changes to go in. It requires engine changes and hopefully going to be available soon via new Unity version. LWRP will use the light assigned in as Sun in Light Settings as Main Light, otherwise the brighest directional light. Then light layer culling will work for all lights.
    - PostProcessing is not working with VR and LWRP. This is fixed now in postprocess package and a PR to re-enabled it in LWRP is inbound.
    - Additional directional lights are not supported yet. We haven't started working on this yet, but most likely will be in for 19.1. All lights will be shaded in a single pass.
    - Light limits are at the moment 4 per-object lights and 16 visible lights. The limit will be increase for GLES3.1+ and all non-gles platforms. Most likely for 19.1. We will also look at increasing the limit on GLES2.0 and GLES3.0, but later, probably after 19.1.
    - Tile clearing issues on mobile GPUs (causing random artifacts/trash in screen) when using multiple cameras or not rendering to full screen. There's a PR waiting for engine changes to go in.
    - Particles Shaders issues or missing features. We finishing testing this and should have a fix soon.
    - There are some rendering issues when not using the default viewport (0, 0, 1, 1). Haven't started looking at those yet. They will be fixed at some point before 19.1
    - There are some rendering issues when using multiple cameras depending on the effects enabled or platform. Haven't started looking at those yet. They will be fixed at some point before 19.1
    - Terrain shaders are not fully ported to LWRP. We have no ETA on it yet. Sorry about the inconvenience.
    - Shader Variants / Build time - We are constantly looking at strip and optimize the amount of variants without introducing performance regressions. My advice for now is to avoid UsePass in your shaders as the stripper is not properly stripping those and double check if you have custom shaders that your shader uses the updated LWRP shader variants (changed in 4.0.0 version).

    Thanks a lot for everyone using LWRP and providing feedback. This is crucial to deliver a nice product for everyone.
     
    jashan, bitinn and Tesrym like this.
  10. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    @richardzzzarnold

    I can't see from the log you've posted where's the additional data coming from. I've asked around for more info but to help you better here it will be better if you can open a bug report for this.
     
  11. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
  12. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    The SimpleLit shader has less ALU and texture samples that the physically based one. In your case, since you don't seem to have textures there the diff will be only in ALU. If your game bottleneck is not shader ALU then not visible performance difference will be seen.
     
  13. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    It just because LWRP is lacking occlusion probes to propertly support mixed lighting. Occlusion Probes is in the backlog for 19.1. With that both subtractive and baked indirect mixed light modes will be supported.
     
  14. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    That's because LWRP doesn't support transparent materials to cast shadows. They can only receive shadows. Alpha cutout materials can cast shadows though. You can have the desired effect by settings grass to be cutout + alpha mask/ alpha-to-coverage?
     
    Pr0x1d likes this.
  15. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    This was fixed in 5.0.0-preview and backported to 4.1.0-preview. Let me know if you are still experiencing this issue.
     
  16. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    Built-in and LWRP can't match visually anymore. The main difference is the light attenuation being physically based in LWRP. If you, however, only directional lights then it should be close enough unless you are using features not supported atm in LWRP.

    As for performance, it also depends on your game.
    - If you have multiple lights and a moderately complex scene LWRP should perform better in 19.1 and 18.3 (RC).
    - If you have just a single directional light and the game is fill-rate bound LWRP and Builtin should have same performance.
    - If you have just a single directional light or unlit game and the game is driver or CPU bound: At the moment they should have same performance, however we have a new renderer batcher in SRP that's disabled by default because we have some issues on iOS. We are fixing those issues atm and enable the batcher. In that case, with the new batcher, LWRP should be faster. This new batcher is what made possible the Megacity to run on mobile with LWRP.

    Of course is very hard to claim that on all scenarios and all platforms, but we are progressing towards getting better performance with LWRP.
     
  17. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    What version of LWRP are you using?
     
  18. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    Could you open a bug report for this issue? We'll take a look as soon as possible.
     
  19. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    Sorry about this. There's no dependency tracking and it's a little bit hard to figure out because multiple teams are pushing work to engine that might break API and require new package. (HDRP, VR, Mobile, LWRP).
     
  20. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    Thanks for catching that. I've fix this and another minor issue in the UI of the pipeline asset. The fix should be in for the next package.
     
  21. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    Hi Mihai,

    2) That limit will be increased soon for GLES3.1+ and all non-GLES platforms. We don't have a solution yet for GLES2.0 and GLES 3.0 to shade more than 4 lights per-object without adding performance regression. My opinion though is that if you are running a game on those devices you probably don't want to shade more than 1 directional light + 4 perobject anyway.

    3) Could you open a bug report for this?
     
  22. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    This issue is fixed in 5.0.0-preview and 4.1.0-preview versions.
     
  23. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    Hi Bitinn, could you open a bug report for this. Then we could investigate. Emissive should be working .

    As for SH it's only used for skylight/ambient + light probes in LWRP.
     
  24. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    We have a fix for that issue but it's not available in any package yet.

    You can see all list of active issues here: https://issuetracker.unity3d.com/pr...y_version=&status=1&category=&view=most_voted :D
     
  25. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    We haven't seen something similar to this. Could you open a bug for it?
     
  26. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    This is a little bit tricky as LWRP wont' be out of preview in 18.4. I'll discuss to see what can be done in that regard.
     
  27. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    I think I've covered all posts. If I forgot anyone please feel free to poke.
     
  28. mangax

    mangax

    Joined:
    Jul 17, 2013
    Posts:
    292
    thanks for your support!

    just one thing in my mind i was wondering about.. am surprised that the current postprocessing v2 effects on mobiles are still super heavy! even if am using one effect like Bloom!

    i know it's a rule of thumb to avoid these things on mobile platforms...
    but isn't it possible to achieve currently achieve high FPS like 60fps , with all new LWRP + mobiles GPU advancements??

    i have been testing unity post processing in the past 2 weeks on LWRP, on a device with adreno 502.. and it seems it cuts FPS from 60 to 30 for just a single effect!
     
    phil_lira likes this.
  29. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    554
    Massive thx for this, just a few quick comments:

    - I understand many SRP features depends on core Unity engine, but we are unlikely going to use 2019 for production (it has a great roadmap, no doubt about that, but we just want a stable LTS at this point).

    - We have been working with LWRP from 2018.1 and will absolutely use LWRP given it's solid performance on Metal + macOS, even if we have to make do with a "lite LWRP" (aka: to be able to use latest LWRP release with some API disabled on 2018.4 LTS).
     
    Last edited: Nov 8, 2018
    phil_lira likes this.
  30. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    554
    Also Phil can you confirm Emission + Baked Light Probe problem are fixed and waiting to be released? Because reading both of your replies, I am not sure whether you mean only Indirect Light Bounce are fixed or both are fixed.

    My case id with test scene is 1097667.

    Your issue tracker filter is very helpful but I can't find an issue regarding this problem.
     
  31. Captain_Flaush

    Captain_Flaush

    Joined:
    Apr 20, 2017
    Posts:
    31
    @mangax You can use some postprocessing effects on mobile, not all and not on all devices.
    Bloom is a heavy effect and also you don't need 60 FPS on mobile, 30 is fine :)
     
  32. Thrawn75

    Thrawn75

    Joined:
    Nov 16, 2014
    Posts:
    2,258
    Will you be adding shader macros to identify the current package version?
     
  33. Captain_Flaush

    Captain_Flaush

    Joined:
    Apr 20, 2017
    Posts:
    31
    Adding a point light over objects with unlit shader will brake their instancing.
    Adding a culling mask for that light, so that it will not affect the unlit shader objects, fixes the problem.
    Anyway, this should not happen. I will submit a bug.
     
    phil_lira likes this.
  34. mangax

    mangax

    Joined:
    Jul 17, 2013
    Posts:
    292
    60 fps is my goal as the game am working on looks/plays better on 60 fps.. also it's good ideal fps target as any dips in frame rate would have minimal impact on gameplay.

    but that aside...there is some asset store assets like "sleek" which can add very simple bloom and still retain around 60fps.. which is amazing.. but sadly it doesn't perform well under LWRP which bring me to next point.

    in regard of mobile development and low-end devices...there is not much "out of the box" solutions in unity to help achieving visually
    beautiful things on mobile without digging deep to a very technical level and do things manually in order to workaround on mobiles limited resources.. texture atlas, baking meshes or skinned meshes.. all that stuff all common stuff that needed to be done in order to achieve high fps..

    currently the engine only offers very simple shaders.. even the new LWRP lit shaders still can't manage to achieve 60fps on a simple 3d scene on mid range device.. only unlit and simple lit can achieve this number... i think unity devs should do more in "mobile" spectrum.
     
  35. tom_painter

    tom_painter

    Joined:
    Nov 8, 2018
    Posts:
    13
    Im testing out that great new _CameraOpaqueTexture thing to cheat refractions with a grab pass
    but Im getting weird results that spoil the effect on shapes that occlude themselves from camera

    Can anyone else reproduce this? (I couldnt see it as a known issue anywhere)

    > unity 2018.3.0b9 with new scene with the LWRP template
    > update to the LWRP 4.1.0 with the package manager
    > import any mesh that overlaps itself from the camera view, I used a helix primitive from maya
    > add transparent shader
    The mesh looks good from above, faces sorted/rendered front>back as we'd expect
    as we move the camera below the object, faces begin to render back>front

    its like there is a set ordering of the faces regardless of camera angle.
    Its making my cheated glass shader that uses look REALLY bad.

    I went back to 2018.1.9f2 and tested this with the inbuild shader and its actually the same, so maybe this is just the way things are with unity?
    I work in product visualisation and we are doing an AR app.
    not having good glass or liquids in built in renderer is my reason for exploring LWRP

    best
    Tom
     

    Attached Files:

  36. tom_painter

    tom_painter

    Joined:
    Nov 8, 2018
    Posts:
    13
    To give you some context

    Heres my shadergraph example. I expanded on Ciro's shader
    https://twitter.com/cirocontns/status/1024373927739568128?lang=en
    I added a more 3D effect by having surface normals of the object control the refraction rather than just a flat polygon with a normal map. its a total hack but Im REALLY happy with it
    our mobiles aint going to be raytracing for a few years yet so this is really good stuff

    Im in a place where this is 90% super cool! but the artifacts are spoiling it.
    if I set this to 'opaque' then the artifacts go away, but then of course the effect doesnt work!
    its a funny one because I'm actually setting opacity to 1.0 in the PBR because the hack effect doesnt work if I set opacity to something like you might expect glass to be like 0.1

    any ideas / advice?
     

    Attached Files:

  37. tom_painter

    tom_painter

    Joined:
    Nov 8, 2018
    Posts:
    13
    If I could draw the object as if 'opaque' but at the end during the 'render transparents' phase i think i'd have this working
     
  38. tom_painter

    tom_painter

    Joined:
    Nov 8, 2018
    Posts:
    13
    phil_lira likes this.
  39. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    We are looking into this issue. It's not fixed.
     
  40. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    It's planned to rework the postfx stack for LWRP sometime during 2019 cycle.
     
  41. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    The ability to define keywords for packages is coming in 19.1. This will make possible to both tell if LWRP is installed and which version. I can add a shader version keywords to LWRP 18.3 but not the keyword to tell if LWRP is installed.
     
  42. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    Oh, I'm very glad to say this is going to be super easy to do in LWRP. :D
    Currently in the LWRP materials we have a property called Two Sided. We are extending it so you can choose [front, back, both]. With this you can add two materials to you mesh, one with back and the other with front and it will just work.

    This is coming for 19.1.
     
  43. tom_painter

    tom_painter

    Joined:
    Nov 8, 2018
    Posts:
    13
    thanks @phil_lira sounds awesome!!
    does that mean we will get the approx OIT style per face transparency sorting, so faces sort properly at all camera angles?

    OR did you mean the ability render backfaces with a different material to camera facing polys? (like the doubled sided shader in maya https://knowledge.autodesk.com/supp...E4CA98D6-ACF8-4B97-BE9D-4E69A2275A37-htm.html). This sounds like an interesting feature, but I'd be happy with the same material on the back faces (currently if I switch this on I get a glitchy look) to get a glass look.

    or did you mean both?
    ;)
     
  44. skeptika

    skeptika

    Joined:
    Dec 31, 2011
    Posts:
    103
    Just a quick check, tried out LWRP today, most of it seems to work except particles. I saw on the original post that particles not being fully ported was mentioned, is that why I get the following error?

    Code (csharp):
    1. The following Particle System Renders are using this material with incorrect Vertex Streams
    It has a little "Apply to Systems" button that says it'll fix it, but it doesn't fix it. If it's "yup they're not quite finished yet, should be fixed soon" that's fine, just wanted to check that's part of the known aforementioned issues with particles. If this isn't the expected issue, let me know and I'll detail the issue further.
     
    Last edited: Nov 13, 2018
  45. ALL-CAPS

    ALL-CAPS

    Joined:
    Jun 23, 2014
    Posts:
    8
    Hey Phil I have to ask, I can see the list of active issues you linked is from the "Scriptable Render Pipeline Lightweight" tag, what about the other Lightweight reletad tags like the VR one? The bug I reported in the start of this thread about viewport rects, is under there (although my project is not tied to VR).
    Will these issues also be fixed for 19.1 ?

    Here is the issue I wrote on page one just so you dont have to hunt down my other post:
    "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."
     
  46. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    I mean the ability to choosing in the material to render backfaces only. We already support front faces and double sided.
    That fixes OIT for some meshes. However depending on your mesh it's not enough.

    If you want a general purpose OIT then you need to resort to something like depth peeling, which can be done by overriding the LWRP renderer with your own custom render passes. https://pubweb.eng.utah.edu/~cs5610/lectures/OrderIndependentTransparency.pdf
     
  47. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    Could you share the case number so I check it. It might have been triaged to VR by mistake.
     
  48. tom_painter

    tom_painter

    Joined:
    Nov 8, 2018
    Posts:
    13
    Here attached is a unity default sphere with a default LWRP/lit material with transparency, when i turn on double sided we get some artifacts, looks like Z-fighting or something like that?

    If my 'separate mesh' hacks don't work because of seams, I might try this if I can dedicate the time, I didnt do 'proper' graphics programming before but I wanted to learn

    BUT, I dont think this is an edge case to require a plausible glass effect on an average complexity mesh is it? I thought good transparency effects is something that all unity customers would want? I'm surprised the transparency shader in Unity is so simple, Im not expecting raytracing on mobile or anything but I thought the depth sorting should be an option by default?
     

    Attached Files:

  49. Captain_Flaush

    Captain_Flaush

    Joined:
    Apr 20, 2017
    Posts:
    31
    How can I create a global variable and access it from shader graph.
    I saw in the Unite LWRP livestream that you can create a global texture then access it by name from shader graph.
    Example: I would like to create a global float variable that all my shaders would use and I would update that variable from my scripts. So that I don't need to manually code sending new material blocks for each material when my float variable changes.
    Is this possible?
     
  50. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    389
    Sorry for causing confusion on this. :p We don't have this available now, that Two Sided option will become a Render Face option that you can choose {Front, Back, or Both}. when this is exposed then you can simply render your mesh twice, back faces first, then front faces.
     
Thread Status:
Not open for further replies.