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 / Lighting issues in DBpro

Author
Message
AJ Schaeffer
16
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 4th Aug 2010 10:37
ok. All i want to do is make the level COMPLETELY BLACK and add lights in. but for some reason thats not gonna happen.
(i have 0 lights in the level)

Screen 1 ambient light = 100
AJ Schaeffer
16
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 4th Aug 2010 10:38
screen 2: ambient light 0!
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 4th Aug 2010 10:58
You need to use "hide light 0"

AJ Schaeffer
16
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 4th Aug 2010 11:13
yay that works but now the ground is either fully illuminated or just black when i chage the light range?

also how do i get the gun to move with the camera WITHOUT locking it on screen
wyrleywolves
23
Years of Service
User Offline
Joined: 6th May 2003
Location:
Posted: 4th Aug 2010 11:33
have you tried?
position gun ,camera position x(),camera position y(),camera position z()
and use newxvalue and newzvalue if you want to move it slightly away from the camera co-ords.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 4th Aug 2010 11:35
You may need to use an object with more vertices for your ground like a matrix (for example) to get the lighting to look right as I believe it colours each polygon depending on its distance from the light source. As a plain is just two large polygons it will not give a gradual effect.

You can position your gun using:


...then move the gun to a suitable position/rotation each loop but locking it to the screen is better. If you want the gun to move as you walk try using "offset limb" on limb zero of your gun.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Aug 2010 12:25
Quote: "as I believe it colours each polygon depending on its distance from the light source"


Not quite. The problem is that the default lighting uses the distance from each vertex and interpolates that for intermediate points. The result is that the light can be close to the ground (so you might expect the ground to be lit) but a long way from each vertex so the points on the ground near the light are treated as if they are also a long way away. There are three main solutions:

1. use a lightmap to pre-calculate the lighting (not much use if you want to move the lights)
2. use high poly plains as baxslash suggested (this can be the simplest solution)
3. use a shader.
AJ Schaeffer
16
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 4th Aug 2010 21:20
ok i tried positioning the gun like that ages ago, but ill try moving it down a liitle, then move it back. Oh yeah and for walking and all that i load the animations from the .x file
AJ Schaeffer
16
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 4th Aug 2010 21:48
it doesnt "move with the camera" it just turns the opposite way, and i f i move it back or forward than it moves weird when i turn
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 5th Aug 2010 10:26
Maybe you could post some code + media (don't worry I won't steal anything) and I'll try to help you get it working?

AJ Schaeffer
16
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 5th Aug 2010 20:08
i just locked it on screen but if you wanna get ur hands dirty and a free sneak peek, have at it. i didnt delete te old code, i just put rem next to it. if you could fix it without using the lock on screen i would greatly appreciate it. media is attached in folder.



baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 9th Aug 2010 10:27
I'll take a look when I get the chance, I've been away all weekend...

Login to post a reply

Server time is: 2026-07-25 12:04:38
Your offset time is: 2026-07-25 12:04:38