- Home /
(point)Light goes through objects
It's like this problem: http://answers.unity3d.com/questions/14070/light-goes-through-terrain-help.html
But I'll explain a bit more..
I have in the middle of my level an sphere. (I rotate this sphere (Deltatime)) This sphere has an point light added as a child with an very big range (so it actually simulates the sun).
My problem is.. when it's "night" (the sun is UNDER the level), everything gets lit from beneath.. so the light penetrates every object..
The answer in that topic said something about realtime shadows in the pro version, Where do I find this or use this (I got the pro version) as i'm making an minecraft clone (To test my coding skills) and every block gets lit from beneath or sides when the sun is setting or down... (even while in an closed chamber)
edit:
the lights have cast shadows enabled and i tried both hard and soft shadows also tried all 3 the rendering modes, forward, deferred and vertex, also every object has cast and receive shadows enabled...... nothing helped so far
Why not just use a direction light and rotate it for the day/night cycle but when its down set it to turn the intensity down until it is off so it doesn't light stuff up from beneath?
Using a directional light simulates the sun much more accurately than a point light. And yes, light "penetrates" all objects (rather, other objects are ignored when doing lighting calculations); that's how realtime 3D works. Turn the light off when you don't want it to illu$$anonymous$$ate anything.
but its just plain stupid when your inside an CLOSED house ($$anonymous$$inecraft) and then have 1 side of the wall fully lighted.. whether it be the floor,ceiling or wall... isn't there any work around for this? cause this sucks
That's how realtime 3D lighting works, "stupid" or not. Game dev is really just a bunch of smoke and mirrors, nothing works like it does in real life. If you have Pro you can use realtime shadows (but even they are added "on top" of the standard lighting), though that won't work in all cases. As I said, you can just turn the light off at night. It's a good idea to become familiar with how computers and 3D hardware work, so you know what the limitations are and how to work around them.
Answer by DevonJavaScript · Nov 24, 2011 at 10:24 PM
A solution is to not use point lights, or maybe just changing the lights intensity.
Example:
var light: light;
var x = false;
function Update() {
if(x){
light.intensity = 0;
}else{
light.intensity = 1;
}
}
A little something like that if I'm sure.
it's not what i seek, as the light just (...)s up when it's "day" for example when you're in an house.. the floor is constantly lit from the directional light.. (also every other light) and when it's "night" the ceiling is lit..
i just need to stop light from penetrating objects...
Your answer
Follow this Question
Related Questions
Terrain Details Point Filtering? 0 Answers
Terrain is transparent to objects 1 Answer
Does anyone know how to fix this? Yellow texture on imported objects. 1 Answer
Randomly Generated Terrain 2 Answers