Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    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. Lorrak

    Lorrak

    Joined:
    Sep 17, 2019
    Posts:
    38
    Hello,
    I add Lux Unlit Decal shader in Graphics>Always Include Shaders, and I got these errors
    and if I dont add it, build is finishing without errors, but it wont be visible on mobile build,
    what im doing wrong? unity 2019.3, luxURP 10.3.2 package, unity urp 10.3.2
    Code (CSharp):
    1.  
    2. An asset is marked with HideFlags.DontSave but is included in the build:
    3. Asset: 'Library/unity default resources'
    4. Asset name: Hidden/InternalErrorShader
    5. (You are probably referencing internal Unity data in your build.)
    6. UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()
    7.  
    8. Building - Failed to write file: Temp/StagingArea/Data/Resources/unity_builtin_extra
    9. UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()
    10. Build completed with a result of 'Failed' in 81 seconds (80743 ms)
    11. UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()
    12. UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
    13.   at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <50f55621a2ca4f31a35283e2979a8bf5>:0
    14.   at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <50f55621a2ca4f31a35283e2979a8bf5>:0
    15. UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()
    16.  
     
    Last edited: Jul 27, 2021
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    i haven't seen this before. but you may try to edit the decal shader.
    open it and go to its very end. see if it points towards the "Hidden/InternalErrorShader".
    if so remove that line and try again.
     
    Last edited: Jul 30, 2021
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    any feedback regarding the urp 12 preview?
     
  4. ChaimCoCo

    ChaimCoCo

    Joined:
    May 9, 2021
    Posts:
    2
    Hi, does the lux URP essentials package work with the latest URP version? 10.5.1? (using unity 2020.3.11)
     
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    latest official one should be URP 11? but yes, 10 and 11 are supported.
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    URP 12 preview
    i have been working on adjusting the shaders to latest beta 5 - which looks as if it has some massive drawbacks compared to beta 4: like screen spaced shadows in deferred being totally broken...
    nevertheless I implemented some major changes like best-fit normals which will be supported by at least the uber shader.

    Best-fit normals are useful in deferred rendering: The default quality of the GBuffer normals is far from being optimal (8bit per channel only) and will create a faceted look on sharp specular highlights.

    So URP’s deferred renderer offers Accurate G-buffer Normals. Activating this feature however means that all normals on all materials will be first encoded to OctQuadEncoded ones during the GBuffer pass and then decoded for each deferred lighting pass – which produces some overhead (and breaks the terrain add pass…).​

    You might have a lot of materials where low quality normals would just be fine as you have a strong normal map or low smoothness so artifacts are barely visible.​

    Here best-fit normals come into play as you dedicatedly specify which material needs high quality normals and only use them there. Furthermore best-fit normals only need the encoding step, decoding is just the same as for regular written normals and virtually free.

    So best-fit normals let you save a lot of computational power by adding the possibility to render high res normals only on selected objects/materials.

    bfn1.PNG

    URP low quality GBuffer normals. Note the pixelated or faceted look of the highlight.


    bfn2.PNG

    Uber using best-fit Normals. Normals here still are not perfect and will show some noise. But in most cases they look way better than the standard normals.
     
    Last edited: Aug 1, 2021
    lilacsky824 likes this.
  7. ChaimCoCo

    ChaimCoCo

    Joined:
    May 9, 2021
    Posts:
    2
    Thanks! just making sure before purchasing.
    BTW the asset looks great!
     
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    thanks!
     
  9. lilacsky824

    lilacsky824

    Joined:
    May 19, 2018
    Posts:
    164
    I found some error.
    Some paths of #include aren't correct.
    They should under Grass.
    Code (CSharp):
    1. "Grass/Includes/Lux URP Grass ShadowCaster Pass.hlsl"
    instead of
    Code (CSharp):
    1. "Includes/Lux URP Grass ShadowCaster Pass.hlsl"
    loading.jpg
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    damn!
    thanks for reporting.
     
  11. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    hmm, just had a quick look here and everything compiles fine (windows 10).

    edit: most likey because you updated the existing installation. totally forgot about unity updating files due to their meta in place. i will reorganize the beta package.
     
    lilacsky824 likes this.
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    preview for beta 5 is submitted. it should be available soon.
     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    preview for beta 5 is available.
     
    MP-ul likes this.
  14. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    862
    Hi lars, any guides on packing lux shaders into asset bundles? I found strange issues with lit extended shader:
    One of my material uses the specular pipeline of the lit extended shader, and it all rendered correctly. But anohter material with metallic pipeline cannot sample the normal and metallic map.
    Both materials are packed inside assetbundles and the bundles are all loaded on startup of the game. Any ideas?
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    not really as i have never worked with assetbundles.
    i assume that the metallic and normal enabled shader variants got stripped off in the bundle for some reason. but i can't tell you how you can fix it, sorry.

    explicit shadervariantcollections?
     
  16. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    862
    I tried to compile all variants for the shaders. But then I ran into this error:
    invalid subscript 'instanceID' on line 86 of Lux URP Depth Only shader. It prevented me compiling all variants...
     
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    you can comment:
    line 251: #pragma multi_compile_instancing
    in case you use srp batcher (as instancing will not take place anyway).
     
  18. Radivarig

    Radivarig

    Joined:
    May 15, 2013
    Posts:
    95
    Any updates on this?
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    not from my side. i never really got the point. and evem looking over it again it is quite difficult for me to understand the problem.
    what caught my attention tho were the "hidden" parts like highlighted below.
    you may try to exclude them using stencil and ZFail.

     
  20. nankink

    nankink

    Joined:
    May 6, 2017
    Posts:
    15
    Hi, uh..
    I'm having a lot of issues when importing the asset even in a completely blank project... I created a new project using the URP template and imported. It gives me a lot of shader errors..
    I used the Package Manager > My Assets and downloaded the Lux URP Essentials from there. I even deleted the cached asset and made sure that it's the latest one.

    upload_2021-8-11_11-3-44.png

    @Edit
    oh nvm.. I just saw the post above!
     
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    depending on the version of urp you have to import the corresponding package so urp 10 and 11 need these.
     
  22. Lucideus

    Lucideus

    Joined:
    Dec 7, 2015
    Posts:
    25
    What I was trying to achieve was some way to create something that could work as telegraphed areas for abilities that could work with non-flat surfaces without having to use projectors. I couldn't get the hidden parts to not show but I might return to it and try again when I'm motivated again, haha.
     
  23. Radivarig

    Radivarig

    Joined:
    May 15, 2013
    Posts:
    95
    It seems like we need to get what stencil shader with two passes does but in urp, but urp calls only the first pass by design, so RenderObjects have to be used instead for additional passes to work.

    Here is a forum post with some discussion:
    - https://forum.unity.com/threads/intersection-shader-cull-front-minus-cull-back.536812/

    The answer on it uses three passes, but the one below uses 2:
    - http://answers.unity.com/answers/1487831/view.html

    However as of recently answers.unity don't work because Unity needs to extend their domain/service license or whatever..., so here is the code from the 2 pass shader:

    Code (CSharp):
    1. Shader "Unlit/highlightVolume"
    2. {
    3.     Properties
    4.     {
    5.         _Color("Color", Color) = (1,1,1,.2)
    6.     }
    7.     SubShader
    8.     {
    9.         Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" }
    10.         Pass
    11.         {
    12.             Stencil
    13.             {
    14.                 Ref 172
    15.                 Comp Always
    16.                 Pass Replace
    17.                 ZFail Zero
    18.             }
    19.             Blend Zero One
    20.             Cull Front
    21.             ZTest  GEqual
    22.             ZWrite Off
    23.  
    24.         }// end stencil pass
    25.         Pass
    26.         {
    27.             Blend SrcAlpha OneMinusSrcAlpha
    28.             Stencil
    29.             {
    30.                 Ref 172
    31.                 Comp Equal
    32.             }
    33.             CGPROGRAM
    34.             #pragma vertex vert
    35.             #pragma fragment frag
    36.             float4 _Color;
    37.             struct appdata
    38.             {
    39.                 float4 vertex : POSITION;
    40.             };
    41.             struct v2f
    42.             {
    43.                 float4 vertex : SV_POSITION;
    44.             };
    45.             v2f vert(appdata v)
    46.             {
    47.                 v2f o;
    48.                 o.vertex = UnityObjectToClipPos(v.vertex);
    49.                 return o;
    50.             }
    51.             fixed4 frag(v2f i) : SV_Target
    52.             {
    53.                 return _Color;
    54.             }
    55.             ENDCG
    56.         }//end color pass
    57.     }
    58. }
    59.  
     
  24. AlterRatione

    AlterRatione

    Joined:
    Mar 24, 2017
    Posts:
    3
    Hi, my current unity version is at 2020.3.14f1 and the URP doesnt go down to 10.3.2, only to 10.5.0 (and up to 10.6, so I can't jump to 11). And I have been getting errors since importing the files as well as the decals not working at all. What should I do?
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    there is a package for urp 11 as well.
     
  26. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
    any reason why decals and screenspace fog are showing through these materials? my guess is that these materials are not writing to the depth texture.
     

    Attached Files:

  27. Kretoskar

    Kretoskar

    Joined:
    Mar 15, 2019
    Posts:
    11

    Attached Files:

    Last edited: Aug 31, 2021
    Lars-Steenhoff likes this.
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    not at the moment...
     
  29. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
    So im on URP 10.4 and I have the LUX 10.3.2 package installed. Only the Skin shader is failing to compile with this error:
    undeclared identifier 'LuxURPSkinFragmentPBR'
    Compiling Fragment program with _ADDITIONAL_LIGHTS _BACKSCATTER
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODING
    Disabled keywords: _NORMALMAP _SPECULARHIGHLIGHTS_OFF _ENVIRONMENTREFLECTIONS_OFF _RECEIVE_SHADOWS_OFF _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHT_SHADOWS _SHADOWS_SOFT _MIXED_LIGHTING_SUBTRACTIVE DIRLIGHTMAP_COMBINED LIGHTMAP_ON FOG_LINEAR FOG_EXP FOG_EXP2 INSTANCING_ON _NORMALMAPDIFFUSE _DISTANCEFADE _RIMLIGHTING UNITY_NO_DXT5nm UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30

    Should i try to install the LUX URP 11 package? or will that break other things?
     
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    strange. this means that the lighting function is not defined?!
    try to reimport the shader first.
     
  31. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
    Yeah, Reimport worked. Strange. On another note, do these shaders write to the depth texture? For some reason my post process fog is not getting its depth.
     

    Attached Files:

  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    the skin shader? it writes to depth, yes. but use the frame debugger to be sure.
     
  33. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
    Maybe this is the issue? it looks like its not being written into the Depth prepass?
     

    Attached Files:

  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    it is the depth normal prepass. do you have the right package installed?
     
  35. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    194
    Hi, what are the settings I need to do for toon water something stylized?
     
  36. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
    I reimported the package and it looks ok now. Not sure why it keeps doing that lol.
     
  37. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
    These shaders are great thanks. By the way, maybe in a future version, an option to use alpha dithering with alpha clipping on the geometry queue instead of transparency would be awesome. :)
     
  38. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
    for things like decals and particles I mean...
     
  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    i guess you will need proper textures for foam and normals.
     
  40. zippin

    zippin

    Joined:
    Sep 21, 2020
    Posts:
    13
    I have one question. Would it make sense to add parallax mapping to mesh terrain shader. Mesh terrain shader should be faster than terrain shader and normal mapping doesn't look as good in VR. I haven't tried but parallax mapping should give convincing look in VR. With mesh terrain parallax mapping we would get faster rendering and more convincing look compared to just normal mapping (I hope).

    Thanks!
     
  41. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    the mesh terrain shader originally was written for a mobile project. so it focused on limited resources.
    the shader itself should be a bit faster than the terrain shader. the big difference however is the mesh (uvs, overhangs) compared to a unity terrain (top down projection, height map based) which allows e.g. less or optimized vertex density and lets you create complex shapes.
    on the other hand it is a bit demanding as you have to model and texture the terrain most likely outside of unity and loose features such as grass.
    depends... in case you have a "huge" terrain you would have to slice it into smaller chunks so that the cpu can do a good culling job.

    but in order to het you started: with a few tweaks you should be able to use the terrain shader on a mesh:
    - comment all the [HideInInspector] attributes
    - then add:
    _DiffuseRemapScale0 ("DiffuseRemapScale0", Color) = (1,1,1,1)
    _DiffuseRemapScale1 ("DiffuseRemapScale1", Color) = (1,1,1,1)
    _DiffuseRemapScale2 ("DiffuseRemapScale2", Color) = (1,1,1,1)
    _DiffuseRemapScale3 ("DiffuseRemapScale3", Color) = (1,1,1,1)
    to the properties.
    this will still give you a simple top down projection but if you are fine with the result performance wise you can change the uvs in the next step.
     
  42. zippin

    zippin

    Joined:
    Sep 21, 2020
    Posts:
    13
    Thank you, i will definitely try it out. You are freakin' awesome!
     
  43. zippin

    zippin

    Joined:
    Sep 21, 2020
    Posts:
    13
    Just to let you know. When I wanted to try "Lux URP/Terrain/Lit" shader with single pass instanced it complained and to fix it update ~\Assets\Lux URP Essentials\Shaders\Terrain\Includes\TerrainLitPasses.hlsl at the very bottom, it needs to look something like this
    Code (HLSL):
    1. half4 DepthOnlyFragment(Varyings IN) : SV_TARGET {
    2.             UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
    3.             return 0;
    4.         }
     
  44. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    194
    No, they are just shaders no texture needed. I was wondering if the toon shader part will be able to make a scene like this

     
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    latest should fix a bunch of vr related issues. thanks for reporting!
     
    zippin likes this.
  46. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    maybe. like the shaders used in the screen shot you have posted lux urp essentials toon comes with its own lighting function. which may allow you to create a look just like this...
     
    Gamingbir likes this.
  47. ShaunUnity

    ShaunUnity

    Joined:
    Dec 8, 2017
    Posts:
    26
    Hi I just installed version 1.38.0 inside Unity 2019.3.0f6 and I'm getting a bunch of errors like this one.

    error in 'Lux LWRP/Projection/Decal Unlit': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at line 88 (on d3d11)
     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    just reimport the shaders. unity has massive problems here...
     
  49. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    78
    Hi. I'm using URP 10.7.0 on Unity 2020.3.19f1.
    I tried importing LuxURPEssentials_URP_10.3.2 and LuxURPEssentials_URP_11 packages.
    Both generate errors :

    Assets\Lux URP Essentials\Scripts\Editor\LitExtendedShader.cs(4,29): error CS0234: The type or namespace name 'Universal' does not exist in the namespace 'UnityEditor.Rendering' (are you missing an assembly reference?)

    The project was initially made within Builtin, converted to URP. Would you know where the issue is ? Thanks.
     
    Last edited: Oct 5, 2021
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,850
    crazy, that is the name space which is also used by e.g. the BaseShaderGUI.cs inside the urp 11 package. so it should exist...