• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Blend mode and alpha adjusting.

Heya,

I'm trying to use a simple "screen" lighting blend mode (similar to Photoshop's), but am having trouble with adjusting the effect's alpha. If I use the following code:

Code:
gpu_set_blendmode_ext(bm_one,bm_inv_src_color); //screen
draw_sprite_ext(spr_over,0,x,y,3,3,0,image_blend,alpha)
gpu_set_blendmode(bm_normal);
I get the effect, but obviously modifying the alpha won't work here.

I found that the following works to allow adjusting the alpha:

Code:
var alf=1

//gpu_set_colorwriteenable(true, true, true, false);
//draw_sprite_ext(spr_over,0,x,y,3,3,0,image_blend,alf)
//gpu_set_colorwriteenable(false, false, false, true)

//gpu_set_blendmode_ext(bm_one,bm_inv_src_color); //screen
//draw_sprite_ext(spr_over,0,x,y,3,3,0,image_blend,alf)
//gpu_set_blendmode(bm_normal);

//gpu_set_colorwriteenable(true, true, true, true);
This allows me to adjust the alpha value of the screen effect (thru the variable "alf"). However, the effect then turns into some darkish, grayish overlay, unlike the original screen effect intended.

Looked through the manual but didn't get anything from it. There is a function to separate alpha, but I can't understand the explanation. There is no shader afaik that will create the screen effect for the entire screen.

Thanks for any help!
 
Top