• 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!

What blend mode do I use.

M

Misty

Guest
Bottom line is, I got an eye sprite. It's a traditional eye sprite, white eye, black pupil.

Thing of it is, I want the image_blend to change the black pupil to a random color. And I want the white to stay the same.
I tried draw_set_blend_mode_ext(bm_inv_src_colour,bm_inv_dest_colour) but no dice.

What is the secret formula?
 
A

Aura

Guest
Look into shaders. I won't suggest using blend modes for that purpose.
 
  • Like
Reactions: Roa
M

Misty

Guest
Or you could have the pupil as a white image so that you can then change it to any colour you like.
Wont work, because the eyes will still be white on the outside and the whole thing will change color.

Look into shaders. I won't suggest using blend modes for that purpose.
I'm not using a shader for such a tiny thing in the game. Can you please explain why blend modes would not work for this purpose?
 
E

elementbound

Guest
Yep, doing most of these kinds of things is easier with shaders.
However, for this particular thing, you can do it with bm_max.
 

Roa

Member
I would just use layered sprites or shaders, shaders probably being a tad faster and less memory.
 

Tsa05

Member
Why is the pupil changing color??
The eye would probably be made of white eyeball, coloured iris, black pupil...
Anywho, easiest way is probably to composite the images together with layered sprites.

As for blend modes, I can't think of one for ya. Or, rather, I can--it's Overlay--but that's a conditional blend mode. Since you need something that leaves black (pupil and eye outline) and white (eyeball) alone, but changes something in between, you need a blend mode that isn't natively hardware do-able. Photoshop has it, but not GameMaker. That'd need a shader

If you *are* ok with Black changing colour, but with white remaining unchanged, here's the Screen blend mode for you:
draw_set_blend_mode_ext(bm_one,bm_inv_src_color);
 
M

Misty

Guest
Why is the pupil changing color??
The eye would probably be made of white eyeball, coloured iris, black pupil...
Anywho, easiest way is probably to composite the images together with layered sprites.

As for blend modes, I can't think of one for ya. Or, rather, I can--it's Overlay--but that's a conditional blend mode. Since you need something that leaves black (pupil and eye outline) and white (eyeball) alone, but changes something in between, you need a blend mode that isn't natively hardware do-able. Photoshop has it, but not GameMaker. That'd need a shader

If you *are* ok with Black changing colour, but with white remaining unchanged, here's the Screen blend mode for you:
draw_set_blend_mode_ext(bm_one,bm_inv_src_color);
No dice. Can you test it in GM yourself to make sure it works?

Using a shader isn't too hard. Here is a quick example I whipped up: https://www.dropbox.com/s/m85ks3iaqw7211g/shaderEyeTest.gmz?dl=0
I may just have to end up using that if this blend mode thing is gonna keep on spinning my wheels.
 

Tsa05

Member
No dice. Can you test it in GM yourself to make sure it works?

I may just have to end up using that if this blend mode thing is gonna keep on spinning my wheels.
I can and it does, but...heh, I suspect maybe I know what's up? Are you just drawing a blob of color over top of your sprite? If so, then there's the issue--you need to use blend modes to specify how to blend the colours, but also to specify how to blend the opacities. Time to combine techniques. Make a surface, pre-blend a color onto the eye for the shape mask, then blend the surface onto the eye image using the blend I described to apply the color.

Importable gmz project: https://dl.dropboxusercontent.com/u/14325048/Game Maker Examples/BlendedColour/Blend.gmz
 
M

Misty

Guest
Nah, what I did is just changed the image_blend of the sprite, and then put a blend mode before it. My method absolutely did not work.
 
Top