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

    raidzhi

    Joined:
    Jan 13, 2016
    Posts:
    32
    yeah! they are use different features.
    this below is the "stupid" decal's shader in frame debug:
    stupid.jpg

    And this below is decal lit:
    decal-lit.png

    the different feature is _NORMALMAP_
     
  2. raidzhi

    raidzhi

    Joined:
    Jan 13, 2016
    Posts:
    32
    YEAH! the problem is mormal map. when i enable the normal map on other decal,they become black.
    when I turn off the normal map on "stupid" decal ,it got colors.
    Screenshot_20191211-014201_LuxLWRPEssentials.jpg
     
  3. raidzhi

    raidzhi

    Joined:
    Jan 13, 2016
    Posts:
    32
    Even I enable the mask, it still correct(or not correct but better). emm, without normal map.
    Screenshot_20191211-014918_LuxLWRPEssentials.jpg
     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    there is already.
     
    Quast likes this.
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hmm, it looks as if i have forgotten to wrap the unpack-macro.

    so you can try to edit the shader and find:
    half3 normalTS = UnpackNormalScale( SAMPLE_TEXTURE2D(_BumpMap, sampler_BumpMap, texUV), _BumpScale);
    and replace it with:
    #if BUMP_SCALE_NOT_SUPPORTED
    half3 normalTS = UnpackNormal( SAMPLE_TEXTURE2D(_BumpMap, sampler_BumpMap, texUV);
    #else
    half3 normalTS = UnpackNormalScale( SAMPLE_TEXTURE2D(_BumpMap, sampler_BumpMap, texUV), _BumpScale);
    #endif


    this should fix the normal issue. maybe it also solves the other issues...
     
  6. raidzhi

    raidzhi

    Joined:
    Jan 13, 2016
    Posts:
    32
    yes, mobile not support normal scale. and you forgot.
     
  7. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    560
    Thank you.
     
  8. raidzhi

    raidzhi

    Joined:
    Jan 13, 2016
    Posts:
    32
    and with this warning in shader:
    Use of UNITY_MATRIX_MV is detected. To transform a vertex into view space, consider using UnityObjectToViewPos for better performance.
     
  9. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    you may ignore the warning.
     
  10. raidzhi

    raidzhi

    Joined:
    Jan 13, 2016
    Posts:
    32
    After modify the shader like this below:
    Code (CSharp):
    1.  
    2.                 half3 normalTS = 0.0f;
    3. #if BUMP_SCALE_NOT_SUPPORTED
    4.                     normalTS = UnpackNormal(SAMPLE_TEXTURE2D(_BumpMap, sampler_BumpMap, texUV));
    5. #else
    6.                     normalTS = UnpackNormalScale(SAMPLE_TEXTURE2D(_BumpMap, sampler_BumpMap, texUV), _BumpScale);
    7. #endif
    8.  
    I still get dark decall like before. even I comment the UnpackNormalScale code.
     
    Last edited: Dec 10, 2019
  11. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    have you checked the texture import settings of the normal?
    apart from this lwrp for 2019.2 has a lot of bugs. so it might be a good idea to downgrade to 2019.1 or upgrade to 2019.3.
     
  12. raidzhi

    raidzhi

    Joined:
    Jan 13, 2016
    Posts:
    32
    I already checked. I will test in 2019.3
     
  13. raidzhi

    raidzhi

    Joined:
    Jan 13, 2016
    Posts:
    32
    I tested on 2019.3 with ogles 3 and vulkan. same result.
     
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    damn. of course you would have to adjust the normal mapping here as well.
    but if "sample normal" is unchecked you should get at least some basic lighting.
     
  15. raidzhi

    raidzhi

    Joined:
    Jan 13, 2016
    Posts:
    32
    yes,uncheck the normal,will get some basic lighting , but I must move on to other work. I'm counting on you.
     
    Last edited: Dec 11, 2019
  16. manmantas

    manmantas

    Joined:
    Mar 24, 2018
    Posts:
    2
    Hey. I'm trying to make a skin shader with transparency to hide body parts that are under clothing, using a texture stencil.But when I use alpha the object doesn't self shadow and it newer goes completely opaque.
    Is there a way to do this using the shader graph? upload_2019-12-11_14-53-4.png upload_2019-12-11_14-53-30.png
     
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    transparents do not cast shadows.
    you should use alpha testing instead of alpha blending.
     
  18. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    @osss what was the problem?
    "grass displacement doesn't work in 2019.3f3"
     
  19. osss

    osss

    Joined:
    Jan 20, 2014
    Posts:
    27
    it works fine:)
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    turned out to be a precision problem and actually mobile needs the normalize i commented.
    so it should be (around line 345):
    inputData.normalWS = normalize( cross( ddy(wpos), ddx(wpos) ) );
     
  22. raidzhi

    raidzhi

    Joined:
    Jan 13, 2016
    Posts:
    32
    Yes! You made it!!! It's work on my devices.
     
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    simple volumetrics are coming:

    volumetrics.jpg
     
    ChinChiaYeh, transat, doarp and 5 others like this.
  24. Sholms

    Sholms

    Joined:
    Nov 15, 2014
    Posts:
    85
  25. larsbertram1

    larsbertram1

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

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    version 1.31 is available

    ### Fixed:
    - Decal, Terrain shader: UnpackNormalScale wrapped properly (mobile).
    - Decal Lit shader: Normals fixed for mobile (caused by half precision).

    ### Added:
    - Decal Lit shader: Fade between scene geometry's normal and projected decal normal.
    - Volumetric shaders added: Light beam, box and sphere volume.

    ### Changed:
    - URP: Changed to version 7.1.6
     
    osss, Quast and XthemeCore like this.
  27. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    560
    Thank you for the new update and new feature.
    I have question. Could you make tiling patterns shader ?
    Something prevent the repeat patterns on terrain.
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    there is already a shader graph node which implements this: procedural stochastic sampling.
     
    Quast likes this.
  29. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    560
    OK. I will try that.
    Thank you.

    Update:
    After I tried it...Please make your own shader. I think you can make more better and simple than this one.
    After I followed setup steps, the shaderGraph in my project crashed and I could not fix it. Thanks God that I back-up before. I don't know what you working at but put this in your list please.
    Thank you.
     
    Last edited: Dec 20, 2019
  30. originalemanuel2

    originalemanuel2

    Joined:
    Mar 4, 2015
    Posts:
    21
    When will there be support for the URP? I just downloaded the latest version and none of the shaders are working. They are all pink. Trying to covert them results in error messages.
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    you have to import the urp package.
     
  32. originalemanuel2

    originalemanuel2

    Joined:
    Mar 4, 2015
    Posts:
    21
    Thanks!
     
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    ## Version 1.32 is available:

    ### Changed:
    - Lux LWRP Extended Lit Parallax shader: renamed to Uber

    ### Added:
    - Lux LWRP Extended Lit Uber shader:
    - - Support for bent normals added.
    - - Horizon Occlusion added.
    - - Geometric Specular Anti Aliasing added.
    - - GI to AO added.
     
    Quast and osss like this.
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    and here is an overview of the improvements regarding specular lighting such as geometric specular anti aliasing, simple bent normals, horizon occlusion and GI to specular ambient occlusion:

    LuxLWRP_Specular.gif
     
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    looking into a heavily zelda inspired scene setup i added some tweaks to the shaders like stabilizing the rim light effect and introducing a shadow bias to the toon effect.

    zelda01.jpg
     
  36. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Couple questions.
    Has anyone using this you know of had success rendering decent size outdoor nature type scenes in oculus quest using unity 2019?
    Also can the terrain or mesh terrain shader use a global colormap with the 4 texture splatmap to increase the look desired on the terrains?

    Really wanting this to work for quest so I can create some decent size nature scenes. I know there's limitations but if this can do a great job the rest is all trickery like most things in large scale 3d environment worlds.
     
  37. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    @larsbertram1 , is it possible to do real-time tinting for terrain textures with the terrain shader?
     
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i think so. why not?
    either use material properties or global colors and change them using script.
     
  39. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    @larsbertram1

    hello,
    can you provide speedtree 7 URP shader with Environment Redlections and receive shadows option?
    thanks.
     
    Last edited: Jan 1, 2020
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    Version 1.33 is available
    ### Added:
    - Toon Lighting: Directional and additional shadow bias added which lets you control the shadow strength and create Zelda like lighting.
    ### Changed:
    - Toon Lighting: Stabilized rim lighting.
     
    osss and Quast like this.
  41. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i haven't used any speed tree for months. and 7 is a bit outdated. so maybe but no eta.
     
  42. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    will u be renaming the pack to "lux URP essentials"
    since what ive heard LWRP will not be supported in later releases(or am i wrong?) so only URP
     
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    some day, yes.
     
  44. LBPToo

    LBPToo

    Joined:
    Dec 20, 2018
    Posts:
    17
    Hi. I have Lux LWRP Essentials that I'm using with Unity 2019.2.15f1. I am using the Tree Creator Leaves and Tree Creator Bark(std and optimized) shaders on my trees, which work perfectly, but I need to adjust the transparency in-game and due to my total lack of knowledge of shader development I cannot figure out how to achieve this with these shaders. I have fader code that works with standard shaders I used before switching to LWRP and now I want to modify that to work in LWRP with your shaders. Thanks.
     
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i guess you are talking about something like fading out a tree if the camera gets close.
    well, that is a bit tricky – especially on the bark because this shader regularly is an opaque shader. fading it out would need you to make it use alpha testing first.
    but alpha tested shaders are more expensive than opaque shades because you will loose early depth testing on the gpu. so if your trees where single game objects you could swap prefabs if the camera was near.
    if you placed your trees using the terrain engine... you will have to pay the price for all trees at all distances.

    so first of all: how does your scene look?
     
  46. LBPToo

    LBPToo

    Joined:
    Dec 20, 2018
    Posts:
    17
    Hi, thanks for the fast reply. Your assumption about fading the tree when it is between the camera(3rd person) and player is correct. All trees are dynamically generated from prefabs so they are individual game objects so swapping is an option...maybe. I tried just turning off the material when the player is blocked, which worked well, but then the player can run into the tree when it's invisible because there's nothing to see, which is not acceptable. Would drawing an outline around the bark and leaves be possible and be a performant way to solve this issue. This may be acceptable in game play though I'd have to try it. FYI, I also tried using the Lit shader on the bark but when varying transparency it is never fully opaque. It seems to stay at about 50% transparency even when alpha is 1.
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    :)
    it would needed 2 materials (stencil write + outline). but the provided outline shader does not support any vertex animation like the tree creator shaders do.
    no idea regarding this. but you do not really want to use a transparent shader: this would give you some kind of x-ray style on the trunk as faces in the background would not be occluded properly.
    the way to go i think is alpha testing and stippling out the trunk.

    upcoming version 1.34 will add this feature to the Lux Uber shader. so you may look it up there and add it to a copy of the leaf and bark shader. then simply swap out the tree prefabs with a prefab which uses the camera fade enabled shaders when the player gets closed.
    actually the leaf shader already uses alpha testing. so it will not suffer much from enabling camera fading (just some more math) while the bark shader originally is an opaque shader. you may do some performance tests only using the camera fade variant: if the trunks do not cover a lot of screen space it might not be worth swapping the prefabs.


    Lux Uber – Camera fade
    Geometry gets stippled out while the camera approaches. Shadows may stipple out as well although this looks pretty odd in case you do not use 4 cascades and a rather high res shadow map.
    The fade value is calculated per pixel so details further away are still opaque.

    camera_fade.PNG
     
  48. LBPToo

    LBPToo

    Joined:
    Dec 20, 2018
    Posts:
    17
    Thanks for all the feedback. I will wait for the next update and try that out. You'll likely hear from me again as I try to implement it. :)
     
  49. frostymm

    frostymm

    Joined:
    Jun 21, 2013
    Posts:
    34
    Howdy, two things, first that alpha tested outline shader doesn't seem to do anything with the texture input and it doesn't render anything if the alpha cutoff isn't zero. Dunno if I'm just using that wrong or what.

    More importantly though, I copied the settings in the demo for the outlined spheres and applied them to my character but no matter how I fiddle with the settings, the texture is super bright and it's hard to make out the details on it:

    upload_2020-1-6_1-0-16.png

    I'm on unity 2019.2.16 and I've tried disabling all the lighting too.

    Any ideas as to how to fix this would be much appreciated!
     

    Attached Files:

  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hmm, i can not reproduce this.
    i checked it in 2019.1.3.f1 as 2019.2. was too buggy last time a had a look into it.

    left sphere: bulit in lit, right sphere: lux lit extended.
    i can not spot any difference... (color space: linear, built target: pc)

    lit_extended.PNG

    the shader works perfectly for me:
    here it uses the texture "T DryGrass AA". maybe the alpha channel of your texture is incorrect?

    outline01.PNG