Need Help With Trying To Make Shaders Affect Certain Objects

T

Trutru

Guest
So, I have been working on a game in Game maker studio lately and have run into an issue. A huge aspect of this game is that when you interact with objects (such as beating an enemy) a radius of color would appear in this previously black and white game. Doing some research, I believe the best way to go about this would be through shaders. (If there is a better solution then using shaders I am also open to that too.) So I was wondering if anyone had any suggestions.
Pretty much the idea is that I want to have a layer over everything that makes it black and white and then have certain objects make holes in that layer that would restore the color of the texture.
I hope that this makes sense and thanks in advanced to anyone who might be able to help.
(Also if anyone needs more details, I will gladly give them, just ask)
 

andev

Member
Hello and welcome to the GMC! The fastest way to achieve this effect is likely to be entirely using shaders. But if you've never used shaders before, it might not be the easiest thing to jump into.

A more simple method would be:
1. Draw everything to a surface, in color.
2. Draw the surface in monochrome, using the shader.
3. Set the blend mode to subtract, and cut out everything you want to remain in black and white from the surface
4. Draw the colored surface on top.

You can skip steps 3 and 4 while there are no colored elements visible. If you skip anymore steps, you'll get a noticeable frame dip as effects come in and out.
 
Top