Light in a room ...

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Yoann

Light in a room ...

Post by Yoann »

Hi !

I had a room maked with 3DsMax, a simple cube, and a light outside my cube. But the light is present in my room... I don't understand why, because all my vertex of my cube are welded...

Somebody can help me ?

Thank you !

Yoann.
Baal Cadar
Posts: 377
Joined: Fri Oct 28, 2005 10:28 am
Contact:

Post by Baal Cadar »

I don't know what "welded vertices" are, but dynamic lighting ignores occlusion. Back faces aren't lit, but the front faces of the cube lying on the opposite side of the cube are, because they are facing the light.

Only way to fix this is proper light management in your application, meaning to turn off lights outside the room, if you only see the interior of it, or defining the range of the light in a way, that the inside of the cube isn't reached by it.
Yoann

Post by Yoann »

Thank you ...

But It's a very bad new :?
Yoann

Post by Yoann »

Ok... I see...

But what can I desable lights if I'm in my room ... and enable if I'm outside ?

I don't see how to do that ....

Thank you !

Yoann.
Baal Cadar
Posts: 377
Joined: Fri Oct 28, 2005 10:28 am
Contact:

Post by Baal Cadar »

There is no automatic way to do this. Many games use invisible trigger boxes/planes/spheres to trigger some action or change the environment. Invisible means, they only exist in the collision test environment, but not as graphic.
Also a possibility is to turn on/off lights/particleFx/etc by distance checks to the camera. Many different ways to do this, but all ways need a bit of work and additional meta-data.

It is just not enough to through a few meshes, lights and fx in the scene and expect it to be pretty and fast. A huge part of the programming time for a game has to be invested into such micromanagement things. The graphics engine can't help much, because the actual requirements differ greatly from project to project.
Yoann

Post by Yoann »

My map is very simple, so, it's not difficult to determinate coordonates when we must enable lights, and when we must desable lights.

Thank you !!!

Yoann
chromdragon
Posts: 101
Joined: Wed Feb 15, 2006 4:22 pm
Location: RO

Post by chromdragon »

Have you tried flipping the normal of your cube?
Baal Cadar
Posts: 377
Joined: Fri Oct 28, 2005 10:28 am
Contact:

Post by Baal Cadar »

With flipped normals a light inside the cube woiuldn't have an effect on the inside of the cube either. Probably not desired either.
Guest

Post by Guest »

I wouldn't triger off the light,, I would put an intensive light into the room with let's say, black or brown color, or set the diffuse parameter of textures down to appear dark beeing enlighted by the light ....and fliped the normals or did an inside roof ..
Post Reply