[SOLVED] Splitting view surface into RGB & back

Hi all! I'm working on something that calls for a surface to be split into red, green, and blue surfaces, then have all 3 color be "added" together to bring the surface back to its original form.



Making 3 surfaces for each color seemed straightforward, but I'm not sure what method would be best to extract just the color needed for this additive technique.

Things I've tried
1-Using a variety of blend modes when drawing each surface
2- I tried just drawing each surface using the color command within the draw_surface function then blend modes
3- Looked in the shaders marketplace but couldn't find anything to fit this need

I'm pretty stumped here! Any pointers would be greatly appreciated! Thanks for reading
 

Fern

Member
gpu_set_colorwriteenable() allows you to allow the writing of only one color channel. Draw the view surface each time with each color toggled. If you are using GMS 1.x, just search for colorwrite in the docs. Same function, different name.
 
Hey thanks for replying! I'm using GMS, but I can't seem to find anything for colorwrite. Looks like exactly what's needed! I wonder if there's some other way to emulate this function in GMS?
 
Hey Flyingsaucer, I'm working on a shooter game and the idea is that the screen (view surface) splits apart and only certain things are visible within each screen segment (or RGB segment). It makes for a very trippy effect!
 
Top