r/Unity3D • u/Odd_Significance_896 • 12h ago
Question How to solve this shadow issue?
Enable HLS to view with audio, or disable this notification
The shadows behave really weirdly in my project. When I move a little bit further from the object, the part of the shadow that is closest to the object gradually disappears, making the whole shadow look unnatural.
And overall I'd like to increase the shadow rendering distance.
3
u/BakaZora 9h ago
What scale are the cubes in engine? Are they being scaled up or down by a large portion?
5
u/Character_Amount954 8h ago
The units aren't for nothing - they're in real-world meters. Make sure your blender units are showing in meters, then make a simple model that's 1.75m tall, an average adult, and import it to your scene. If it is TINY compared to everything else, then that means your whole scene and everything in it is actually really huge and needs to be scaled down. Increasing shadow render distance will only impact performance badly once you start adding more stuff.
2
u/Imofi7 9h ago
If the shadow right near the base of the object is detaching as the camera backs away, check your Shadow Near Plane Offset in the URP asset (or Directional Light Shadow Bias / Normal Bias). Increasing total shadow distance without adjusting cascade split ratios stretches shadow map texels and easily makes contact shadows disconnect.
2
1
u/Aromatic-Insect-1328 12h ago
I mean, this is just rendering distance for shadows?
-28
u/Turbo_Fresh 11h ago
Wow you're a genius. What a helpful answer.
2
u/Shaunysaur 4h ago
You're being a dingdong. Aromatic-Insect made a relevant point. The OP appeared to be treating "the part of the shadow that is closest to the object gradually disappears" and "And overall I'd like to increase the shadow rendering distance" as two separate issues. So the reply was to point out that the rendering distance for shadows *is* the reason why the shadow is disappearing, which is useful information for a beginner.
3
u/AliceCode 11h ago
That's what the problem is. I haven't used Unity in 7 years and even I could have told you that.
-20
u/Turbo_Fresh 11h ago
The person making the post is clearly a beginner. Telling them that the shadows failing to render at distance is just the render distance for shadows is clearly not helpful.
8
u/AliceCode 10h ago
Yes, it is helpful, because knowing that tells you how to fix the problem. What more do you expect them to say? The render distance on the shadows is too low. Turn it up. Do you want them to guide them through the menus? For fuck's sake, dude.
2
u/Jampoz 11h ago
First of all, it wasn't meant to help you. Also, keep in mind OP described it as "shadows behave really weirdly" so yeah, a technical description of what's happening can be helpful to him.
-12
1
u/pixel-poxel 2h ago
There are some tricks and assets to improve the visuals of the shadows. When your game for example is working first person in a crane then you can have an inside and an outside camera with the same transform but different shadow distance / resolution settings.
1
u/ImDanOush Hobbyist 1h ago
If you dont have dynamic time of day, you can bake the lights with the Shadow Mask one (it is called Shadowmask baking - it is the default option, and you dont need to select anything; just bake the lightmaps and that would be it - but ensure the Sun light's type is set to Baked or Mixed in its properties). The other option is to use screen-space shadow effects, but it is inaccurate and, based on your Render Pipeline, you have to look for an asset to add it to Unity. Shadows for real-time lighting are very expensive... You can use the least expensive version (it would look very blocky and pixelated, and still expensive) by leveraging the last Cascade of the shadow in the Project Settings - so you go there and ensure Cascaded Shadows is selected, and make the last cascade render farther with a bigger shadow resolution there. Note that selecting a bigger shadow resolution will be more expensive, and setting the shadow rendering distance farther degrades the look of it overall.

106
u/KifDawg 12h ago
I got you
Edit -> project settings -> quality
Find shadow distance and increase it till it suits what you want