x


(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

more ▼

asked Nov 24 '11 at 09:37 PM

Themperror gravatar image

Themperror
1 1 1 2

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?

Nov 24 '11 at 10:19 PM brumdogpro

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 illuminate anything.

Nov 25 '11 at 02:08 AM Eric5h5

but its just plain stupid when your inside an CLOSED house (Minecraft) 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

Nov 25 '11 at 10:03 AM Themperror

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.

Nov 25 '11 at 08:12 PM Eric5h5
(comments are locked)
10|3000 characters needed characters left

1 answer: sort newest

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.

more ▼

answered Nov 24 '11 at 10:24 PM

DevonJavaScript gravatar image

DevonJavaScript
56 12 20 20

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...

Nov 25 '11 at 10:14 AM Themperror
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1470
x426
x323
x132
x61

asked: Nov 24 '11 at 09:37 PM

Seen: 1667 times

Last Updated: Nov 25 '11 at 08:12 PM