- Home /
how do i get shadows to cast on terrain?
To start - I'm using Unity Pro and I did read through and this question has been asked before but I have not found an answer that fixes my problem though I've found lots of things to check before I post, so here is the rundown:
The object to cast shadows is checked static. It is checked to cast and receive shadows. It is receiving shadows. It is not casting shadows on the terrain. The terrain is checked to cast shadows, but I've found no place to set "receive shadows" as it seems you can set on an individual asset basis - maybe this is not an option for terrain, but it casts shadows on itself, but won't receive shadows.
Help me, Obi Wan Kenobi. You're my only hope!
Love + bunnies, Amanda
$$anonymous$$aybe the directional light has not been set to hard/soft shadows
Answer by 3Dx2Yz · Apr 01, 2015 at 04:04 PM
In the Terrain settings switch Material to "Build in Standard". That is what worked for the terrain in combination with point lights that I am using. Hope it helps you too! My Unity version is 5.0.1f1
Answer by insominx · Oct 17, 2015 at 06:07 PM
Try the following:
check cast / receive shadows on your objects is set
set the shadow casting light to a valid shadow type AND BUMP UP THE STRENGTH (1.0 for testing)
make sure your shadow distance is large enough.
Shadow distance can be problem when using large terrains and viewing them from above (God's eye view like a RTS). To test if this is your problem, go to Edit/Project Settings/Quality and from there crank the "Shadow Distance" up to something larger. You should be able to see the shadows in the editor scene view as long as you have the scene lighting button toggled.
Here's an example of a 2000x2000 terrain looked at from above with a shadow distance of 3000:
This worked for me, in Edit>Project Settings>Quality my shadows were turned off. set it to hard and soft shadows
Answer by aroOon · Mar 18, 2015 at 11:52 AM
Were you using Unity 5? Terrain shadows seem to be broken now: the only lights that cast onto terrain are directional. Spot & omni only cast onto objects. Hopefully they will fix this.
Try this: go to terrain settings and lower the Base Map Dist. to 0. Do the shadows appear? Obviously not a valid solution, as it makes the texture look like crap.
Answer by kingcoyote · Dec 04, 2014 at 05:05 AM
Shadows only cast on terrain if you build and run the game. Playing the game in the regular Unity editor does not cast shadows.
To build and run, go to File -> Build and Run, and configure your scene and build options. Most of it can be left as default. When you run the game properly in the final compiled form, you will see the shadows on the terrain.
No they don't. I have shadows casting on my terrain in the editor, look :
$$anonymous$$aybe it depends on the version, computer, or something else. I never get shadows on terrain in the editor, look:
Odd, never had them not work in the editor on a system that meets the $$anonymous$$ requirements for shadows...?
$$anonymous$$y PC is not exactly top notch, but it's not terrible. I've just noticed that shadows on terrain never show up in the editor and I assumed that was by design.
i have a very high end pc and no shadows apear for me either so i dont think it is just the low teir pc's
Answer by grimlypitch · Dec 04, 2014 at 07:08 PM
Hi everyone - thanks so much for trying to help me. I've tried and checked everything you've all suggested, but am still having no luck.
I've also watched a couple tutorials where the shadows cast onto the terrain without building just fine for the instructor, but even when I tried the build + play suggestion, I still wasn't getting any cast onto the terrain, though the objects themselves are casting shadows on themselves just fine.
My PC is a beast - just got it, so that isn't the issue - but I'm starting to wonder if the trial version of PRO is nerfed despite that they say it isn't.
I am going to subscribe to PRO and see if it solves my problems. Will let you know in case you (or any one in the future) is interested.
Thanks again kingcoyote, MrSoad, PvTGreg, and hoekkii for all the help so far. You're awesome for answering regardless of my personal inability to get better results. Far less frustrating to have people who know more to hit up for this kind of thing!
Amanda
Did you try the test project that I gave above(last comment)? What happened if you did?
I built and ran it - if that's what you mean?
Congrats on runner up in the Edge GIG challenge 2014 for "Nautical Protest", btw. I haven't played it, but that's fantastic. I will check it out when I have a mo for sure.
Thanks about NP! :) Regarding the test project I meant did you download it and open it to see if the cube shadow displayed on the terrain. Here is the project again, open it and tell me if you see the shadow :
Oh! I didn't even realize there was a test terrain to download. Apologies! Now downloaded and tried out, but sadly no shadows. Or am I doing something else wrong? Here is a screenie:
And thanks again!!!
No you can do nothing wrong with it, I made it as simple as possible and the shadow should display as soon as it is loaded and it is not. So I don't know where the issue is.
I'm out of ideas, sorry... :(
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
(FIXED) How to remove Unity 5 shadow artifacts? 2 Answers
Keeping a player in a path/Bounding area. 1 Answer
Query - taking Unity free files into Unity Pro 2 Answers
Beast Lightmapping Bad Shadows 1 Answer