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.

Newcomers DBPro Corner / Quick Lighting question

Author
Message
Social Disease
21
Years of Service
User Offline
Joined: 30th Sep 2003
Location: State of Confusion, beyond Denial...
Posted: 23rd Apr 2004 03:43
How do I make my cubes not show up as being lighted from one side? How do I make the lighting effect completely dynamic.

Think Gad fro Spill Chock!
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 23rd Apr 2004 04:29
You could make the cubes fully lighted by useing the command...

Set Object Light [Obj#],0

Look up all the lighting commands in the DarkBASIC Manual to see all the ways you can use light in your game.

...Well...I hope I helped

Thou shalt not thwart the way of the dragon. For thou tasteth like chicken.
Social Disease
21
Years of Service
User Offline
Joined: 30th Sep 2003
Location: State of Confusion, beyond Denial...
Posted: 23rd Apr 2004 04:43
Well, no. not really. If I set object light (obj#),0 then the cubes are lit from all sides, all the time. If I set object light (obj#), 1 then the North, West, and up sides are lit, and the South, East, and Down sides are dark, no matter where my light is. I would like them to be dark on all sides, and then brighten as I bring my light closer.

(this is in DBP. I looked at the light commands in the help, but didn't find it to helpful, are there any good tutorials?)

Think Gad fro Spill Chock!
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 23rd Apr 2004 04:56
There are two lights already on the the scene called Light 0 and Ambient Light . Light Zero can be positioned and changed like any other light. Ambient Light is the constant light that affects every object and polygon on your scene, regardless of position, rotation, ect.

You could set Light 0's range lower so objects are darker until you position the light close enough... If you added another light to the scene then you may think that it is not working because you arn't changing Light 0's position...Well...Try that and see if it works.

Thou shalt not thwart the way of the dragon. For thou tasteth like chicken.
Social Disease
21
Years of Service
User Offline
Joined: 30th Sep 2003
Location: State of Confusion, beyond Denial...
Posted: 23rd Apr 2004 05:17
Ok now I took out light 1, set ambient light to 0, and am repsoitioning light 0. But its still doing the same thing! Some sides are always dark, and the other sides are always lit! Grrrr Work you stupid thing!

Think Gad fro Spill Chock!
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 23rd Apr 2004 05:34
I'm not sure if I understand you... If the light is above your cube then the top polygons are lit... If the light is below your cube then the bottom polygons are lit... If Light 0's range is low and it's farther away from the cube than the lighted sides get darker, but are still more lighted than the darker sides... All that should work correctly...hmmm... Make sure You "Set Light Range 0,[Low]" so the cube is dark if the light is far away... Other than that I don't know...Sorry

Thou shalt not thwart the way of the dragon. For thou tasteth like chicken.
Social Disease
21
Years of Service
User Offline
Joined: 30th Sep 2003
Location: State of Confusion, beyond Denial...
Posted: 23rd Apr 2004 05:48
Yah, I tried that and It was the same as before I started messing with light 0.

Very frustrating, here's the source, maybe this will help

Think Gad fro Spill Chock!
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 23rd Apr 2004 06:16
"position light 0,object position x(1), Height, object position z(1)"

If your just positioning the light at the camera position then you will only be able to see the lighted sides of the objects. I think you want to gradually be able to see objects as you get closer...

To do this use the "Fog" commands... I have to go now and wont be able to post again until tomorrow morning... Hope You figure It Out...

Thou shalt not thwart the way of the dragon. For thou tasteth like chicken.
Social Disease
21
Years of Service
User Offline
Joined: 30th Sep 2003
Location: State of Confusion, beyond Denial...
Posted: 23rd Apr 2004 11:27 Edited at: 23rd Apr 2004 11:41
Yay! It works! It works! The reason it wasn't working before is that i hadn't set light 0 to be a point light! Yay! Yay!

Think Gad fro Spill Chock!

Login to post a reply

Server time is: 2024-11-26 14:27:17
Your offset time is: 2024-11-26 14:27:17