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 shader range issue

Author
Message
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 16th Apr 2010 23:19 Edited at: 16th Apr 2010 23:20
I've posted a similar question before but I didn't really get a good solid answer.
I am using evolve's multipass lighting fx.
http://www.evolved-software.com/shaders/Shaders_Lighting.html
I'm using the normal mapping shader but i'm having trouble with the db funtions that go with the shader. The lights shut off after the camera is a certain distance from them. But if I increase the range of the lights, they get brighter. How would I increase the range without increasing the brightness?
This is the code in the lighting functions


And I call it up like this


If it hasn't exploded yet, I haven't touched it.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Apr 2010 01:01
Quote: "But if I increase the range of the lights, they get brighter"


How else do you expect to see a light that's turned off at a certain range - except by making it brighter at that distance?
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 17th Apr 2010 04:09 Edited at: 17th Apr 2010 04:09
What i mean is that the light suddenly just blinks off.
see pictures taken from just being in the light range and then backing just out of it.
In range:

Out of range:


If it hasn't exploded yet, I haven't touched it.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Apr 2010 13:55
I see what you mean. There must be a coding error somewhere because the light should be attenuated gradually down to zero brightness.

What is your code trying to do exactly? It looks very complicated at first sight.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 17th Apr 2010 15:17
I just figured out that prob but ran into another in soving it.
Well the lighting fuctions came with the shader but I edited them a little to fit my needs. The GetObjectLight( O , L ) function checks if the light is in range and if it is, its turned on. I just figured out that if I change the function that gets the range of the light (LightCol#(0,3) is the range or the light)
to
it will increase the light's range but not the brightness, but then my fps drops from 60 to around 35 which is a big problem.

If it hasn't exploded yet, I haven't touched it.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 20th Apr 2010 22:24 Edited at: 20th Apr 2010 22:31
Well I found that my game really runs slow when I add more complex objects such as tables and cages since the shader has to light those surfaces. Is there any suggestions on how to improve the speed of my game? Also even when I turn on Vsync and set my sync rate to 60 my fps jumps around from 40 to 70.

If it hasn't exploded yet, I haven't touched it.

Login to post a reply

Server time is: 2026-07-26 07:35:56
Your offset time is: 2026-07-26 07:35:56