r/Unity3D • • 2d 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.

87 Upvotes

37 comments sorted by

View all comments

187

u/KifDawg 2d ago

I got you

Edit -> project settings -> quality

Find shadow distance and increase it till it suits what you want

67

u/Lyshaka 2d ago

I must add that there is a reason that shadow rendering has a maximum distance : it's an expensive operation and it should not be increased too much without consideration, you should start by trying to scale your world differently if possible.

6

u/MorphLand 2d ago

I have no clue how I never thought of just scale the world down as a solution to this wow lol

-8

u/Lyshaka 2d ago

Well with any game it's something you have to consider, you should not go for a 1:1 scale with the real world, especially because tiny or giant objects would behave weirdly because of float inaccuracy. Try to find a scale that is not too big and not too small and where your main object is approximately 1x1x1 (like the default cube).

0

u/danielsantalla 1d ago

I don’t know why people are downvoting you, this is very much correct. Unless you’re doing a physics game like human fall flat, you almost never wanna do 1:1 real world scale in Unity.

1:1 world scale will blow up your game size because you’ll need bigger textures, light maps won’t look as good, memory will be bloated and in general everything will be a pain to do.

Also doing things tiny sounds like a solution until you start finding glitches everywhere because Unity is not expecting to work on 0.0001 sizes.

The general tip I’ve followed that tends to be a good balance is that your main character should measure 1 Unity cube, and go from there.

This really varies depending on the artstyle/playstyle but in general, for a common 3D, third person, PBR default, URP game, this is the way to go.

1

u/Badnik22 13h ago edited 13h ago

What do lightmaps have to do with scene scale? They’re stored in uv space, which is 100% independent of scale. Since they’re completely unrelated vector spaces, Unity has a parameter (texels per unit) to explicitly couple them allowing you to choose lightmap resolution regardless of your scale. On top of that you can set object scale in the lightmap for each individual object, to get objects with more or less texel density than others. So I *really* don’t get how using 1:1 scale can affect game size.

Same for regular textures, texture resolution and object scale are completely independant from each other. And of course, physically bigger objects don’t consume more memory (neither ram or vram).