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

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

BlueScarf

Member
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.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
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
Top