Search Unity

[Released] Lux URP Essentials

Discussion in 'Assets and Asset Store' started by larsbertram1, Jul 18, 2019.

?

Does Lux URP Essentials need a Discord Server?

Poll closed Apr 29, 2021.
  1. yes - even if there was no moderator

    4 vote(s)
    57.1%
  2. no, the forum is all we need

    3 vote(s)
    42.9%
  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    Version 1.34 is available!
     
    Quast likes this.
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    see above :)
     
  3. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    560
    Any news for tiling patterns shader ?
     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    nope. the package contains all you need to do it yourself.
    regarding the terrian: i am not a very big fan of this technique used on the terrain as you can do 3 individual texture lookups for roughly the same costs. it is quite handy if you have bad tiling textures. but you can just get some better ones :)

    i may add it to later point tho.
     
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    to make it short: 1.35 will bring a terrain shader which supports stochastic procedural texturing – for the first terrain layer. that is all :) assign your layers wisely and you should be covered.

    procedural texturing.gif
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    version 1.35 is submitted.
     
    Quast likes this.
  7. frostymm

    frostymm

    Joined:
    Jun 21, 2013
    Posts:
    34
    So changing the color space from gamma to linear made the sphere not always blue so that's an improvement! But even copying your settings on the character didn't make a difference on the weird lighting. If I set the base map color to white it's the same as I posted before where it's extremely lit up and if I make it gray like you've got it on the example sphere, the colors look like they've got a weird film over them.

    upload_2020-1-6_18-46-2.png

    I guess it's an issue with 2019.2 like you said since I went ahead and double checked the model in 2019.1.3 and it seemed fine. ¯\_(ツ)_/¯

    Also, is there a version of the outline that doesn't get thicker and thinner as you zoom the camera in and out?
     
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    the default version of the shader should just support this.
     
  9. frostymm

    frostymm

    Joined:
    Jun 21, 2013
    Posts:
    34
    Seems to behave oddly if you increase the width. Pretty dramatic changes at 10+

    Errrr, maybe my issue is that the width is a fixed amount regardless of how far away the model is? Like the line should look smaller when you're farther away from it?

    I'm checking this in 2019.1.3
     
  10. frostymm

    frostymm

    Joined:
    Jun 21, 2013
    Posts:
    34
    Sphere at 10 width:
    upload_2020-1-6_21-28-28.png

    Still at 10 width but farther away from camera:
    upload_2020-1-6_21-29-26.png

    Becomes extra thicc
     
  11. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    560
    Thank you so much for adding stochastic shader. Now my desert will look more better.
     
  12. colin299

    colin299

    Joined:
    Sep 2, 2013
    Posts:
    181
    Hello, because our mobile project needs decal, I just finished writing a simple unlit screen space decal shader for URP:
    https://github.com/ColinLeung-NiloCat/UnityURPUnlitScreenSpaceDecalShader

    My shader is just a combination of these 2 talks, but for forward rendering:
    Low Complexity, High Fidelity: The Rendering of INSIDE's optimized decal shader

    Screen Space Decals in Warhammer 40,000: Space Marine
    https://www.slideshare.net/blindren...Ho4labx3zA3GATpC7fi5qNkzjEj-MYTOBpXnkIsnA3T-A

    My shader uses decal space scene pos reconstruction for decal UV to remove all matrix mul() in fragment shader, then use ddx() ddy() cross() to reconstruct decal space scene HARD normal, so the decal can prevent "side stretching", and do lighting(using HARD normal) calculation in the future.

    I am about to start writing the lit decal shader today, then I discover this asset!
    ------------------------------------------------------------------------------------
    Question:
    1)I want to know is it better to just purchase and use your asset for the decal shader? It is a mobile project, the fragment shader needs to be fast (can't afford any matrix mul() in fragment shader), and the decal shader must be able to reject by depth buffer if pixel is not visible(Early-Z reject).

    2)Do your lit decal shader support "soft" normal for lighting? I only know how to recreate HARD normal from depth buffer, maybe you solved this problem already?

    3)Is this asset written in lots of separate .hlsl (not a big .shader)?
    So I can #include "LuxLWRPEssentials.hlsl"
    and reuse your functions, if I found any hlsl function reusable?
     
    Last edited: Jan 7, 2020
    Lars-Steenhoff likes this.
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    it is always a good idea to purchase Lux LWRP as you get a ton of pretty optimized shaders :) written in the proper urp style. even if your shader just looks fine.
    it does not. and i think there is no way to create soft normals: we only have the depth buffer to reconstruct them - which contains the real geometry's data.
    it is about 20? shaders? lighting functions are separated as includes. like most input definitions as you need them in all the passes: forward, depth, shadow caster and meta.
     
    colin299 likes this.
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    Version 1.35 is available

    ### Added:
    - Terrain shader: Support for stochastic procedural texturing on the first terrain layer added.
     
    Lars-Steenhoff likes this.
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    the thicknes of the outline is constant in screen space - regardless of how far away from the object you are.
    so if you are far away an outline of 10px looks pretty weird.
    the too outline shader does not keep the thickness constant so you may check this.
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    nope, it just stays he same :)
     
  17. LBPToo

    LBPToo

    Joined:
    Dec 20, 2018
    Posts:
    17
    Bug in 1.34?

    Unity 2019.2.15f1
    LWRP 6.9.2

    After updating LUX essentials to v1.34 I now get the error "Assertion failed on expression: '0 == m_CurrentBuiltInBindMask'" in LightweightRenderPipeline.cs at line 198. I get this in my game and in the Environment Demo scenes, but they are in the same project. I can create a new project with just LUX installed if you need me to.

    EDIT: Just saw there's a 1.35 version today. I'll try that now and report if this is fixed.

    EDIT 2: Installed 1.35, and as I'm sure you know, it's fixed.
     
    Last edited: Jan 7, 2020
  18. Gaoyu2020

    Gaoyu2020

    Joined:
    Aug 25, 2014
    Posts:
    19
    I found Billboard shader has error in unity2019.3.0f3. URP7.1.7
    The texture has alpha,but display error.

     
  19. Gaoyu2020

    Gaoyu2020

    Joined:
    Aug 25, 2014
    Posts:
    19
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    what kind of error? i do not see any...
     
  21. Gaoyu2020

    Gaoyu2020

    Joined:
    Aug 25, 2014
    Posts:
    19
     
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    it works absolutely fine for me and i have not been able to reproduce your problem which i think is the folllowing:

    so the orange billboard looks fine: it uses alpha blending and is not camera aligned.
    the reddish one is camera aligned and uses alpha testing.

    as far as i can say you get proper alpha testing in the shadow caster pass but not in the lighting pass which is kind of weird as this combination theoretically does not exist...
    anyway, somehow i think the material broke which can happen as the shader offers a lot of settings. you may go to debug view and try to fix it or simply create a new material.

    billboard.PNG
     
  23. Gaoyu2020

    Gaoyu2020

    Joined:
    Aug 25, 2014
    Posts:
    19
    If you open your demo, everything is correct. But I create a new project, only copy billboard folder(from shader) to new project, this problem appear.
     
    Last edited: Jan 9, 2020
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    ahh: the shader uses a custom gui script to set up the material. you have to copy that too.
     
  25. Gaoyu2020

    Gaoyu2020

    Joined:
    Aug 25, 2014
    Posts:
    19
    I will try tomorrow.Thanks
     
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    Version 1.36 is available:

    ### Changed:
    - Terrain blend shader: Now properly handles different near clipping planes so the preview in the scene view should match what you get in the game view.
    - Box volume and decal shaders: Slightly optimized.
    - Decal shaders: Support for single pass instanced back ported to LWRP.

    ### Fixed:
    - Fixed some materials in the volumetrics demo.
     
  27. colin299

    colin299

    Joined:
    Sep 2, 2013
    Posts:
    181
    the package works in LWRP, what should I do if I want to use it in URP? (just the decal shader)
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    simply import the included urp package. it will overwrite the lwrp shaders.
     
    colin299 likes this.
  29. colin299

    colin299

    Joined:
    Sep 2, 2013
    Posts:
    181
    I strongly recommend you rename the product to include "URP" in the name (e.g. Lux URP/LWRP Essentials),
    "Lux LWRP Essentials" alone looks like some legacy product that will not update anymore in the future, but I believe it is the opposite.

    maybe renaming the product will break every URL in the internet pointing to the asset store, so you didn't do it?
     
  30. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    well, this is not true. so lux lwrp essentials come with an additional package for the urp.
    once 2019.3 and urp are officially launched i will change its name.
     
    colin299 likes this.
  32. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    Why would Unity lie about that?
     
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    maybe they only thought about shader graph shaders...
     
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    ## Version 1.37 is available

    ### Changed:
    - URP package: Switched to Unity 2019.3.0f5 and URP 7.1.7
    - Hair shaders: Rim Transmission Intensity now accepts values between 0 - 8.
    ### Fixed:
    - Hair shader: Depth pass picks up culling settings.
    - Hair shader: Specular shift fixed.
    - Hair blend shader: Shadows fixed.
    ### Added:
    - Hair shader: Allows you to setup culling for the shadow caster pass.
     
    osss likes this.
  35. Jess_AA

    Jess_AA

    Joined:
    May 8, 2019
    Posts:
    38
    Hi,

    I'm using the Clear Coat shader for a project and want to use a normal map. I'd like to retain the functionality of the existing normal map (which if I'm right isn't actually affecting the normal map itself but is driving something else within the shader?) but have a secondary map which would function as a regular normal map. I've tried various edits to the shader graph in order to make get the shader to accept a normal map, but can't get it to work - is there something I'm missing (assuming the shader can even be edited!).

    For various reasons I'm still using LWRP so am on version 1.16 of Lux.

    Thanks!
     
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    the "current" normal map only effects the lighting applied to the base layer (like the carbon fibre in the example or the flakes in other examples). without editing the lighting function there is no way to add a 2nd normal which would drive the lighting of the clear coat layer...
    you may however change the smoothness of the clear coat which already lets you create an interesting surface.
     
  37. alanmthomas

    alanmthomas

    Joined:
    Sep 7, 2015
    Posts:
    197
    I have a question regarding decals. I apologize if I'm missing something basic. I have decals that I would like to project only on the ground layer, ignoring things like players and others. What would I have to do to make this work? I can't really tell from the demo. Also, if I were to want to make the texture repeat (changing the tiling and scaling settings) is that something that is possible? Thanks!
     
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    the most robust method is to use the stencil buffer: so make every material you do not want to receive decals like the player's mat write a special value to the stencil buffer like: stencil ref = 1.
    then make the decals test against this value: stencil ref = 1, comparison = not equal.
    this will prevent decals from being drawn on top of the player's material(s).
    you can also check using the render queue (which theoreticlly should not work but actually does: maybe the depth buffer is one frame behind but this is barely visible): start by drawing all things you want the decals to be projected on. then draw the decals. finally draw the player.
    the demo scene contains examples for both methods. stencil operations are explained in depth in the documentation.
    right now: not without editing the shader code...
     
  39. alanmthomas

    alanmthomas

    Joined:
    Sep 7, 2015
    Posts:
    197
    Thanks! Do you know if there is an easy way to set the stencil buffer within shader graph?
     
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i do not think its possible right now. but i may be wrong as i did not spend much time with shader graph and urp 7.1.7.
     
  41. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Can this work with speed trees? Say I convert the speed tree and LOD's to an FBX mesh can those vegetation meshes that are 2 materials 1 for bark and 1 for leaves use these shaders to replace them or the tree shaders are only for unity trees made from the tree creator?

    Also are there seperate shaders within the package for mobile VR with URP or its all together?

    Just purchased this possible to get a colormap overlay for the mesh and unity terrain to. I see the splatmap slot so a colormap overlay slot right next to the splatmap slot would be great as well to break up the terrain look as well. Splatmap and Colormap go hand in hand.
     
    Last edited: Jan 21, 2020
  42. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    why should it? lwrp and urp have their own speedtree shaders.
    speedtree do have different bending information baked into the mesh. so bending will be totally off. and it would be quite some work to adjust the mesh...
     
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    all together.
    the shader already uses all available texture samplers (gles 2.0). so right now this isn't an option.
     
  44. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Makes sense Lars thx for the info on that. I tried to build to quest from 2019.3.0f5 with URP using the Environment Demo sample and typical android type setup with Linear and the UniversalRP-HighQuality setting for URP. I imported in the oculus utilities using the OVR player as the camera and player with quest as the target. All I got was the skybox and the left eye working on the quest. So it built over just only the skybox was showing. I hope I'm doing something wrong or are the shaders not ready with 2019.3.0f5 for now?
     
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    the urp package works fine with urp 7.1.7. for me. but i only have a rift and as far as i know urp/lwrp have massive problems when it comes to the quest.
     
  46. AhJun

    AhJun

    Joined:
    Dec 30, 2019
    Posts:
    14
    anyone else notice it takes forever to compile the Lux LWRP/Lit Extended shader? it is taking hours to build a simple project
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    compiling the built in lit shader also takes a while – just due to complexity and the amount of multi_comppiles lwrp/urp use. if there are more complex shaders they will take even longer of course.
    you can speed up build time by editing the shaders and comment the freature you do not need, e.g.:
    - you do not use lightmaps? --> comment: #pragma multi_compile _ LIGHTMAP_ON
    - you use a specific fog mode? --> comment: #pragma multi_compile_fog and replace it with either:
    #define FOG_LINEAR or #defined FOG_EXP or #define FOG_EXP2
    or in case you use/do not use exponential2 fog in some cases:
    #pragma multi_compile _ FOG_EXP2
     
  48. AA-Matt

    AA-Matt

    Joined:
    Oct 1, 2016
    Posts:
    8
    @larsbertram1 Just purchased recently and loving these shaders!

    I'm using Unity 2019.3.0f5 and URP 7.1.7 I thought you might like to know some issues that maybe slipped through the cracks.

    - Decal Scene: After importing unitypackage for URP, the decal demo scene has missing shaders which can be fixed by restoring "Lux LWRP Lit Decal.shader.meta" to the version before extracting the unitypackage so that it has the same GUID:
    https://dl.dropboxusercontent.com/s/h52or35qrcxgr9v/lux-lwrp_bug__decal_scene__01__pink_after_importing_urp_package.jpg

    - Decal Scene: I Decals rendering on grass:
    https://dl.dropboxusercontent.com/s/lh08o8gcwi1pzsb/lux-lwrp_bug__decal_scene__02__on_grass_after_reverting_decal_shader_guid_in_meta_file.jpg

    - Fuzzy Scene: Missing shader (probably also a GUID that just has to be restored):
    https://dl.dropboxusercontent.com/s...bug__fuzzy_scene__01__pink_missing_shader.jpg

    - Lit Extended Scene: Uber parallax has alpha clip on (assuming unintentional) and no heightmap assigned: https://dl.dropboxusercontent.com/s..._scene__01__uber_parallax_not_parallaxing.jpg
     
  49. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    thnaks for reporting.
    keeping the 2 packages in sync is just a pain! i hope unity will release 2019.3. soon so i can get rid of this...
     
  50. AA-Matt

    AA-Matt

    Joined:
    Oct 1, 2016
    Posts:
    8
    NP happy to help. Also I just now tried reverting "Decals Demo.unity" to how it was originally before extracting URP package and it fixed the render queue issue. When I tried changing render queue manually before it wasn't working for some strange reason. I don't know what is different about the two scenes to cause this issue.