GameMaker: Outline Shader Tutorial

Поделиться
HTML-код
  • Опубликовано: 21 дек 2024

Комментарии • 133

  • @carles_roch_arnau
    @carles_roch_arnau 5 лет назад +39

    I have two quick questions:
    1· How can you change the color of the outline
    2· How can yo change the alpha of the outline to make it more transparent
    Thanks

    • @aerobetamax6022
      @aerobetamax6022 5 лет назад +31

      1. You fill the background of the sprite (and every sub image) with your desired outline color with alpha = 0. The default background is black with alpha = 0.
      2. In the shader you can multiply the alpha variable with your desired alpha value.
      Example: "alpha += ceil( texture2D( gm_BaseTexture, v_vTexcoord + offset_x).a) * 0.75;" Here it will draw the shader at 0.75 alpha value. The ceil function takes the neighboring pixel's alpha value and rounds it up to the next integer. You can multiply this value, which is 1, with any alpha value you wish. Dividing would also work but multiplying is obviously better for clean code.
      I hope you find this useful!

    • @russellcastell2709
      @russellcastell2709 4 года назад +2

      @@aerobetamax6022 Hey! I realize I'm a little late to this party but could you help me understand what you mean by "the background" of the sprite with "alpha = 0"? I understand that the default background is black and that's why the outline is black, but where should I fill a different color, on the sprite sheet or on a different layer? How do I set the alpha to 0?
      Thanks in advance,
      -Russ

    • @aerobetamax6022
      @aerobetamax6022 4 года назад

      @@russellcastell2709 The background I refer to is simply the unpainted pixels of the sprite image. Default they are black, with alpha = 0 as to be transparent. You can change the alpha in the advanced color settings, one of the sliders changes the alpha value of the custom color you are customizing in the settings of the sprite editor.

    • @moisesg9472
      @moisesg9472 4 года назад

      @@russellcastell2709 try this, go to your object and open it as if you were going to draw on it, then choose the color you want and select the (cube) tool,
      then set the cube opacity to (0) and in color mode select replace then click sprite background and save everything, and when you run the game you will see the outline of the color you assigned to the sprite, this is a shape which changes the background color, it works for (Game Maker Studio) I don't know if it would work for (Game Maker Studio: 2.
      a little late but I hope I have helped you.

    • @jacobolmin5601
      @jacobolmin5601 4 года назад +2

      To change the color just write gl_FragColor.rgb=vec3(1,0,0); at the end of the shader, choose your desired values, this is for red

  • @onionike4198
    @onionike4198 7 лет назад +2

    This is exactly the shader I needed to create aside from the outline color XD There's another I need to make and I think this video gave me the tools I need to write it, thanks! :D

  • @Alexlinnk
    @Alexlinnk 7 лет назад +4

    I am excited to continue watching the plataformer serious :D

  • @igorthelight
    @igorthelight 7 лет назад +18

    Code from this video (with a little different names and few optimizations):
    I called my shader "shdr_outline"
    shdr_outline.fsh code:
    //
    // Simple passthrough fragment shader
    //
    varying vec2 v_vTexcoord; // vec2( x, y )
    varying vec4 v_vColour; // vec4( r, g, b, a )
    // Custom parameters. We must pass them manualy!
    uniform float pixelWidth;
    uniform float pixelHeight;
    void main()
    {
    gl_FragColor = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
    vec2 offsetX = vec2( pixelWidth, 0.0 );
    vec2 offsetY = vec2( 0.0, pixelHeight );
    float alpha = texture2D( gm_BaseTexture, v_vTexcoord - offsetX ).a;
    alpha += texture2D( gm_BaseTexture, v_vTexcoord + offsetX ).a;
    alpha += texture2D( gm_BaseTexture, v_vTexcoord - offsetY ).a;
    alpha += texture2D( gm_BaseTexture, v_vTexcoord + offsetY ).a;
    gl_FragColor.a = alpha;
    }
    "Create" event code:
    // Find parameters in our shader
    pixelWidth = shader_get_uniform(shdr_outline, "pixelWidth");
    pixelHeight = shader_get_uniform(shdr_outline, "pixelHeight");
    // Find pointer to our texture
    texture_ptr = sprite_get_texture(sprite_index, 0);
    // Get texel width and height
    texelWidth = texture_get_texel_width(texture_ptr);
    texelHeight = texture_get_texel_height(texture_ptr);
    "Draw" event code:
    // Set our shader instead of default one
    shader_set(shdr_outline);
    // Pass our custom float parameters "pixelWidth" and "pixelHeight";
    shader_set_uniform_f(pixelWidth, texelWidth);
    shader_set_uniform_f(pixelHeight, texelHeight);
    // Draw sprite
    draw_self();
    // Set shader to default
    shader_reset();

    • @Coody0829
      @Coody0829 4 года назад

      Wired. I followed tutornal but not workin but changed fsh code to ur code its working :Q

    • @igorthelight
      @igorthelight 4 года назад +2

      @@Coody0829 Glad that I could help :-)

    • @patahell
      @patahell 4 года назад

      Thank you

    • @CubsYT
      @CubsYT 4 года назад +1

      I wouldn't actually recommend using this version of the code. The fact that you create the alpha float with the offset instantly to it means that if a pixel is alone (no surrounding pixel) it turns transparent but still gets the outline. Should be really simple to fix though

  • @DYLwat100
    @DYLwat100 7 лет назад +3

    This is the only tutorial I could not get to work. The game could not start when I had this shader written at all, even if I did not call it with anything else. There were no missing semicolons in my code or anything, not sure what went wrong.

  • @AqareCover
    @AqareCover 7 лет назад +8

    awesome! are you planning to make more shader videos?

  • @dusanculum5889
    @dusanculum5889 7 лет назад +1

    Even better than last tutorial!

  • @MrKingJavo
    @MrKingJavo 5 лет назад +3

    Do we need to load that texture group or something? It's not working for me.

  • @briansgenius
    @briansgenius 7 лет назад +7

    palette swap tut plz?

  • @andresgrimminck8674
    @andresgrimminck8674 5 лет назад +2

    Is it possible to make this outline white instead of black? Would it be easy to do?

  •  7 лет назад +5

    I am not quite sure if I understand Shaun, but why adding the alpha value of the surrounding pixels of the current pixel is making an outline?? why the pixels inside the ghost are not being modified?? Can you help me understand this?

    •  7 лет назад +8

      ohhh, I understand now and that is why a transparent pixel remains transparent unless it is in contact with a non-transparent pixel. Because the alpha value of a transparent pixel is 0!!

    • @aves8964
      @aves8964 6 лет назад +5

      Lol, nice one, Socrates.

    • @dontlookatmyprofilephoto6669
      @dontlookatmyprofilephoto6669 6 лет назад

      Thanks for clarifying after you figured it out, was wondering this myself until I stumble upon your precious comment !

  • @unnamed_account663
    @unnamed_account663 7 лет назад +2

    Would it be possible to accomplish this without having the extra invisible pixel available around the sprite. I'm looking into a way to do 1 outline using multiple sprites, such as having character with different hair style and clothes and 1 outline around the overall character.. I can do that easily with surface but a shader for it would be better I think if even possible.

  • @eggnog9230
    @eggnog9230 7 лет назад +1

    Shader only draws outline above and below the sprite, not left and right! Help please?

  • @billycraig9503
    @billycraig9503 3 года назад +1

    This has probably already been asked, but how do I go about adding a second outline around the first? And maybe even a third around the second? Etc?

  • @pargmaster
    @pargmaster 6 лет назад +3

    Compile error - fragment shader: at line x: ". comment lines out and it makes no difference. There's something bigger at play here, or something simple I've missed? All the code is entered correctly as far as I can see.

    • @ronanvankessel6329
      @ronanvankessel6329 6 лет назад

      You are probably missing a *;*. it wont be in the line where it says 'at line x' but often a different line.

    • @321Tdog
      @321Tdog 6 лет назад

      @@ronanvankessel6329 worst debug error ever

    • @mulatdood
      @mulatdood 6 лет назад

      I got the same thing. I have no idea what went wrong and no idea how to fix it. So I'm basically going to give up on shaders for now and do some other workaround. If I can't make the most basic one work I certainly can't do anything more complex.

    • @321Tdog
      @321Tdog 6 лет назад

      @@mulatdood Hey man, double check and triple check the variable names in your code. Was a really tiny thing I missed...

  • @felixbaltazarpaulsen
    @felixbaltazarpaulsen 5 лет назад +1

    Help me understand, please. Since the alpha variable is the sum of the ceiled surrounding alpha, wouldn't alpha > 1 if more than one surrounding pixel has an alpha > 0?

  • @Trainz2950
    @Trainz2950 7 лет назад +14

    Now I just need to figure out how to change the outline's color in code..

    • @nikaman9539
      @nikaman9539 5 лет назад +10

      @Schlingelkron You madd n00b? git gud then

    • @Jt9393synyster
      @Jt9393synyster 4 года назад

      @@sukedent1 thanks!

    • @laszloeszik5033
      @laszloeszik5033 4 года назад

      @@sukedent1 This code, with the suggested modification just works fine, thanks :)
      I wonder how to make an outline which is always 1 pixel wide even when you start to scale the image... I will try to do that, but knowing my knowledge with shaders will fail soon, and I would use that for a gamejam. :D

  • @AdaZoul
    @AdaZoul Год назад +1

    Not works for me, why? T.T
    Error in compile : alpha += ceil( texture2D( gm_BaseTexture, v_vTexcoord - offsetx).a; (in Shader.fsh)
    'String not found: na linha 1 : HLSL11 compiler failed with exit code -1'
    What can it be? I tried in the latest version and LTS.

    • @Oomgh
      @Oomgh Год назад

      I got the same error. :( Did you ever find a solution?

  • @joeford4081
    @joeford4081 6 лет назад +1

    Hey Shaun, QQ: If i'm using a single object to draw two different sprites on top of each other, is there any way to modify this shader to only draw an outline around their combined silhouette? For example, let's say your ghost was holding a sword that was drawn on top of him/her. I don't want the shader outlining the entire sword, but only the parts of the sword that protrude outside of the ghost's own outline. Thoughts? Thanks for all the help!

  • @noba4160
    @noba4160 7 лет назад +2

    Great video. When is your next platformer video coming out? ;)

  • @VaughnCampbell
    @VaughnCampbell 6 лет назад +1

    Great video! I am curious if you can use this methodology to draw vertexes that take up whole pixels in the game (8 bit game scaled 3x), rather than sub-pixel lines.

  • @cesardoga
    @cesardoga 6 лет назад +1

    this still works on current GMS2?, it didn't for me! it seems that you need to initialize those vec2, since otherwise the other value can be random ie offsety.x can be anything (it can serve as a noise effect tho)

  • @greenagon
    @greenagon 3 года назад

    gamemaker refuses to let me disable automatic cropping. every time I run the game it automatically re-enables it.

  • @sintoorak8508
    @sintoorak8508 7 лет назад +7

    we need to give this ghost a name...

  • @joaquimjesus6134
    @joaquimjesus6134 7 лет назад

    i'm testing your code on GMS 1.4x but the outline isn't showed.. why that happen?
    i see that we can change the thickness, but the color can be changed too?

  • @oseriduun
    @oseriduun 7 лет назад +3

    First, thanks for another awesome video..
    I'm curious how one would use this to outline text, or is it just easier/better to draw the text shadow, then redraw the text overtop of it? (thought maybe the shader would be better to use, and have multiple uses not limited to just the text)

  • @lildgamedev6885
    @lildgamedev6885 4 года назад +2

    this works really well and makes the enemys in my game look way cooler! only thing is with one of my enemys in particular, certain sprites of his freaks out a little and has like a really thick outline randomly. anybody have any idea why this could be?

    • @zheckman89
      @zheckman89 2 года назад +2

      2 years late, but yes. It's because your sprite is being atlas'd behind the scenes. The quickest way to fix this would be to go to Tools > Texture Groups and uncheck "Automatically Crop" for the Default group. You can play around with this by adding new groups to gain some optimization back from GM2's atlasing, but this should fix the outline issue described.
      Sorry again for being 2 years late, I was asleep.

    • @lildgamedev6885
      @lildgamedev6885 2 года назад +1

      @@zheckman89 lmao thanks man im glad you had a goood nap

    • @MacAlmighty
      @MacAlmighty Год назад

      @@zheckman89 Bit of a necro, but this fixed the issue I was having with it not drawing on the sides of my sprites, thanks!

    • @Coda117
      @Coda117 Год назад

      Been researching this all day, Thank you! Solved my issue @@zheckman89

  • @ИванНекто-е2ч
    @ИванНекто-е2ч 7 лет назад

    I do not understand what I'm doing wrong.
    Pixel strokes are not all drawn. ((((

  • @reedmiller4654
    @reedmiller4654 7 лет назад +2

    great tutorial. how do I change the background color from black?

    • @reedmiller4654
      @reedmiller4654 7 лет назад +2

      oops i meant the outline color. If I want a white outline instead of black.

    • @jellroberts9249
      @jellroberts9249 7 лет назад +1

      The outline is drawn in whatever colour the transparent background of the sprite is. Even though zero opacity black and zero opacity white both just look like nothing, they are not the same. If you want a white outline for example, select the colour white in the sprite editor, and reduce the opacity to zero, then fill in the empty space around your sprite. Hope this helps.

    • @svenjorgensen5
      @svenjorgensen5 4 года назад +2

      @@jellroberts9249 There's gotta be a way to swap the color in the shader code rather than editing the hundreds of sprites in my game.

  • @CollinSpicerMusic
    @CollinSpicerMusic 7 лет назад +2

    I wanted to ask a question, but I don't want it to come across as sarcastic so this is a disclaimer XD
    QUESTION FOR CURIOSITY SAKE-
    Why would one create an outline in the shader this way as opposed to just doing it in the sprite index itself? Could you use this technique to draw the outline ONLY when, say, the sprite is behind an object (such as a tree or wall)?
    For example- say I wanted to have a yellow outline on my player object present itself only when there is something in the foreground so you can still determine where the player is on screen. Would this be a way you could do that?

    • @CollinSpicerMusic
      @CollinSpicerMusic 7 лет назад +1

      Shaun Spalding thank you for taking the time to reply. I love your videos!

    • @aves8964
      @aves8964 6 лет назад

      I wanted to ask a question, but I don't want it to come across as sarcastic so this is a disclaimer XD
      QUESTION FOR CURIOSITY SAKE-
      Why do people make that face? The face on your pretty lil mug.

  • @NickoTyn
    @NickoTyn 7 лет назад

    I would like to learn more about shaders. You can do so many cool effects with them, but I need to find the time to exercise and figure out and learn this shader language.
    For a start I would like to make a shader with which I could change the values of the color channels independently and maybe brightness and contrast.

  • @grapeshott
    @grapeshott 7 лет назад

    I was waiting for more shader tutorials

  • @MrHavik
    @MrHavik 7 лет назад +3

    First off, cheers for the tutorial! I'm getting ' Fragment Shader: sh_outline at line 19: " ' as a compile error, which doesn't explain much. The code I have is exactly the same as in the video. If I comment lines 18, 19 and 20 out it still gives the same error 'at line 19', even though there isn't anything there once commented out. I'm guessing this means the error is actually elsewhere but ... I can't find it! Any ideas?

    • @indistinctTalk
      @indistinctTalk 6 лет назад +3

      Make sure you've closed out all your brackets correctly; I ran into this error and on double checking noticed that I was missing a closing ")" after the ".a" while adding the alpha values. It might not be the case for you but this was my problem at least :)

  • @locki_dos
    @locki_dos 5 лет назад +1

    Shaun, can you please do a video on a Sinewave / vertical/horizontal oscillation shaders? because I want to make an earthbound like wavy background.

  • @maxavierpeterson2547
    @maxavierpeterson2547 6 лет назад

    Was the wavy shader code ever posted, or tutorialized?

  • @Oomgh
    @Oomgh Год назад

    Love your tutorials. I just tried this and pretty sure I checked and tripple checked all the syntax, and still getting an error
    Fragment Shader: shOutline at line 15 : 'offsetx'
    gment Shader: shOutline at line 15 : 'x'
    FraFragment Shader: shOutline at line 17 : 'offsety'
    Fragment Shader: shOutline at line 17 : 'y'
    String not found: at line 1 : HLSL11 compiler failed with exit code -1

    • @Oomgh
      @Oomgh Год назад

      DOh, never mind. had code error, variable had different capitalization from when being called

  • @tidywire423
    @tidywire423 7 лет назад +1

    Uhh.. Texture Groups is greyed out for me. :(

    • @Trainz2950
      @Trainz2950 7 лет назад

      Make sure you have one of your sprites in that window selected

    • @ihaveosteoporosis8607
      @ihaveosteoporosis8607 7 лет назад +1

      TidyWire Your profile pic goes exactly with your comment xD

  • @MyFinist
    @MyFinist 7 лет назад +1

    i can`t make work this shader for GMS 1.4. This must work or not?

    • @chuksk8592
      @chuksk8592 6 лет назад

      Мамкин Анархист this is GMS2

  • @ronifirst8076
    @ronifirst8076 7 лет назад +2

    I'm new to programing I programmed some really basic shader but as far as I can tell shaders are completely absolute, drawing an outline or a different shade of red isn't hard! I don't understand why any body would spend hours making a shader when they can draw it by hand in 5 minutes its really, really not that hard

    • @GlobalSingeing
      @GlobalSingeing 7 лет назад +3

      Variety. It's on the fly, so you could make cool effects such as change the lighting. If you had a red and blue light, do you want two separate sprite sets of slightly different colors, or one sprite and two shaders to change it endlessly? Also it gets more complex than this, there's lots of cool effects you'll NEED a shader to do such as wavy sprites.

    • @Ldinos
      @Ldinos 6 лет назад +1

      And also that helped me when I wanted to draw outlines on fonts!

  • @eslamahmed1000
    @eslamahmed1000 7 лет назад

    can you plz make a power up tutorial and its collison

  • @najwan3672
    @najwan3672 7 лет назад

    Can you make a tutorial on distortion shader tutorial?

  • @darryllim9037
    @darryllim9037 7 лет назад

    Just a quick question, why does the outline on some of my sprites show as white instead of black?

    • @jellroberts9249
      @jellroberts9249 7 лет назад

      The outline is drawn in whatever colour the transparent background of the sprite is. Even though zero opacity black and zero opacity white both just look like nothing, they are not the same. If you want a white outline for example, select the colour white in the sprite editor, and reduce the opacity to zero, then fill in the empty space around your sprite. Hope this helps.

    • @andresgrimminck8674
      @andresgrimminck8674 5 лет назад

      @@jellroberts9249 I tried this and didn't help :(

  • @kaspinator5265
    @kaspinator5265 2 года назад +1

    How do you make the outline thicker?

  • @Freefork
    @Freefork 6 лет назад

    I would subscribe if you promise to make a tutorial on how to make a shader that swaps colors! Like if I had a red sprite, how can I make it blue using a shader and ignoring image blend?

    • @Freefork
      @Freefork 6 лет назад

      Also, if the red object had green, the green will be completely unaffected by the shader due to the shader looking for only red to turn blue.

    • @MrKingJavo
      @MrKingJavo 5 лет назад

      @@Freefork You need to lookup Pixelated Pope's Retro Palette Swapper

    • @Freefork
      @Freefork 5 лет назад

      @@MrKingJavo I think at the time I was looking for a tutorial and the swapper you speak of doesn't teach me the code I was looking for.
      Thanks for the suggestion though!

  • @Ian_Boni
    @Ian_Boni Год назад

    how do I make it colored?

    • @hungp.t.9915
      @hungp.t.9915 Год назад

      there are two ways:
      1/ detect the outline pixels when they are transitioning from 0 to 1;
      ```
      void main() {
      vec2 offsetX; offsetX.x = u_pixelW;
      vec2 offsetY; offsetY.y = u_pixelH;
      vec4 texColor = texture2D(gm_BaseTexture, v_vTexcoord);
      float alpha = texColor.a;
      float original_alpha = alpha;
      alpha += ceil(texture2D(gm_BaseTexture, v_vTexcoord + offsetX).a);
      alpha += ceil(texture2D(gm_BaseTexture, v_vTexcoord - offsetX).a);
      alpha += ceil(texture2D(gm_BaseTexture, v_vTexcoord + offsetY).a);
      alpha += ceil(texture2D(gm_BaseTexture, v_vTexcoord - offsetY).a);
      if (alpha > 1.0) alpha = 1.0; // claim alpha
      if (original_alpha != alpha) {
      gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
      }
      else {
      gl_FragColor = texColor;
      }
      gl_FragColor.a = alpha;
      }
      ```
      2/ transparent pixels have a color of (0,0,0,0); use that to detect transparent pixels;
      ```
      void main() {
      vec2 offsetX; offsetX.x = u_pixelW;
      vec2 offsetY; offsetY.y = u_pixelH;
      vec4 texColor = texture2D(gm_BaseTexture, v_vTexcoord);
      float alpha = texColor.a;
      alpha += ceil(texture2D(gm_BaseTexture, v_vTexcoord + offsetX).a);
      alpha += ceil(texture2D(gm_BaseTexture, v_vTexcoord - offsetX).a);
      alpha += ceil(texture2D(gm_BaseTexture, v_vTexcoord + offsetY).a);
      alpha += ceil(texture2D(gm_BaseTexture, v_vTexcoord - offsetY).a);
      if (texColor == vec4(0.0, 0.0, 0.0, 0.0)) {
      gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
      }
      else {
      gl_FragColor = texColor;
      }
      gl_FragColor.a = alpha;
      }
      ```

    • @hungp.t.9915
      @hungp.t.9915 Год назад

      replace `gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);` with your color of choice

  • @lincolndog6502
    @lincolndog6502 6 лет назад

    Can you use DnD To use shaders

  • @gustavomiler378
    @gustavomiler378 4 года назад

    my outline gets cut out at straight edges :(

    • @berenfinlay3623
      @berenfinlay3623 3 года назад

      make sure your sprite image has some spare room beside it, if the image is drawn up to the very edge of the sprite there is not empty squares to check against!

  • @hitwalkhook3831
    @hitwalkhook3831 5 лет назад +1

    Why does mine not work?
    I tried to program it on my own then i failed then i tried it like you did and i failed. Then i literally copied someone else's in and still again... it didn't work.
    WTF?
    The problem is in the shader code according to gms2...

  • @oskarwoolston
    @oskarwoolston 2 года назад

    Very helpful

  • @jiricech2423
    @jiricech2423 7 лет назад

    What about the outline colour or width?

    • @jellroberts9249
      @jellroberts9249 7 лет назад

      The outline is drawn in whatever colour the transparent background of the sprite is. Even though zero opacity black and zero opacity white both just look like nothing, they are not the same. If you want a white outline for example, select the colour white in the sprite editor, and reduce the opacity to zero, then fill in the empty space around your sprite. Hope this helps.

    • @jiricech2423
      @jiricech2423 7 лет назад

      Thank you! :D

  • @Azaism
    @Azaism 7 лет назад

    What do you need to do to make this work in Game Maker 1? I already know that in the shader fragment code, "ciel" needs to be "max" instead. Besides that, I have followed everything else in this vid, but I get an error message telling that object.pixelH "not set before reading it". I definitely have uniform float pixelH; written in the shader fragment code right underneath varying vec4 v_vColour; just like yours.
    EDIT: I forgot to put quotes around "pixelH" in the create event. But now I'm having another problem. I was trying to do this to text, but no outline is showing up around the text. I am using font_get_texture instead of sprite_get_texture of course. But I'm not sure what else needs to be done.

  • @larryteslaspacexboringlawr739
    @larryteslaspacexboringlawr739 7 лет назад

    thank you for gamemaker video

  • @GogetaTutor
    @GogetaTutor 7 лет назад

    What function opens the android keyboard without using dialog box?

  • @jairoacosta8940
    @jairoacosta8940 7 лет назад +11

    I need that wavy sprite shader tutorial.
    Thanks

  • @thepigeon3355
    @thepigeon3355 Год назад +3

    This is my variant for color
    varying vec2 v_vTexcoord;
    varying vec4 v_vColour;
    uniform float pixelH;
    uniform float pixelW;
    void main()
    {
    vec2 offsetX;
    offsetX.x = pixelW;
    vec2 offsetY;
    offsetY.y = pixelH;


    float alpha = texture2D(gm_BaseTexture,v_vTexcoord).a;
    float is_empty = ceil(1.0 - alpha);

    alpha += ceil(texture2D(gm_BaseTexture,v_vTexcoord + offsetX).a);
    alpha += ceil(texture2D(gm_BaseTexture,v_vTexcoord - offsetX).a);
    alpha += ceil(texture2D(gm_BaseTexture,v_vTexcoord + offsetY).a);
    alpha += ceil(texture2D(gm_BaseTexture,v_vTexcoord - offsetY).a);

    gl_FragColor = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );

    vec4 outline_colour = vec4(0.2,0.4,0.8,alpha);
    gl_FragColor = mix(gl_FragColor,outline_colour,is_empty);

    • @jasoncraig4387
      @jasoncraig4387 Год назад +1

      Thank you!!! I was not looking forward to changing the background color on every sprite in my game to the desired outline color. Much appreciated!

    • @Olivia_meoww
      @Olivia_meoww 9 дней назад +1

      i love you so much
      the shader was only shading at the very top, bottom, left, and right of the sprite and this one works with also letting me use colour. also jinx pfp >o

    • @thepigeon3355
      @thepigeon3355 6 дней назад

      @Olivia_meoww I'm very happy!!

  • @swearingencj
    @swearingencj 2 года назад +2

    Some update totally mangled this shader up

    • @jakkonexus1166
      @jakkonexus1166 2 года назад

      I was wondering if i was making mistakes but after creating a blank project just to test it, and still not working i feel like this doesnt work anymore on recent Gamemaker studio 2 (free).

  • @madparadox2361
    @madparadox2361 Год назад

    não entendi

  • @rose-su7nd
    @rose-su7nd 4 месяца назад

    Thhhhhhxxxxxxxxx brooo

  • @358thorn
    @358thorn 7 лет назад +1

    That's odd. I subbed to you, but i didn't get this in my sub box.

  • @swim.1395
    @swim.1395 7 лет назад +1

    Can you make a sonic game tutorial

    • @swim.1395
      @swim.1395 7 лет назад +2

      Like with boost and stuff

    • @t8ble498
      @t8ble498 6 лет назад

      Do a normal platformer, then add a momentum effect, I'll reply again once I come up with something that should help.

  • @hungp.t.9915
    @hungp.t.9915 Год назад

    shader_set_uniform_f_array() accept an array instead of scalar now:
    ```
    shader_set_uniform_f_array(_upixelH, [_texelH]);
    shader_set_uniform_f_array(_upixelW, [_texelW]);
    ```

  • @haywiregamestudios311
    @haywiregamestudios311 7 лет назад

    Hi there. We are currently developing a game, 'A Matter of Time', using Gamemaker. It would be awesome if you could check out the game's trailer on our channel, and even better if we could receive feedback on it! Thank you!

  • @sintoorak8508
    @sintoorak8508 7 лет назад +2

    first!