Brightness/contrast adjustment for sprites

Ideas for Game Editor evolution.

Brightness/contrast adjustment for sprites

Postby d-soldier » Fri Apr 13, 2007 12:58 am

Was just designing a level in lightwave and was trying to figure out how to make my character's brightness change as he passes under street lights (not transparency) but the color values... now I'm wondering if this is already featured through rgb values in the coding....
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Fuzzy » Fri Apr 13, 2007 2:12 am

The rgb act as multipliers. they range from 0-255. with r g and b all at 255 the sprite will be full bright. white will be white. if you had a white sprite and r g b were all at 127, the sprite would appear medium grey.

I dont believe that you can go any higher than 255 in them. It would be a nice feature though.

have the actor walk under another actor that looks like a pool of light. make it mostly transparent. That should tint or wash out the colors of the actor.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

interesting.... RGB settings

Postby d-soldier » Fri Apr 13, 2007 3:08 am

... So if my player was (at default) full brightness, and I had areas scripted to lower the rgb values (areas outside the well lit zones) it would appear to make him darker as well? How would I script that regarding the player and regions (wirefram/filled)?
Attachments
map01_01.gif
Included a quick render of the level I'm currenty working on to give some insight on the dynamic lighting:
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Fuzzy » Fri Apr 13, 2007 4:06 am

On collision with the area, darken the player.r player.g and player.b

on collision end, set them back to 255.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby Fuzzy » Fri Apr 13, 2007 4:08 am

lovely scenery btw. you could also reduce computational needs by overlaying dark actors over the various dark areas, and making them somewhat tranparent.

in your rendering stage, make two images. in one, use the full lights everywhere. Full ambient light. in the second one, render with the lights. load as layers into photoshop or gimp and subtract the two. use the result as an alpha mask. samples to come.

Pardon the reversed order. its 3 2 1 and it should be 1 2 3.

Now the final image, Sample Negative as Alpha mask.png should be changed into an alpha mask and saved alone in an image. This will cast a shadow of greater or lesser depth over parts of the play area. Fine tune this with the actor tranparency control.

You may have to cut the image up depending on how the scenery lays, like if you need to walk in front or behind something.

if you dont know how to do that, let me know what application you use for modifying pixels, and I will tell you.

If you really want, I will do a demo.
Attachments
Sample Negative as Alpha mask.png
Mask Sample2.png
Mask Sample.png
Last edited by Fuzzy on Fri Apr 13, 2007 4:35 am, edited 4 times in total.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

hmmm....

Postby d-soldier » Fri Apr 13, 2007 4:11 am

Is there a way to make it a smoother tansition, rather then dark to light in a single frame (end of collision)? And thank you, Im much better at graphics then this programming stuff...
**EDIT:**
Fuzzy, you are the man... I've been playing with all this script stuff that I didn't even think of the graphical side of it... A PNG file that makes all the light atreas transparent, and set at a low to mid opactity, with a zdepth higher then everything else (player especially) would do the trick! A nice decent blurr would made the transitions from light to dark nice and smoothe. You are the man, another point to you!
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest