Shadows only visible from up-close

Hi,

Sorry if it is a silly one but here it goes.

I have a spotlight with shadow type as “Hard Shadows” but the shadows and only visible to me when zoom-in a lot. The same happens for soft shadows as well.
Cast and Receive shadows is turned on for both, rocket and obstacles.
Below is the photo from distance. It should show shadow of an obstacle and Rocket but it is not visible.
unity%20-%203_Project_Boost%20-%20WebGL_%20_DX11%20on%20DX9%20GPU_%2008-03-2019%2002_48_58

Below is the same view zoomed in. Now, i am able to see the shadows of the rocket and the obstacle.
unity%20-%203_Project_Boost%20-%20WebGL_%20_DX11%20on%20DX9%20GPU_%2008-03-2019%2002_49_55

How can it be fixed or is it expected to be not visible?

Hi Dhruv,

Go to Edit > Project Settings > Quality and increase the shadow distance value. However, this will have an negative impact on the performance of your game, maybe not even noticable but still there.

For this reason, I would recommend to move the camera position closer to the “cave” and to zoom out with the other values.


Thanks Nina,

So, if the shadow caster is dynamic (like Rocket in this case) then the shadow receiver won’t show any shadow if the distance between receiver and camera is more than the shadow distance.
Now i have got some idea of how shadows work but the effect shadow mask with mixed lighting is not coming properly. I have made the obstacles and lights static.
See the effect of lighting on the vertical objects to the left and right of the rocket.
With realtime lighting :

with mixed lighting :
unity%20-%203_Project_Boost%20-%20WebGL_%20_DX11%20on%20DX9%20GPU_%2009-03-2019%2010_55_14

With mixed lighting, the lower part which is not lit on the left side object is because of the shadow mask of right side object but i am not able to understand why the light on upper part of left and right side objects which is lit, looks like sprayed and have bars. Shouldn’t the upper part of left object and of the right object have a continuous light looking the same way realtime light does?

Set the lighting mode to “Baked” for all lights that can be part of the texture. Lighting can be a bit tricky, so toy around with the modes until you achieve the desired result. Delete the lightmaps you do not need anymore and don’t forget to press “Generate Lighting” in Window > Rendering > Lighting whenever you change the lighting in your scene.

image


See also:

It might be worth you looking into picking up Wilmer Lins Unity Art and Lighting course which you should be able to find by looking for gamedevtv on udemy.
This will help massively with learning unity’s lighting system and there has been even more content added since i first looked at it :slight_smile:
Hope this helps

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms