1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

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

Discussion in 'Programming' started by BlueScarf, Nov 6, 2019.

  1. BlueScarf

    BlueScarf Member

    Feb 21, 2017
    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.
  2. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Apr 13, 2016
    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!
    Xor likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice