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

URP Point Light Shadows

Discussion in 'Universal Render Pipeline' started by abi17124, May 3, 2020.

  1. spvn

    spvn

    Joined:
    Dec 10, 2013
    Posts:
    80
    Is anybody from Unity able to confirm if point light shadows will be ported to the 2020 LTS in the future?
     
  2. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,237
    I think it's safe to assume it won't be. Backports generally only concern critical fixes, not new features unfortunately.
     
  3. ScetticoBlu

    ScetticoBlu

    Joined:
    Nov 26, 2020
    Posts:
    18
    Can someone confirm? I think I'm in the same boat as @leslviv was. I'm in 2019.4, updated to urp. Found out that realtime pointlights shadows are not supported and now I'm thinking to move into 2021
     
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It won't be backported. It's a new feature. New features aren't backported because of how many bugs they might cause to existing projects.
     
  5. yarsrvenge

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    87
    Just thinking outside the box here, but since spot lights can do shadows, can you simply put two spot lights at 180 back to back? I just did this very quickly in URP (2020) and it "seems" to work...It might not be performant enough depending on how you are using the lights.
     
  6. yarsrvenge

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    87
    After looking at it closer, because the spot only goes to 179, you will never get a clean sphere shape to the light and will have a gap. <sigh> I was hoping to find a workaround because I really need to move to URP but without point light shadows its a bust.
     
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You will also get really distorted shadows from it. The best bet is using cookies, particularly cubemap cookies, but regular ones work fine too (or just a shadowmask that's prebaked - I have no idea why Unity wouldn't prioritise these as they're close to free - just a projection and texture read).
     
  8. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    Doom 3 had light cookies in 2004... way to go, URP team!
     
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That's slightly below the belt :D
     
    NotaNaN likes this.
  10. yarsrvenge

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    87
    Yea, I noticed the shadow distortions also and wondered what that was about. URP doesn't support cookies yet but I think that's what you were saying.
     
  11. leslviv

    leslviv

    Joined:
    Jun 22, 2019
    Posts:
    32
    upload_2021-2-19_19-19-13.png
    Confirmed no back-porting
    The road to 2021 - Q&A

    Try your projects in 2021 - I have no regrets upgrading. It's beta7 already.

    Also, Forward+ Renderer Support & Deferred Renderer Support coming... Dunno when though :)
    Currently only 8 lights per object allowed simultaneously with Forward Renderer
     

    Attached Files:

  12. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    I'm a little late to the party here... but WHAT?? No shadows??
    No realtime?
    I'm flummoxed.
     
  13. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    I'm not sure what to do...
    Do I want shadows? Or do I want Shader Graph?
    I can't have both?
     
  14. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    648
    Why no Shader Graph? Im just passing through and wondering what I dont know. Thanks!
     
  15. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    Oh, because in order to have Sharder Graph you need URP. And if you want shadows on point lights, no URP.
     
  16. bunnybreaker

    bunnybreaker

    Joined:
    Dec 10, 2013
    Posts:
    23
    I found this thread having basically the same issue. Decided to go with 2019 LTS, cuz you know, LONG TERM SUPPORT. Using SRP because I want to use VFX graph, but now I can't have point light shadows. Guess I'll try 2021, but that's literally not suitable for production according to Unity themselves.

    So, to get the most fully featured, stable version of Unity, what are we supposed to use? 2019 LTS with HDRP?
     
    HeyBishop likes this.
  17. n8burba

    n8burba

    Joined:
    Feb 4, 2013
    Posts:
    12
    Yes! Please.
     
  18. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    340
    Whats the status on that? Should we upgrade to 2021 ? We're in production and it really feels like Unity is falling apart. Basic basic basic features missing, lts updates bringing unexplainable artefacts, this is extremely frustrating.

    Does 2021 support point light shadows?

    Is deffered available for URP?
     
  19. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,288
    URP11 supports the shadows, i have tested it extensively in my URP volumetric lighting system and the shader libraries also work great in this regard. So any Unity version that has URP11 and above should do.

    Not sure on deferred.
     
    leslviv likes this.
  20. Bosozuki

    Bosozuki

    Joined:
    Dec 19, 2013
    Posts:
    63
    The latest version of 2021.2.0a14 has deferred as an option for URP.
     
    leslviv, defunct_artist and nasos_333 like this.
  21. defunct_artist

    defunct_artist

    Joined:
    Jun 6, 2019
    Posts:
    3
    What's really sad and eye opening is researching any equivalent feature in Unreal Engine and seeing it is already a built in and free...
     
  22. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    469
    You can use deferred in 2021.1 by making scripting define ENABLE_RENDERING_PATH_UI
     
  23. niuage

    niuage

    Joined:
    Nov 17, 2019
    Posts:
    122
    Can you control the range of the point lights in any URP version?
     
  24. MarcelArioli

    MarcelArioli

    Joined:
    May 31, 2014
    Posts:
    28
    hi all, different question : now that point light shadows work in unity 2021.1+ , has anyone successfully implemented a point light that enlightens entities in a subscene ? (with shadows)
     
  25. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    851
    You need to use deferred, with 2021.2(afaik), there are errors with 2021.2b10+ and there was also an announcement that dots will not support 2021 until 2022.
     
    MarcelArioli likes this.
  26. HenryTownshend

    HenryTownshend

    Joined:
    Jun 19, 2017
    Posts:
    14
    How is this even remotely "under the belt"? It is simply reality. URP is far from anywhere production ready. It is a cruel joke on those who looked forward using it. Users that do not only do stylized games are just left alone in the dark, but not in the shadows (haha! get it ?? :p ) .

    I would laugh if choosing URP for my current project using 2019.4.x LTS(!) was not the most regretful decision. No cookies, no point light shadows, nontransparent behaviors everywhere. Using Spotlights at wide angles to compensate ??? Seeing their users do stuff like this should make the devs feel sad. This is the reason why Unity will go downhill on anyone trying to do serious graphical 3d stuff in it, while developing for lower end. Shipping a pipeline that lacks the most basic features is unacceptable. Even more so keeping it that way for years after release.

    The whole state of the engine has become more and more unacceptable. Want a Simple Lit Shadergraph? Well, buy an Asset! Want to be able to have Shaded Wireframe and other Debug Views back? -> Buy an Asset. Want a decent Game Engine without googling half the day frustrated about why XYZ is missing or half assed? Don't want to spend your days in Package Manager Hell? -> Switch to another engine. That is basically all there is left to do, if one faces production realities and value. At least from a 3d game developers or 3d artists perspective.

    Sick of people defending Unity as if it were some kind of "your lord highness whom you dare not to criticize". Most legit and spot on, harsh reality crit about Unity is always claimed to be "too far", "unconstructive" or in this case "under the belt". Unity users are like children defending their parents who physically abuse them. And the people that stand up and point out unbelievable realities, are getting roll eyes or even mobbed. What a mess Unity is in all regards, not only the tech, but also its community. No offense personally. But this comment was really unnecessary, especially because the previous commentor was "Spot" on :D
     
    GubaLord and unnanego like this.
  27. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I'm amazed you found my joke profound enough (without knowing how much I criticise unity) to write all that. I hope it helps get it off your chest.

    On a serious note: It's entirely none of your business nor will it ever be your responsibility to comment on how other people use or rate Unity. That's just overstepping the bounds of conduct on these forums. You can however, comment from your own perspective. Just it's really none of your business what others do.

    In any case, you and many others have issues with Unity, and that's something Unity has to solve, if they want to serve their customers well.
     
    unnanego likes this.
  28. HenryTownshend

    HenryTownshend

    Joined:
    Jun 19, 2017
    Posts:
    14
    ---Agreed on this:

    Wanted to get it off my chest. I read a lot around the forums since I got frustrated about Unitys state, since about when the render pipeline split occurred. Probably, subconsciously, hoping to find solutions. But also out of interest in how devs react to the issues and to check their priorities, to be able to estimate how feasible it is for me to stick with Unity.

    I always suppressed my urge to comment on anything, no matter how frustrated I was since the last 4 years using Unity privately, and professionally.

    Your "joke" admittedly triggered me, and it bursted out of me. As I said. No offense personally. I know you are not shy to criticize Unity, but you also defend it, afair, also URP. So basically, I think I get what was supposed to be a joke, but for me, the problem is that it bagatalizes the serious frustration Unity users currently suffer.

    Making jokes like this about it in a thread like this takes out the seriousness and let it seem as if we (I just name them fellow Unity victims, like the previous Doom 2004 commentor) would not have to suffer from the devs' prioritization issues. That's what triggered me

    Even if it was meant to be a joke, it seemed (to me) as if you tried to cut Unity some slack here.

    ---But not agreed to this:

    I am not sure if it is not anyone's business as a User of the same software to speak about how others defend the flaws of the software and thereby harm its priorities and progression.

    Exactly this, imo, is part of the problem why we are in this mess. Unity basically has, through aggressive and intensive marketing, successfully created users that defend the product, no matter what the realities currently are. These users tend to attack Unity critics religiously.

    May it be that you are not one of them, but in my defense, I saw the same pattern here, albeit somewhat subtly and implicitly knitted into a joke. It's not a laughing matter for people working in production (not claiming that you don't).

    It does not help any software if users don't clearly and seriously point out what is wrong with it, or even deal breaking in its current state.

    Defending issues in a paid software that by design causes issues in production is toxic. For both, the devs and the users, which is also me.

    So, I am indeed affected by how others use or rate Unity, so it is also somewhat "my business", if I am honest.

    It is irritating for me to see you patronizing me so vehemently, in a slightly threatening tone.

    To me, it is part of the issue that few really go on and say how unacceptable URP really is, still (and many other parts of the engine).

    It is part of the issue that there are users who defend Unity by claiming that "we should cut them some slack", while the people battling in production realities are screwed when choosing their already tagged as production ready tech.

    It was not the users decision to split render pipelines, nor to split the engine into countless packages.

    In a community, I find it odd that it is considered overstepping the bounds of conduct to talk about how fellow users rate and see the serious issues of the engine.

    So basically, we never should criticize the way other users bagatalize or even glorify issues, we should just quietly take note off people less affected by the issues stating that the engine is still free up to 100k, and we now have a dark theme for free... and should be thankful for that.

    What this translates for me to is:
    I get my mouth shut on an official Unity forum after my very first complaining comment about the way other users intensify the issues by acting as if they would not be severe. That is seemingly not in my right to do.

    I did not really expect much else as reaction to my comment. Partly because I let off some steam, but partly also, because I could already see the implicit conduct warning coming.

    It fits the perception I already have of these forums, as even the devs interacting here are sometimes patronizing and don't take the (legitimate)cries of their user base seriously enough.

    If I would still be a passionate Unity user anymore, this might affect me, but as someone counting the days to switch to another engine, at least for private projects (at work, unfortunately I can't) I don't really care anymore.

    So thank you for your first statement and understanding. It definitely helped.

    I think the point where advanced 3d users and devs are willing to wait until Unity serves them well should be passed.
     
    spvn and hippocoder like this.
  29. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I think the nature of text means we are easily able to misunderstand each other's real intentions. For example I see a lot of people argue with each other when really they just need to be given support on their own projects from their own perspectives. I gave a blanket statement about conduct on forums, rather than try to guess your real intentions, and even that can be taken the wrong way.

    As always I really do recommend people give their own use-cases and their own point of view without dragging other people into it. If our own use-cases aren't enough for Unity to take note of, that's Unity's problem and failure to address.

    Honestly: you should post more about what affects your project and how Unity could fix that, it's helpful and influential. But please try not to mention any individuals or how they behave, because that is an unsolvable problem for forum conduct, and it's not even your fault - just how it is with text.
     
    HenryTownshend likes this.
  30. mynameisshape

    mynameisshape

    Joined:
    Jun 30, 2018
    Posts:
    1
    I am using Unity 2019 LTS for the obvious reasons.

    I'm working on a project with a pretty large set of scenes that contain grids of terrain, meshes, gameobjects and behaviours. The player is able to move freely about the grid of scenes and each grid is dynamically placed in the proper spot, and the world is moved around as well, to prevent floating point math errors when moving too far from the origin point. In addition to this, the lighting setup changes over time (day/night system).

    Being unable to use dynamically-shadowed point lights has made it incredibly difficult to manage art design and has led me to utilize numerous stylizing techniques to draw attention away from the lack of detail, or SIMILITUDE, a lack of shadow-casting point lights can create in modern 2021. In addition, being unable to dynamically cull dynamic lighting based on occlusion or otherwise even simple distance, has forced me to utilize several jury-rigged methods to optimize my lighting setups to obtain reasonable performance.

    The solution to these issues that are affecting my project should be pretty apparent, and one of them has been rudely hashed out to death in this thread. Thank you very much for taking the time to read my post.
     
  31. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
    DebugLogError likes this.
  32. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    To be fair it's solvable in perhaps 4-8 hours of paid work, to your exact specifications. It doesn't need to be engine level, any half decent graphics programmer can add it to Unity in much less than a day. The problem is it's paid for because the skill level is high.
     
  33. illyriansky

    illyriansky

    Joined:
    Mar 5, 2021
    Posts:
    2
    It's frecking crazy how Unity created and released URP with literally no reason, missing important features and ruinning the ''normal'' Unity. It's like they are working hard to destroy their reputation, wich have never been the best btw
     
    Harinezumi likes this.
  34. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867
    SRP batcher is more than a good enough reason and the main reason my game is on mobile. I don't see why progress had to be so slow tho.
     
  35. Sky77

    Sky77

    Joined:
    Jan 30, 2014
    Posts:
    171
    It's actually the exact opposite.
    While progress on URP has been slow, Built-in is based on very old concepts and it's basically impossible to 'modernize' it.
    Starting from URP 12 the feature gap is minimal, but performance wise URP wins hands down. Using it now is a no brainer, expecially if you're working on low powered devices.
     
  36. Bovine

    Bovine

    Joined:
    Oct 13, 2010
    Posts:
    177
    For unlit this is still a good bit broken.

    I got somewhere by adding my own custom node to URP shadergraph to get the light 0 shadow attenuation. It works well but on the device unity strips the shader so I need to figure that out (for now told it not to strip unused).

    So I am getting a single point light shadow casting and am able to apply that in my shadergraph using the following node (may need some tweaks). Code adopted from the lighting.hlsl or possibly the shadows.hlsl from Unity.

    Code (CSharp):
    1. // returns 0.0 if position is in light's shadow
    2. // returns 1.0 if position is in light
    3. void Shadow_Attenuation_float(int lightIndex, float3 positionWS, float3 lightDirection, out float shadowAtten)
    4. {
    5. #if SHADERGRAPH_PREVIEW
    6.     shadowAtten = 1.0;
    7.     return;
    8. #endif
    9.  
    10.     ShadowSamplingData shadowSamplingData = GetAdditionalLightShadowSamplingData();
    11.  
    12.     half4 shadowParams = GetAdditionalLightShadowParams(lightIndex);
    13.  
    14.     int shadowSliceIndex = shadowParams.w;
    15.  
    16.     UNITY_BRANCH
    17.     if (shadowSliceIndex < 0)
    18.     {
    19.         shadowAtten = 1.0;
    20.         return;
    21.     }
    22.  
    23.     half isPointLight = shadowParams.z;
    24.  
    25.     UNITY_BRANCH
    26.     if (isPointLight)
    27.     {
    28.         // This is a point light, we have to find out which shadow slice to sample from
    29.         float cubemapFaceId = CubeMapFaceID(-lightDirection);
    30.         shadowSliceIndex += cubemapFaceId;
    31.     }
    32.  
    33. #if USE_STRUCTURED_BUFFER_FOR_LIGHT_DATA
    34.     float4 shadowCoord = mul(_AdditionalLightsWorldToShadow_SSBO[shadowSliceIndex], float4(positionWS, 1.0));
    35. #else
    36.     float4 shadowCoord = mul(_AdditionalLightsWorldToShadow[shadowSliceIndex], float4(positionWS, 1.0));
    37. #endif
    38.  
    39.     shadowAtten = SampleShadowmap(TEXTURE2D_ARGS(_AdditionalLightsShadowmapTexture, sampler_AdditionalLightsShadowmapTexture), shadowCoord, shadowSamplingData, shadowParams, true);
    40. }
    41.  
     
  37. KCGames47

    KCGames47

    Joined:
    Nov 3, 2014
    Posts:
    39
    just URP?
     
    Harinezumi likes this.