Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Matrix and lights

Author
Message
SeVeN
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 27th Aug 2003 18:01
Hi. I have a little problem with a matrix and a directional light.
I have a normal matrix textured and randomized, correctly configured to accept ambient light, fog, etc. And I have a directional light over that matrix, pointing at the center of it, active, colored, etc...
However, the matrix always renders very dark, like if no light was created near its surface.
If you can help me, please do, and I'll give my thanks!

PS: The light simulates the Sun in a RTS game, and the matrix is the terrain
ReD_eYe
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 27th Aug 2003 20:17
you have to set the matrix normals i'm sure someone will have some code for you but i have none


Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 27th Aug 2003 23:04
Unfortunately the matrix is not effected by scene lighting until you set the normals. Setting the normals tells the matrix what direction the light is hitting it from, you give each tile a value from -1 to 1 based upon the direction along each axis.

It's sucky I know, but actually some good effects can be achieved with it.

Pneumatic Dryll
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Aug 2003 23:08
This code is directly from one of the DBC examples - works a treat in DBPro.

Just modify to your own matrix size and away you go!
SeVeN
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 28th Aug 2003 03:47
Thanks to you all!
Now the problem is corrected.

Login to post a reply

Server time is: 2026-07-23 00:17:33
Your offset time is: 2026-07-23 00:17:33