Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[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,899
    ## Version 1.46 is available

    ### Fixed:
    - Lux extended/extended Uber: Fixed viewDir construction in pixelshader
    - Lux extended GUI: Fixed material settings being applied delayed
    - Lux extended Uber GUI: Fixed transparent material settings if alpha testing is enabled
    - Lux skin shader: Turning off specular lighting now works properly
    - Lux hair shader: Specular shift now works even if no shift mask is assigned
    - Versatile blend shader: Fixed "shadow shift" from going crazy in case the sampled scene depth is not close to the mesh

    ### Changed:
    - Lux extended Uber GUI: Removed old style render queue offsets (+50). You may have to adjust the render queues of your materials!

    ### Addded:
    - Skin, transmission and foliage shader: "Mask by incoming shadow strength": Lets you suppress transmission from point lights (which do not cast any shadows)
     
    JAMiller, Vharz and adamgolden like this.
  2. Holodia

    Holodia

    Joined:
    Apr 10, 2017
    Posts:
    4
    Hi,

    There is a shader error with OpenGL ES.
    Code (csharp):
    1. 'Lux URP/Vegetation/Grass TextureDisplace': invalid subscript 'positionWS' at line 261 (on gles3)
    Is that normal?
     
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    ups, i did not see this.
    you may wait for a fix or fix it yourself:
    open "Lux URP Grass Inputs.hlsl"
    then comment the #if starting at line 69 like so:

    //#if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR)
    float3 positionWS : TEXCOORD2;
    //#endif
     
    Holodia likes this.
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    I see you used my normal blending skin optimization, it's possible to make it closer to ground pss texture truth, it's just it's highly sensitive to fine number on the decimal, so searching for the right digit is fiddly. There is probably a way to automate it.

    Also pss has a flaw for non white skin, it select the bleed level based on the ndotl, then mask the results with the skin texture, which mean all skins bleed the same, by masking the ndotl first by the skin texture then use that to select the proper slice of pre integrated subsurface bleed, you'll simulate the absorption of light by melanin. Also skin specs looks better with a double lobe, one for the skin surface and one for the oily layer.
     
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    we are still talking about urp here :) but of course for a cinematic skin shader one might add a 2nd spec lobe and various detail normals.
     
  6. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Probably baking the specular into a LUT texture, to minimize impact while using arbitrary shader complexity.

    Speaking of cinematic, ye old shadowgun had a LUT with 3 light direction (key, fill and rim) baked using oren nayar diffuse and specs as alpha with roughness in mips, but we could ameliorate by baking the light as grayscale in each channel, then passing light color manually for each to greater control.

    Brdf texture (which pss is) in general seem underused for highly complex shader, especially grayscale version colorized in shader, it allows to have ndotl x fresnel and ndotl x half vector in a single texture as different channel.
     
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    i read the filament presentation and will most likely have a look in some luts.
     
    neoshaman likes this.
  8. jleemans

    jleemans

    Joined:
    Apr 22, 2020
    Posts:
    19
    Hello, I'm trying to move my project to URP 7.4.1. (Unity editor 2019.4.1f1)
    But after updating everythnig, it keep getting this errors on Lux URP/Lit Extended.
    invalid subscript 'w' D3D 174
    Any idea how to fix this ?
     
    Last edited: Sep 9, 2020
  9. IceDoom

    IceDoom

    Joined:
    Nov 2, 2016
    Posts:
    1
    Hello! Is it possible to apply a decal on the Versatile Blend shader?
     

    Attached Files:

  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    check the rendering order i guess.
     
  11. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    i am running URP 7.4.1 here and i get no error. so make sure you are on latest.
     
  12. mfitzpatrick-1

    mfitzpatrick-1

    Joined:
    Oct 8, 2013
    Posts:
    31
    Hello, I love Lux. Was wondering if there is a way to combine it with the power of shader graph. Is there any way to do that? Or is there a shader graph version of the Lux Skin shader? Thank you!
     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    most lighting functions have shader graph equivalents. skin however does not.
     
    mfitzpatrick-1 likes this.
  14. OliverTheLove

    OliverTheLove

    Joined:
    Jun 26, 2016
    Posts:
    24
    Hey! I just recently bought the asset since it had decals that work in URP, yay! My project is currently in HDRP, and I want to bring it down to URP, and in the project I show what target you have selected by using decals. When each player selects a target, a bit of the decal will light up with their color. This is all done in a shader graph. Is it possible to easily do with the decals that you have implemented via HLSL atm?

    The way I have done it in shader graph is by splitting the UV and multiplying with the step function, giving me four pieces of the UV and then manipulating the alpha of them.
    upload_2020-9-15_23-1-30.png

    Thanks!
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    i guess you can do the same in the hlsl code. or simply swap out the textures:)
     
    OliverTheLove likes this.
  16. OliverTheLove

    OliverTheLove

    Joined:
    Jun 26, 2016
    Posts:
    24
    I think I'll give the HLSL option a go, thanks!
     
  17. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    https://assetstore.unity.com/packages/tools/utilities/sceneview-highlight-and-pickup-109667

    I'm trying to replace the default render-pipeline outline shader in this tool with the LUX URP toon fast shader.
    I replaced the shader name in the highligher.cs but the outline does not show up.

    Anyone who can help me out to get this tool working on URP?

    The sceneview part is broken here in 2019.2 at least, but it's an easy fix. Change the first one I commented out to the second one, and it works again (hold ctrl): //SceneView.onSceneGUIDelegate += OnSceneGUIDelegate; SceneView.duringSceneGui += OnSceneGUIDelegate;
     
    Last edited: Sep 17, 2020
  18. MrZeker

    MrZeker

    Joined:
    Nov 23, 2018
    Posts:
    227
    Hello
    i started trying to use these shaders today, however i keep having this small problem. Whenever i look in the direction opposite to the direction light my character skin becomes super bright, how could i fix this?
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    what you see here is the transmission lighting.
    you should provide a proper thickness map in the combine skin mask/thickness/occlusion texture. alternatively you can mitigate transmission lighting by lowering "transmission strength".
     
  20. Sheprekt

    Sheprekt

    Joined:
    Dec 11, 2017
    Posts:
    9
    Minor deprecation warning to consider:
    Assets\Lux URP Essentials\Lux SRP Grass Displacement\Scripts\GrassDisplacementRenderFeature.cs(119,24): warning CS0618: 'ProfilingSample' is obsolete: 'Please use ProfilingScope'
     
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    oh using "ProfilingScope" will just spam a bunch of errors...
     
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    version 1.47 has been submitted and may land tomorrow or on monday next week:

    ### Added:
    - Skin shading node for Shader Graph added.
    - Skin shading: Support for curvature texture added.

    ### Changed:
    - Lux URP Skin shader: Ambient Reflection Strength exposed. Ambient diffuse lighting now uses proper diffuse normal.
    - Lux URP Skin shader: Lowered default import size of the LUT to 64px.
     
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    version 1.47 is available.
     
    Lars-Steenhoff likes this.
  24. MrZeker

    MrZeker

    Joined:
    Nov 23, 2018
    Posts:
    227
    Hello, i seem to be having a problem with the Hair shader, i have some eyelashes that don't get rendered at all.
    The texture shows the eyelashes in the "material sphere", but when i set them, they don't render and i have tried changing everything to no avail.
    Any ideas how to fix this?
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    not really as it could be anything: wrong uvs, camera rendering layer settings... have you tried to assign the material to a standard sphere in the scene?
     
  26. tabart_00

    tabart_00

    Joined:
    Mar 31, 2017
    Posts:
    5
    Hey,
    I'm working with LUX URP Decal Lit shader and it works great but I would like to use atlas of decals insted of one texture per decal. To do this I need to remap texture uvs in vertex shader.

    I wrote simple method:

    Code (CSharp):
    1.  
    2. float Remap_float(float In, float InMin, float InMax, float OutMin, float OutMax)
    3.             {
    4.                 return OutMin + (OutMax - OutMin) * (In - InMin) / (InMax - InMin);
    5.             }
    6.  
    defined dacal uv offset data:

    Code (CSharp):
    1.  
    2. float4 _Bounds;
    3.  
    and in vertex shader:

    Code (CSharp):
    1.  
    2. o.uv = float2(Remap_float(v.uv.x, 0, 1, _Bounds.x, _Bounds.z),
    3.                     Remap_float(v.uv.y, 0, 1, _Bounds.y, _Bounds.w));
    4.  
    With my custom shader it works nice but I can't make it work with your decal shader. Any advice?
     
  27. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    that's really interesting. It's a little feature missing to be a really robust decal solution.
     
    tabart_00 likes this.
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    please correct me if i am wrong here - but lux ups essentials decals are built around the srp batcher.
    there is no fancy decaldrawmanager here which would draw hundreds of decals using drawmeshinstanced or drawmeshinstancedindirect. so there is no need to use atlases as well. each decal can have its own texture set and the srp batcher will just take care of them.
    using drawmeshinstanced or drawmeshinstancedindirect might speed up things in case you have hundreds of decals on screen, but on the other hand it would break the flexibility you have now to exclude certain layers and objects.
     
    Last edited: Oct 8, 2020
    kenamis likes this.
  29. tabart_00

    tabart_00

    Joined:
    Mar 31, 2017
    Posts:
    5
    Yeah, you are probably right but working with atlases is easier for our designers and artists. My solution is to keep same material with same texture for different sets of decals (ex. numbers, graffiti, dirt, etc). To define specifing decal we create scriptable object and pick area on texture. These data are passing to material by MaterialPropertyBlock so it shouldn't brake SRP batcher.

    I just can't figure out how to force LUX URP Decal Lit shader to use only part of texture defined in _Bounds variable. With default shader is easy like I mentioned but all these magic projection operations in vertex part of LUX shader are too hard for me to understand... I would really appreciate help...
     
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    as far as i know this WILL break the SRP batcher... but you can simply check it using the frame debugger regardless of if the final result looks correct or not.

    the texture coordinates are calculated in the fragment shader:
    float2 texUV = opos.xz + float2(0.5, 0.5);
    here you could hook in and tweak texUV after these base UVs have been created.
     
  31. tabart_00

    tabart_00

    Joined:
    Mar 31, 2017
    Posts:
    5
    Thanks for your help.

    Tweaking uvs in fragment shader works great... but You are right - SRP batcher and Material Propert Block are not compatible...
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    :(
     
  33. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225
    I see there is no tesselation node in lux so in URP I would need to use ASE to get that, I love that fuzz lighting, is there an ASE node? any?
     
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    no ase nodes, sorry.
     
  35. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    But does alpha to coverage exist as an option for vegetation? It would help a lot in VR and AA.
     
    Last edited: Oct 21, 2020
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    never thought about this... so it does not exist right now.
     
  37. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225
    Could you add a tessellation node for shader graph?
     
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    that would not be a node but a template, which is not possible.
     
  39. halecc

    halecc

    Joined:
    Dec 17, 2016
    Posts:
    33
    Hey Lars,

    I've been messing around with the grass displacement feature and managed to get it working with shader graph in Unity 2020.1. I included a video and this is also combined with your transmission lighting node, it looks amazing!



    Anyways, i tested your grass displacement demo in VR and Unity 2019.4.10 and after replacing the SinglePassStereoMode from SideBySide to None in GrassDisplacementRenderFeature.cs line 185 it worked great.

    Now i got a little ahead of myself and have been working in Unity 2020.1 due to some convenient features and your grass displacement feature works great except in single pass stereo for VR. The result i get is the same as if i were to disable the grass displacement feature. I was wondering if you have started to test in Unity 2020.1? or perhaps have an idea on how to fix? I am almost certain the problem lies in the GrassDisplacementFeature.cs scritpt, ive tried a few things with no avail.
     
    Last edited: Oct 29, 2020
    laurentlavigne likes this.
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    i haven't. at least not into vr.
    can you screen shot the rendered displacement map? or is it just empty?
    you may use the frame debugger and/or rnder doc to see what gets rendered and where.
     
  41. halecc

    halecc

    Joined:
    Dec 17, 2016
    Posts:
    33
    Ok I attached 2 images. First one compares the displacement maps, the VR displacement map on the right is just more dark. After using the frame debugger i noticed that the _MainTex in the RenderTarget is being set to UnityDefault2D instead of _Grass_DisplacementRT. So it seems that its not being initialized correctly.
     

    Attached Files:

  42. jacknero

    jacknero

    Joined:
    Aug 15, 2018
    Posts:
    60
    Hi.May I ask when would you like to support Unity 2020.2 and URP 10?
     
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    soon :)
     
    JAMiller and langtusaupt like this.
  44. Mantra-Games

    Mantra-Games

    Joined:
    Nov 27, 2012
    Posts:
    167
    Hi, I tried to find in your guide and demos how to get displacement working on unity terrain grass. I have the renderer setup and on the camera, I have the script on the camera. I tried the particle version and the control Dispencer version. Cant get the grass to displace..is there a demo?

    Cheers.
     
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    yes, there is a fully setup demo which only needs you to assign the render feature to your pipeline asset.
     
  46. Mantra-Games

    Mantra-Games

    Joined:
    Nov 27, 2012
    Posts:
    167
    I've tried many things...your demo works and I see the topdown texture working in my scene...

    Does it only work with mesh grass and not billboard grass in unity terrain?
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    i does not work with grass on the terrain at all.
     
  48. Mantra-Games

    Mantra-Games

    Joined:
    Nov 27, 2012
    Posts:
    167
    Ok...it doesnt say that in your description or documents. I'm going to ask for a refund.
     
  49. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    you can't simply overwrite/replace the built in grass shader in URP unlike you can do using the built in RP.
    it needs you to overwrite it in the package which make it quite impossible for an asset store asset to do so.
    therefore you will need a cstim rendering solution - like my advanced terrain grass which completely replaces the terrain grass.
     
  50. lolimilk

    lolimilk

    Joined:
    Dec 17, 2018
    Posts:
    15
    I use Unity 2019.4.8f1 URP 7.4.1

    Lit Extender Shader is working normally
    Lit Extender.JPG

    But Lit Extender Uber has a problem, metallic don't working


    Lit Extender Uber.JPG
     
    Last edited: Nov 23, 2020