Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Yeah, my first try with shaders, so extremely simple calculation.

I used Commodore 64 colours that are usually quite de-saturated, so tried to boost it  a little, and made every 3rd pixel slightly darker to make it look like CRT pixels.

varying vec2 v_vTexcoord;
varying vec4 v_vColour;
varying vec3 v_vPosition;
uniform float time;

void main()
{
    vec4 col = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );

    float HueFactor;

    if (mod(v_vPosition.y, 2.0) >= 1.0) {
        HueFactor = 1.2;
    } else if (mod(v_vPosition.x, 2.0) >= 1.0) {
        HueFactor = 1.4;
    }

    col.r *= HueFactor;
    col.b *= HueFactor;
    col.g *= HueFactor;
    gl_FragColor = col;
}

But isn't this a GameMaker shader?  for some reason Unity uses a slightly different naming than the standard GLSL.

Possibly, I haven't got my head around shaders so it's very much trial and error. But yeah, I'm using Game Maker, so any code snippets would work with that, can't be sure about others. But the idea should still work if adjusted to different engine.

(2 edits)

https://www.udemy.com/unity-shaders/ is a course that I highly recommend ( if it is by Penny de Byl or Holistic3d, if not then it's the wrong course : /   ) it is a one-time payment of 9.99$ (or something like that)  for lifetime, and you can take it whenever you feel like doing it. I own this course and LOL I haven't even had the time to do it. I can say it is really good though! You learn some pretty good stuff! I have several of Penny's other courses.. actually all of them except for 2 I think. Just take it, there's like a 30 day money back if you don't like it so yeah

It shows $150 to me, but otherwise good shout :)

?! Really, hmm if you wait and make an account you should get an email with promotional on courses you've wish-listed and its around 12.99 or 9.99 at its lowest