- Home /
Why do I only get shadows on 3 sides of my Scene?
So I have this game where you move inside this cube shaped arena. To make it easier to see where you are in the cube I wanted to cast a shadow on the wall so I have 6 directional lights alog the axes which cast a very clear shadow at exactly the right position. But for some reason this only works on 3 Sides of the Cube.
In this image the top side of the cube also has no shadow the other 2 sides have them just like the yellow wall. So it can't be because of opposite lights getting in each others way, as the opposite side of the yellow wall also has a shadoe and the opposite of the blue wall also doesn't.
All the lights have the same settings and have about the same distance from the walls. The arenas shadows are turned off (although that wouldn't make any difference because the light only ever hits it's sides from behind)
I dont know really, but, are you sure its a good idea to have 6 directional lights at same time?
No I'm not sure and I've been considering alternatives already (like raycasting out of the object and spawning my own indicators) but the shadows have some nice properties, that would be a lot of additional work in other implementations. for example the shadow is cast on every single object that doesn't throw a shadow itself so if there are obstacles in the arena the indicator is automatically shown on each. as well as having a natural feel to them
And even if I don't use the shadows I'd still be interested in why this happens, so I have a deeper understanding of lighting for future projects
Are all sides modified to actually recieve shadows?
The whole cube is one continuous mesh. Alls sides should act the same
Answer by eses · Aug 30, 2018 at 02:16 PM
Hi @ChakChakGuy
To me it sounds like you are just wondering what is happening, based on what you see on screen. You'd better start tinkering with lighting settings and learn how Unity uses real-time and baked lights.
3D engine lighting is always a compromise between performance and graphics hardware limitations. Unity has pretty nice defaults IMO, but you can change them.
Here is my (some sort of) checklist which you might find useful (not specific to your case):
What quality settings are you using (Project / Quality settings menu) ?
Defaults are from Very low to Ultra.
What types of lights you are using?
If you are not using directional lights, it might be that the light effect distance and strength is not high enough.
What is your shadow (drawing) distance setting value?
It might be, that your shadows get cut off.
What kind of lighting mode you are using?
Mixed lighting on / off?
What are your light importance settings?
If you have more than max amount of set lights.
How many pixel light are set to be used in your Quality Settings?
By default Unity has limited this to 4 in Very High and Ultra, and to 1 or 2 in lesser settings. Also, mixed lighting mode seems to limit light count, you can try it with some test scene you create.
What materials you are using?
Are you using Standard shader, or something else, which might not react to lighting in similar manner?
Which render pipeline is in use?
I've only used standard one in 2018.2 - which is probably the installed Render-pipelines.core, which you can see in Package manager. But there is also lightweight and High-definition.
Tweaking defaults
Even with limited knowledge about engine, if one just answers to these questions and puts some effort in testing each setting for a couple of hours while also making notes, it is possible to get what you are after.
As you can see, I have 8 directional lights casting shadows. Note: you have to test this also on your target platform and in the GIF I'm using tweaked Very High settings.
Like @tormentoarmagedoom said, I too would really recommend you to consider your approach to solving the problem you have - do you really need lighting to create some markers?
Also, even if this was about lighting a scene, I wouldn't try to use too many shadow casting lights, usually there is something wrong in visuals, if you need tons of shadow casting lights, unless you are aiming for realism or you have some very specific scene.
Thank You!
I actually played around with all kinds of lighting setting for quite a while before asking here, but never got around to the Projects Quality settings.
As I said before, the shadow approach was more out of lazyness and even if it would work in a satisfying way I would have implemented other methods/alternatives. But I didn't want to just discard it without fully understanding how it works (or rather why it doesn't).
Your answer
![](https://koobas.hobune.stream/wayback/20220612173746im_/https://answers.unity.com/themes/thub/images/avi.jpg)