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 / Make objects darker

Author
Message
Mychal B
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 25th Sep 2011 22:17
Hey all,

all I'm trying to do is figure out how to make my objects darker. One example is when a object is in a dark area make it darker as well so you can't see it. This seems way to simple for shaders, but I can't figure it out!

The fastfood zombie killer
Mychal B
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 25th Sep 2011 23:13
Figured it out.

the mynum variable tells how much light each color value can absorb(r,g,b) , and if you have them all the same number and reduce it the object will become darker while retaining its original color.

mynum = 100

set object diffuse 1,rgb(mynum,mynum,mynum)

The fastfood zombie killer
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 25th Sep 2011 23:16
Does a combination of Ghost Object and Fade Object not suffice?

Your signature has been erased by a mod please reduce it to 600 x 120.
Quel
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 26th Sep 2011 01:30
That would fading out the object...

Also the fade command is dependent on the current lighting.

-In.Dev.X: A unique heavy story based shoot'em ~35%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
Mychal B
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 26th Sep 2011 03:15
I'm really trying to max out performance. There is no dynamic lights in my game, everything is already lightmapped. By using this method I can run a check for the area I'm in to see if I'm within the light range of any nearby lights. If I'm close to one I stop running the checks for all of the other lights until I leave this one. While I'm inside this one, I check the distance to determine brightness.

Oh yah, this is currently to determine the brightness of the character as he's walking around. I'm going to implement it on hiding zombies next

The fastfood zombie killer

Login to post a reply

Server time is: 2024-11-24 01:36:34
Your offset time is: 2024-11-24 01:36:34