I am having an issue with shadows. Let me start by saying that I do indeed have Unity Pro. I have the check boxes checked for cast and receive shadows on the objects in question. I’m using deferred lighting with a directional light. It is pointed through a window with a cross bar in it, and it shows properly in the editor, but when run, the light shines as though there are no walls or window there at all. If anyone can help me out with this, I would be very appreciative. Here are some screen shots to illustrate my point:
Perhaps you can try baking lightmaps. or try to make set the shadow types to hard/soft shadow. I can’t remember which. And have a spotlight. Put a bigger picture. It’s too small.
The problem with baking lightmaps is that it’s a lot of extra work every time I want to do a new lighting/shadow effect. I have tried hard and soft shadows, and neither option changes the outcome. I am also using a spot light already.
Also, the pics are only there to show that in the editor, the shadow is casting properly. In the run time, it isn’t. The images are small but they show the point I’m trying to make pretty clearly. lol
My guess is that your player is using a different quality setting level (one that has shadows disabled) than your editor. Check your quality settings (Edit → Project Settings → Quality).
I set Fastest, Fast, Simple, Good, Beautiful and Fantastic to “Hard and Soft Shadows” and there was no change, and I also tried the both individual settings for it as well. Still, the shadows will not display properly.
You may want to check both your quality AND your build settings. If your building to web for instance, your default quality and rendering might be different than you expected/setup in the editor by default. This will change how it shows in the viewport editor, and how it shows up in play mode when you hit play.
I tried moving the camera, that didn’t change it. Then I changed the shadow distance to 1000, then to 10000 and still nothing. I suppose I’m going to have to bake in lightmaps as zine92 suggested. If anyone has any other ideas that might make shadows work right, please, let me know. Thanks for all your ideas, folks.
@Larvantholos - In the build settings, I’m set up for PC and Mac standalone, and the development build checkbox is checked. Are these the right settings to render shadows properly?
So, I got the shadow to shine through the window. I changed the projection setting to Uniform Focused on the directional light. My problem now, is that the floor will now only receive the lighting from the directional light, and not the ambient lighting inside the room (Point Light with a blue color). The walls and objects in the room still receive the light from the point light in the room, just the floor doesn’t now.
I’m fiddling around with some settings now to see if I can fix it, but if anyone knows how to fix this, please let me know.
OK, fixed that problem too. I set the Render mode on the directional light to important, and the lightmapping setting to Realtime Only. The only problem I have now is that the shadows aren’t casting realistically. Basically, I wanted the shadows to cast the way they did in the editor pic in my first post, like the shadow stretches at the furthest point from the light etc. If this is my only problem, I’ll take it. Nevertheless, any suggestions would be much appreciated. Thanks for the help everyone!