Lighting issue

G

Gowford

Guest
Hello everybody ! i have a quick question for GML , i've been doing an lighting system and apparently everythingh is the opposite ... like if you put on white the screen goes black if you put orange it goes blue.
thing is , i want to do a little torch-like lighting , but i can't get a color to work like orange !
i am right now using teal to put red into the view aura but i want it to be orange ! the closest i've got is blue but even that's yellow not orange , so could anyone help me ?
 

YoSniper

Member
Two things going on here.

1) I think you are using the bm_subtract blend mode. This means that you wind up subtracting the RGB values of the input color from your filter. I don't know if this is necessarily a problem, but it should help you understand the concept.

2) If you can't use a built-in color, you can always create your own with make_color_rgb Input your red, green, and blue inputs (integers from 0 to 255) and create your color. Because orange is around something like (255, 128, 0), you can put in the opposite, which is a sort of aqua (0, 128, 255).

Hope this helps.
 
W

Wraithious

Guest
If you know the color you want's rgb values (do a search for 'hex color picker' online, that will bring up a color pallet and a slider to quickly get the values you need) just subtract each one from 255 and use the make_color_rgb to make the correct opposite color you want.
 

CMAllen

Member
If you know the color you want's rgb values (do a search for 'hex color picker' online, that will bring up a color pallet and a slider to quickly get the values you need) just subtract each one from 255 and use the make_color_rgb to make the correct opposite color you want.
Yup. bm_subtract is quite literal. Each channel has a value of 0-255, and it subtracts that value from the same channel of the existing pixel. Subtract white(255,255,255) from anything and you always get black (0,0,0). So to do subtractive red tinting you actually want your color to be cyan (0,255,255). The red channel has a value of 0 and thus the red channel is unchanged. Alpha channels and surfaces complicate this a little, but the same rules apply.
 
Top