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. 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. zIyaGtVm

    zIyaGtVm

    Joined:
    Dec 27, 2017
    Posts:
    131
    Hi, I get the following error but can't locate the source :
    Code (CSharp):
    1. Property (_MainTex) already exists. Use SetTexture instead.
    Unity 2021.2.10f1
    URP 12.1.4
    LuxURP 1.81 with LuxURPEessentials_URP_12.1.package
    [There is no other plugin asset]

    Could you tell me which file should be fixed? Thanks
     
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    version 1.82 is available.

    ### Added
    - LuxURP_BillboardBounds.cs added which lets you tweak the billboards' mesh bounds to prevent them from being culled too early.

    Following changes only affect the URP 12.1 package:

    ### Fixed
    - Fixed ambient occlusion debug view for skin, hair, lit extended and clear coat shaders.
    - Fixed billboard shader and screen space shadows (upright only, view aligned billboards should not cast shadows at all).
    - Fixed DepthOnly shaders.
    - Fixed Fuzzy shader declaring _MainTex twice.

    ### Changed
    - Wind, foliage and grass bending reworked:
    - - Wind uses simplified inputs.
    - - Wind may change the frequencies of higher level animations according to the main strength.
    - - Wind derives turbulence from main wind now. Turbulence as set on wind zone will be ignored.
    - - Lux Wind params renamed from LWRP to URP. Example: "_LuxLWRPWindDirSize" --> "_LuxURPWindDirSize"
    - - Foliage shader now supports additional, advanced turbulence and simple displacement (touch bending - WIP) which has to be enabled in the material inspector.
    - - Foliage shader includes vertex color debug mode so no additional shader is required.
    - - Grass shader now supports displacement (touch bending) which has to be enabled in the material inspector. The "Lux URP Grass TextureDisplace" shader is deprecated.
    - Shader Graphs: Toon Lighting V1 shaders converted to V2.

    ### Added
    - Tree Creator shaders now support deferred lighting (approximated) and decals.
    - Grass Displacement: Shader for trail renderers added.
    - Skin shader: Added support for detail normals.

    ### Known Issues
    - Debug view in deferred is still as corrupted as using built in shaders! So switch to forward to debug your materials.
     
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    that was caused by the fuzzy shader... version 1.82 which is available now fixes it. other changes are listed in my post above.
     
    zIyaGtVm likes this.
  4. VulpineDen

    VulpineDen

    Joined:
    Apr 24, 2021
    Posts:
    7
    Hay thank you for fast response. I didn't notice that your package has graphs files and I can modify the shader.
    I found 'Lux Skin Graph' for M Lux Skin Shader but I use M Skin Shader and want to modify it but can't see Skin Graph for it?
     
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    hey,
    all custom lighting functions have a shader graph implementations as well. not as fast and versatile as the hlsl version (in case you can tweak hlsl) but open and flexible to anyone who knows how to use shader graph.

    make sure you get latest (1.82) in order to get support for detail normals in the skin shader. the detail normals are only added to the normals used by specular lighting. the diffuse normal simply ignores them: it did not look convincing at all adding them to the diffuse normals as well...

    the shader graph for skin is located in the folder "Shader Graphs" --> "Lux Skin Graph.shadergraph".
    if you open the "Custom Shader Graphs Demo" scene you will get an overview of the hlsl and shader graph versions.
    material used here is "M Lux Skin Shader Graph".
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    the shader graph version aslo lets you implement a detail normal mask easily: just do not feed "detail normal scale" from slider input but add a new texture and feed the sample into the input of the lighting node: black = 0 will make it flat.
     
  7. VulpineDen

    VulpineDen

    Joined:
    Apr 24, 2021
    Posts:
    7
    Thank you soo mush I will check it <3
    Also here is after editing Lux Skin Graph.
    Also about M Skin material. I see that SkinLightingHLSLShader this is Lux URP Skin and M Skin and I don't see the .graph
    The "Lux Skin Graph" is what I edited but this is not what I see in "M Skin material" I'm a bit confused...
     

    Attached Files:

  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    right out of my head the "M Skin" material uses the hlsl version. so look for "M Lux Skin Shader Graph".

    looking at your test.jpg:
    - the shader expects a proper secular color which always is rgb. you feed in the alpha which might be you metalic mask or just a grayscale specular which will be expanded to alpha.xxx = specular.rgb. so grayscale. but gold e.g. has a yellow tint regarding its spec.
    - futhermore you have to darken the albedo where there is metal as metals do not have any albedo.

    so you have to to use the Lux Essentails node i mentioned before to take albedo and a metalic mask then convert it properly to the final albedo (metal part set to black) and proper rgb specular (taken from albedo according to the mask).

    you also have to mask out skin lighting on the metal parts. so you have to put the invers of the metal mask into the skin mask input of the lighting function.

    metalSkin.PNG
     
  9. VulpineDen

    VulpineDen

    Joined:
    Apr 24, 2021
    Posts:
    7
    I'm sorry I didn't explain correctly. I've attached a picture with a shader mat.
    I want to open M Skin (The second on picture) material as a shader graph but the file is missing. I don't see it anywhere.
     

    Attached Files:

  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    i am sorry, but i do not understand what you mean...
    if you have a material and want to edit its shader there is an "Edit" button at the top of the material inspector.
     
  11. VulpineDen

    VulpineDen

    Joined:
    Apr 24, 2021
    Posts:
    7
    I know but I though I can do it in shader graph by nodes and not in code. Sorry for bothering. ^^''

    Also I did how shown on your screenshot but I can't get the right result. I've tested in different ways and the result what I have so far is what I'm looking for.
     

    Attached Files:

  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    well, if the associated shader is written in hlsl edit will open the hlsl file. if it is a shader graph, it opens shader graph. there is not conversion from hls to shader graph :)

    first graph looks odd.
    and even the 2nd one has issues. mots important: you do not feed anything into the skin mask input. at least i can not see it.
    and the A) looks weird. why would you revers smoothness? is it roughness? then reverse it in photoshop.
    skinMetal1.PNG
     
  13. VulpineDen

    VulpineDen

    Joined:
    Apr 24, 2021
    Posts:
    7
    I work in metalness workflow and I use diffuse/roughness textures and maybe this is why it's looks weid because it not saying that this is roughness)) Sorry.
    Metall go to SpecColor and Roughness to Smoothness. I feed skin mask as a metallnes but forgot to switch workflow to metal at "oneMinus" node and because of that it didn't work at first time.

    Also I need separate channel for metal and I have it in alpha channel with color texture.
    If I will feed skinMask to metal mask on the model that don't have skin and it will be any dielectric material like a plastic, rubber, paint (white mask) and metall (black mask) I will have SSS on them because skinMask is SSS. I haven't checked but it makes sense. I like to use one shader that can be compact and used for different things. Depends of needs.
     
    Last edited: Feb 8, 2022
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    just to make sure: metal and albedo must go to the "Lux meta/albedo to specular/albedo node" and then to albedo and spec input of the lighting function.
    this is what i wrote earlier: if you need more control you can not just use the skin mask but need a 2 channel mask in which the first channel masks skin/standard lighting and then the 2nd one comes on top to mask dielectrics/metals.

    to be honest: it should be super simple to achieve this :)
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
  16. mimikuwo

    mimikuwo

    Joined:
    Mar 30, 2021
    Posts:
    2
    I tried to open him with the latest version of URP 2021 and got a clear error report and a very large number of missing shaders.
     
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    you should also get a popup which tells you that you have to install the needed urp 12.1. package.
     
  18. msyoung2012

    msyoung2012

    Joined:
    Mar 20, 2014
    Posts:
    49
    Hey, this is rendering in wildly different styles on Mac vs. PC in my builds. How can I fix this? Using a URP project in 2021.1.16f1. Compare the Mac build which looks fine with the very dark and ugly/purple PC build. Stats for relevant machines are attached, followed by the pictures. Zero difference in the code or models - only change was building for PC vs. Mac. (Was developed on Mac).

    Screen Shot 2022-02-18 at 3.00.30 PM.png Screen Shot 2022-02-18 at 3.00.21 PM.png Screen Shot 2022-02-18 at 2.59.37 PM.png Screen Shot 2022-02-18 at 2.58.49 PM.png
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    which shader do you refer to? forward or deferred? shaders have been developed on dx11, so pc should be absolutely fine.
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    i did a quick test and ran a build on windows 10 of the "Custom Shader Graphs Demo" which looks fine as far as i can say.
    however i accidentally came across this in the 2021.12 release notes:
    • Shadows/Lights: Scene is brighter in Standalone player if it was open in the Editor at build time (1375015)
    and this is the ticket in the issue tracker:
    https://issuetracker.unity3d.com/is...Wc3QUJJcERvWnlSaW9DckJoWmJCb0NSckVRQXZEX0J3RQ..
     
  21. msyoung2012

    msyoung2012

    Joined:
    Mar 20, 2014
    Posts:
    49
    That's not the issue I'm reporting. Look closely at the images and you'll see the shader is behaving differently in the windows build.

    This is with LuxURP toon HLSL, forward i believe.
     
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    well, i did look closely :) and for me it is an issues even if it looks as if it was the other way around: the build is darker and misses ambient ligting. at least on dx11.

    in the background: build, foreground: editor.
    the plane, the boxes and the white sphere at the left corner use the built in lit shader as well as the chrome ball. red yellow and red sphere use toon hlsl.
    all materials lack a good portion of ambient lighting. and the chrome ball shows that even reflections are darker.

    lightingIssue.PNG
     
  23. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    958
    Hi, I see the same error as fleity on URP 12 with
    Vegetation/Foliage Debug
    ,
    Terrain/Blend
    ,
    Versatile Blend
    and
    Toon & Outline HLSL
    shaders.

    And I have imported the URP 12.1 package.

    Are they all unsupported? What else am I missing?
     
  24. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    958
    OK Actually not exactly the same error, but here is mine:

    Screenshot 2022-02-23 184632.jpg Screenshot 2022-02-23 184642.jpg Screenshot 2022-02-23 184656.jpg Screenshot 2022-02-23 184707.jpg

    I am on Unity 2021.2.10f1 with URP 12.1.4
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    yes, these shader have not been converted to URP 12.
    - Foliage Debug: is obsolte as the foliage shader now contains debug.
    - Terrain/Blend: is forward only and might be just dropped.
    - Toon & Outline HLSL: does not work with new depth priming. you have to use toon and add a 2nd material for the outline as described in the docs.
     
    bitinn likes this.
  26. cpkcpk

    cpkcpk

    Joined:
    Dec 13, 2019
    Posts:
    47
  27. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    Catsploration and cpkcpk like this.
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    nothing new but just a little short:

     
  29. zIyaGtVm

    zIyaGtVm

    Joined:
    Dec 27, 2017
    Posts:
    131
    It looks nice. By the way how to achieve a totally dark-room environment like you did in the video?
    I'm using LuxURP under URP12.
    I just find the scene is always so bright even there's no light component in scene (Should I change the lighting setting environment lighting color to black? Or there's other configuration i don't know?)
     
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    it is a while since i worked on this but yes: i guess i first turned down ambient lighting and reflections.
     
    zIyaGtVm likes this.
  31. zIyaGtVm

    zIyaGtVm

    Joined:
    Dec 27, 2017
    Posts:
    131
    Thanks! Here's another question.
    How to make my walls in ToonGraphV2 block a spot light? (I want the backface of a cube mesh is in darkness instead of illuminated)
     

    Attached Files:

    • v2.gif
      v2.gif
      File size:
      7.6 MB
      Views:
      240
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    you must not colorize the shadows.
     
  33. zIyaGtVm

    zIyaGtVm

    Joined:
    Dec 27, 2017
    Posts:
    131
    Do you mean a positive value on [Colorize main light] / [Colorize Add Light] will cause models' backface illuminated?
     
  34. GCatz

    GCatz

    Joined:
    Jul 31, 2012
    Posts:
    281
    any chance this can be fixed in the future ?
    some stuff can't use stencil, and from the editor it works, the problem only occurs from the camera view
    also its only on y axis and not x
     
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    na, this can't be "fixed". urp grabs the depth buffer only once.
     
  36. jreizen

    jreizen

    Joined:
    Apr 9, 2018
    Posts:
    3
    Hi, i can't seem to make the decals work when using overlay camera. The decals appear fine when used when the camera's renderType is Base but not when set to overlay.

    Im using 2019.4.31f1 and URP 7.3.1
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    oh, i never checked this. decals rely on the camera depth texture being available...
     
  38. jreizen

    jreizen

    Joined:
    Apr 9, 2018
    Posts:
    3
    Can this be fixed? Any work around this issue?
     
  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    i have no idea. is there an option to enable the depth texture for the overlay cam?
     
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    just gave t a quick look: for me it just works: if the base camera renders the decal the overaly one will do so as well.
    but i tested it in unity 2020 - so ii might be broken in earlier versions of urp.
     
  41. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,739
    Hi

    Checking the documentation for the Terrain shader I found this:
    In order to make it work with GL ES 2.0 it uses multiple passes to draw the splats in case you have assigned more than 4 layers – just like the built in terrain shaders.

    Now, Open Gl 2.0 has been officially deprecated. You can use one single pass for all those textures in OpenGL 3.0, any hopes to update those terrain shaders? Microsplat already uses that feature and the performance is noticiable.
     
  42. jreizen

    jreizen

    Joined:
    Apr 9, 2018
    Posts:
    3
    So i tested again the demo scene in 2020.3.32f1 URP 10.8.1, Base camera renders the decals, but Overlay still doesn't render any of the decals
     
  43. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,739
    Hi, bug in here. I've just "upgraded" to the Tree Creator URP shader. The trees seem to look fine in the editor but the Android build fails. All "bark" shaders look pink when you compile and run on android. Any help please?

    I'm using URP 12.1 and Unity 2021.2.17

    I've noticed that on the "bark optimized" and "leave optimized" there is a shader error:
    Select the shader files and scroll down on the inspector. You will see on both
    Unrecognized identifier "attributes" d3d library.hlsl line 128
     
    Last edited: Mar 25, 2022
  44. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,739
    Another bug (Please check the others above). I changed the terrain shader to the one included for URP and I get the sun reflected in the ground, but only in Android platform. Check the attached picture. How can I fix this?

    I played around with the shaders and notice that if I set the "smoothness" value on the shader to 0, that reflection is gone, but then i get weird behaviors.

    Also, it would be useful if we can remove the Specular, Metallic and Smoothness from the shader, since we are on mobile and we can use all the performance increases we can get. All those features are not used on Android for terrains in our case.

    shiturp4.jpg
     
    Last edited: Mar 25, 2022
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    i ttested them in a simple scene with just a cube and and a plane – where the base decal just rendered fine. moving it around it gets visible however that the decal uses the depth texture from the base camera.
    looks like the overlay camera does not create and provide its own depth texture – which makes sense if you remember what it was created for.
     
  46. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    both shaders compile fine here. and Attributes are defined at the top of each include...
    so maybe something went wrong updating the shaders? just delete the entire "Tree Creator" folder, then reimport the 12.1. package.
     
  47. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,739
    Ok, deleting and reimporting the Tree Creator folder fixed the error in the editor. But the Bark is still rendering pink on the Android device. It looks fine in other platforms and even in the editor, but when you build and run on Android, the device shows it pink.
     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    are you using gles3 and not vulkan? i just saw that the bark shader only supports target 4.5.
     
  49. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,739
    I tried setting the shader target to 3.5 which is opengl 3.0 and still displays pink on the device. I fixed it replacing all the target code with this:

    #pragma exclude_renderers gles glcore
    #pragma target 3.5

    because the code was excluding gles3 from the compilation.

    I don't know if that's the best way because I see it adding thousands of shader compilations for the trees.
     
    Last edited: Mar 27, 2022
  50. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,739
    I need help with the URP Water. Here is the situation. When your camera angle is towards the light, you can clearly see the water thanks to the normals. So it looks fine.

    water1.jpg


    But when I'm flying in the opposite direction, the color of the water if flat and it looks just like a green plane. It looks very boring and not like water.

    water2.jpg

    I don't have this problem with Lux Water, only with URP Water. How can I fix this? I've tried touching the normal maps all over but it just works when you are looking towards the light source. If I turn around, it always get the flat fog/underwater color.