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. Jesper-Nielsen

    Jesper-Nielsen

    Joined:
    Nov 14, 2013
    Posts:
    95
    Apparently this happens when converting a material with a lit shader to versatile blend. Apparently some of the hidden/unused inputs from the lit shader are affecting the behaviour.
    When copying the material from the demo scene and just changing textures etc. it works fine.
     
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    ah, i see. you can go to bebug view (3 dots in the upper right corner of the inspector window) and look for "disabled shader passes".
     
    Jesper-Nielsen likes this.
  3. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi, is it possible to add a cutout mask for the skin shader? I'll need this feature to hide skin parts when dessing up my character.
     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i have no idea why this is needed. of course it is possible, but you would have to do it your own: adding cutout will slow down the shader. so i would recommend to dive into your models and find out what is going wrong here.
     
    MP-ul likes this.
  5. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    I'll try to work on my models then. And is it possible to have a hair shader with the cutout pass and the blend pass together inside one shader? Unity warns that using two materials on one mesh is more performance heavy than an additional pass.
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    it used to be not. it is now. but you can simply ignore the warning.
     
  7. betaFlux

    betaFlux

    Joined:
    Jan 7, 2013
    Posts:
    112
    Hello, I was hoping to use the unlit decal shaders for a top down rpg character selection, but they are projected on everything including the characters. I have read the manual and tried a lot of stencil settings combinations but I just can't make it work. Honestly I still don't understand the stencil settings in the shader after reading the manual.

    Can someone please explain how to make a decal visible only on only the terrain or/and ground with a certain layer?
     
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    layers are a cpu not gpu construct. but instead of using the stencil buffer you can try to use the render queue to limit the decal to anything drawn before it. examples are in the demo scene.
     
  9. betaFlux

    betaFlux

    Joined:
    Jan 7, 2013
    Posts:
    112
    I'm on Unity 2020.3.11f1/URP 10.5.0 (Upgrade from SRP) and just realized that more than half of the Lux shaders are in the "failed to compile" list of shaders. When I completely remove the asset and reimport I get these errors:

    Shader error in 'Lux URP/Human/Hair': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 346 (on d3d11)
    Shader error in 'Lux URP/Human/Hair Blend': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 228 (on d3d11)
    Shader error in 'Lux URP/Human/Skin': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 538 (on d3d11)
    Shader error in 'Lux URP/Cloth STL': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 541 (on d3d11)
    Shader error in 'Lux URP/Simple Fuzz': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 543 (on d3d11)
    Shader error in 'Lux URP/Toon & Outline HLSL': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 818 (on d3d11)
    Shader error in 'Lux URP/Versatile Blend': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 495 (on d3d11)
    Shader error in 'Lux URP/Transmission': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 519 (on d3d11)
    Shader error in 'Lux URP/Terrain/Lit (Base Pass)': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at
    Shader error in 'Lux URP/Terrain/Mesh Terrain': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 225 (on d3d11)
    Shader error in 'Lux URP/Lit Extended': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at Inputs.hlsl(182) (on d3d11)
    Shader error in 'Lux URP/Vegetation/Grass TextureDisplace': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 651 (on d3d11)
    Shader error in 'Lux URP/Lit Extended Uber': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at Inputs.hlsl(182) (on d3d11)
    Shader error in 'Lux URP/Lit Extended Uber': 'InitializeStandardLitSurfaceDataUber': output parameter 'outSurfaceData' not completely initialized at Inputs.hlsl(205) (on d3d11)
    Shader error in 'Lux URP/Cloth': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 547 (on d3d11)
    Shader error in 'Lux URP/Vegetation/Foliage': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 527 (on d3d11)
    Shader error in 'Lux URP/Vegetation/Foliage Debug': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 550 (on d3d11)
    Shader error in 'Lux URP/Clear Coat': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 520 (on d3d11)
    Shader error in 'Lux URP/Projection/Top Down': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 613 (on d3d11)
    Shader error in 'Lux URP/Vegetation/Grass': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 574 (on d3d11)
    Shader error in 'Lux URP/Flat Shaded': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 539 (on d3d11)
    Shader error in 'Lux URP/Terrain/Blend': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 529 (on d3d11)
    Shader error in 'Lux URP/Toon HLSL': 'InitializeStandardLitSurfaceData': output parameter 'outSurfaceData' not completely initialized at line 638 (on d3d11)



    I'm not sure what to do. I already removed URP and reimported it, then imported Lux Essentials but the error and failed compilations are always the same. Any idea how to solve this?
     
    IS_Twyker likes this.
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    you have to install the urp 10.3.2. support package (you will find it in the lux urp essentials folder).
     
  11. betaFlux

    betaFlux

    Joined:
    Jan 7, 2013
    Posts:
    112
    Thanks Lars, problem solved!
     
  12. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi lars, do you plan to make an eye shader for Lux URP? There doesn't seem to be a simple and decent eye shader for URP right now on the store.
     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i have no plan right now, but may add it to the list.
     
    Harekelas likes this.
  14. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Looking forward to it :)
     
  15. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    585
    @larsbertram1 Personally, you prefer Unity 2021 Alpha / Beta because you're working so close along with Unity's development of URP, correct?

    So if we want to use the fastest / most modern UPR / URP essentials features, we should use Unity 2021, correct?

    Or do you think URP is already quite completed, and people should use Unity 2020 LTS + Lux URP Essentials + URP 10?
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    unity 2021.2 and urp 12 will bring a lot of changes: deferred, enlighten, forward+, light cookies, ...
    so choose urp based upon your needs, target platform and time frame.
     
    OfficialHermie likes this.
  17. gasppol

    gasppol

    Joined:
    Feb 16, 2020
    Posts:
    33
    Using URP 12 (unity 2021.2) the only "big" error I've found was in Lit Extended shader, when calling for LiteweightFragmentPBR function in the shader, the function now is renamed as UniversalFragmentPBR.
    The rest seems ok.
     
  18. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    oh, lux urp essentials currently do not support urp 12. some things work, some do not.
    and upr 12 is evolving so fast that it does not make much sense to publish a package – even as preview.
     
  19. gasppol

    gasppol

    Joined:
    Feb 16, 2020
    Posts:
    33
    Oh yes, I was aware of that. URP12 feels like a tremendous leap, but in the right direction.
    When URP12 come out of beta you will support it?
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i will do my best.
     
    chelnok and gasppol like this.
  21. FelDagaroth

    FelDagaroth

    Joined:
    Jun 23, 2021
    Posts:
    8
    I'm using 2021.1.11f1, URP 11, I've installed the URP 11 package inside the Lux folder, and I still only get pink textures. Any guidance would be awesome!
     
  22. FelDagaroth

    FelDagaroth

    Joined:
    Jun 23, 2021
    Posts:
    8
    Fixed it! In my project settings, I noticed the Renderer asset was missing and none were available. Turns out I needed to actually create the URP asset manually by going to ASSETS ---> CREATE ---> RENDERER ---> URP ---> Pipeline asset

    Worked like magic!
     
  23. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    :)
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    you will have to edit the shader and add the code to the vertex shaders (forward, shadow, depth and depth normal passes).
     
  26. nopogo

    nopogo

    Joined:
    Sep 9, 2012
    Posts:
    25
    Hello, I am trying to get the decals from this package to show up on transparent materials. Is this possible, and if so, could there be a step I am missing?
     
  27. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    only if the transparent materials write to depth which they usually do not.
    if you make transparents write to depth you have to make sure that the decals are rendered afterwards.
     
  28. nopogo

    nopogo

    Joined:
    Sep 9, 2012
    Posts:
    25

    So I use Lux URP/Glass with zwrite on and write to Transparent 3000

    I then use Lux URP?Projection/Decal Unlit with render queue 4000 (Transparent+1000)

    Would that be enough in theory?
     
  29. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    transparent + 1 would be enough.
    transparent + 1000 might already be ui or something.
     
  30. nopogo

    nopogo

    Joined:
    Sep 9, 2012
    Posts:
    25
    Except that it is not working
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    have you checked the water in the demo scene?
     
  32. kakelastudios

    kakelastudios

    Joined:
    Jun 3, 2021
    Posts:
    2
    Hi @larsbertram1.
    I'm Atsuo. Can't really change the name on this forum. Sorry for inconvinience.

    Thanks for making URP shaders. They helped me a lot.
    But I found an issue about alpha cutoff in hair shader. Cutoff results are different between Win and Mac.

    On Windows, Alpha Cutoff 0 looks fine. Alpha still works.
    win.jpg

    On Mac, Alpha Cutoff 0 looks not working. Alpha is ignored.
    MAC.png

    Unity 2020.3.11f1

    Win:
    Windows 10
    AMD Ryzen 5950X
    128GB RAM
    Geforce RTX 3080 Ti 12GB

    Mac:
    MacBook Pro (16-inch, 2019)
    2.3GHz 8 core intel core i9
    32GB RAM
    AMD Radeon Pro 5500M 8GB

    Could you check this issue please?
     
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi atsuo,

    cutoff = 0 should show the entire quad here.

    this is how it should look like.

    anyway: it should work on both- unless you have messed up something with the materials.
     
  34. kakelastudios

    kakelastudios

    Joined:
    Jun 3, 2021
    Posts:
    2
    Thanks for your reply, @larsbertram1.

    I'll look into a material that I use for hair.

    Atsuo
     
  35. brunomolteni90

    brunomolteni90

    Joined:
    Apr 21, 2018
    Posts:
    1
    hi there @larsbertram1 I bought the extension and I've been trying a bunch of stuff to get decals to work on top of "Lux URP/Glass" but I can't seem to make it work, I followed every step of the documentation, I have depth texture enabled, installed URP 10.3 package and it still doesnt work...

    Do I need to mess with the render queue or the stencil buffer, If I just assign a default glass material ? otherwise could you provide a simple project with a decal projecting onto a glass material?

    thanks!
     
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    oh, my fault: even if the glass material writes to the depth buffer - it will never land in the camera depth texture which only contains opaque geometry.
    i made a quick test in the "decal demo" scene and somehow managed to make the decal show up on top of he glass.
    in order to make it work:
    • you have to assign a 2nd material to the glass object only writing to depth using the opaque pass. use the material "M Lux URP Depth Only" e.g.
    • make sure the decal you want to project on top of the glass renders after the glass. so set the render queue of the decal projector to 3001. glass uses 3000 by default.
    below you can see the result as well as the 2 materials being assigned to the sphere.
    the "depth only" material may occlude other opaque renderers, so you would have to tweak its render queue as well and set it to "alphatest" + something to make grass e.g. being properly rendered which uses "alphatest".

    glassDecals.PNG
     
  37. gasppol

    gasppol

    Joined:
    Feb 16, 2020
    Posts:
    33
    @larsbertram1 sorry to be "that" guy, but here is my problem:
    I've being using LUX URP on Unity 2020, 2021.1 and 2021.2. When the scene contains a Volumetric FXs (like Volumetric Box material) it hangs up entirely. However, it's matter of luck: I will guess around the 5% of the time.
    It hangs up the editor (nothing responds, a check on the Task Managers shows the Unity.exe running the game is "nonresponding") and when building the player, also happens. Only solution then is to close it completely.

    My scene is as follows: I've a "Fog" based on the Volumetric Box FX material of your own examples, on a GameObject. It's shown only on certain scenarios, for short periods of times (i.e.: when changing the camera view). So, the GameObject is SetActive(false) most of the time. When the games is in the specific scenarios when the fog it's shown, sometimes -just sometimes- everything hangs up.
    It occurs when the Fog (Volumetric Box) it's on screen. NEVER when it's disabled or offscreen.

    Did you have any guess?? Thanks in advance.
     
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    sorry, no. it works just fine for me. even on my 8 years old mac book pro laptop.
     
  39. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    sorry, i can't. you just have to make the shader oick up the data generated by the compute shader. this is not related to the skin shader at all.
    but why don't you simply use a skinned mesh? it also compute. and you have a well defined pipeline here.
     
  41. gasppol

    gasppol

    Joined:
    Feb 16, 2020
    Posts:
    33
    I can confirm, LUX URP it's not the problem. Thanks anyway.
     
  42. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi, if I want to add alpha clipping feature to the skin shader, where should I look into?
     
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    you have to go through all passes (depth, shadows, forward,...), sample some texture and add a clip command.
    you also have to decalre a threshold property in the shader properties and the cbuffer.
     
  44. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    I know how to add a sample texture and declaring a threshold in properties.
    But don't really know how to apply them in each pass. Where should I insert my code in the skin shader's passes and how do I add a clip command?
    I'm very new to shaders...sorry for any inconvenience
     
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    depending on which texture stores opacity you first sample this texture like:
    half4 albedoAlpha = SAMPLE_TEXTURE2D(_Texture, texture_sampler, uv);
    clip(albedoAlpha.a - _YourThreshold);
    you can also look into using one of the predefined macros.
    or use the shader graph version of the skin shader.
     
  46. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    ok, thanks, I'll try this.
    BTW, where is the shader graph version of the skin shader? I'd like to try add the alpha clipping in shader graph, too.
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    if you open the custom shader graphs demo there should be 2 heads. one of them uses it.
     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi there,

    i just want to let you know that right now i am uploading the preview package for URP 12 and Unity 2021.2.0b4.
    i am not sure if this is a wise decision as things most likely will break with the next beta. anyway.
    the preview package only contains some cherry picked shaders updated as it is just so much work to do...
    you will find details here: https://docs.google.com/document/d/...YUW9OsGL0niCL0MlY/edit#heading=h.6zvjnfuiskj1

    the update should be available within the next 2 days i think.

    funny thing: a blog post from April 16, 2019 where Unity claims that LWRP is now out of preview and production-ready.
    since then i have tweaked and rewritten the shaders 3 or 4 times? well, production ready in unity's sense means: shader graph shaders will be updated properly... time to change my profile image and turn it pink.

    urp12preview.PNG
     
    chelnok, lilacsky824 and MP-ul like this.
  49. MP-ul

    MP-ul

    Joined:
    Jan 25, 2014
    Posts:
    230
    Yup when you change it I will follow too xD
     
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    for those who want to try URP 12: the preview package is now available.
     
    lilacsky824, osss and MP-ul like this.