• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

Shaders Having Trouble Understanding Shaders and How To Change 1 Color into Another


Hello everyone!

I am new to Shaders, and don't really understand how they work. I've watched a couple of Youtube videos, and opened up some example projects, but I'm still confused.

I have a large collection of walking, running, jumping, sprites for my character. And in all of these sprites he has the same color shirt and pants. If I know the exact RGB value of these colors, is there an easy way to pass them through a shader to change their color? I'm assuming I'd have the shader code in the draw step of my character? I think I need some direction for what this would look like, and what exactly the Shader would contain?

I am using GMS2.


Friendly Tyrant
Forum Staff
Shaders take a bit of getting your head around, but once you understand the base principles it's not too difficult to do the basic stuff like you want to do. Here's some links that I highly recommend:

https://www.yoyogames.com/blog/14/shaders-overview-part-1 < This is a series of bologs on shaders from an ex-yyg employee, and although it's quite technical, it does a fairly good job of explaining how they work in GM (it features GM:S 1.4, but it's all equally applicable in GMS2).

https://xorshaders.weebly.com/tutorials/shader-basics1 < Xor shaders is also a good place form some simple shader basics...

https://developer.amazon.com/blogs/...-shaders-and-surfaces-with-gamemaker-studio-2 < Amazon article about shaders in GMS2... Gets a bit technical a bit fast, but still another good article with examples you can follow and edit later

< Great video that introduces shaders to beginners. Well worth a watch.

Hope some of those help!
  • Like
Reactions: Xor