GameMaker - Blend Modes, Surface-Alpha & Premultiplying Alpha

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

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

  • @seawitch9628
    @seawitch9628 3 года назад +6

    A solution I found from watching your video was using gpu blendmodes, I found that using
    surface_set_target(surface);
    gpu_set_blendmode_ext_sepalpha(bm_src_alpha, bm_inv_src_alpha, bm_src_alpha, bm_one);
    draw_sprite();
    gpu_set_blendmode(bm_normal);
    surface_reset_target();
    worked pretty okay

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

    found what i needed, as always. I do feel sorry for barely following and just copying the lines when I see on the video the effects i need, but i guess its better than nothing. I really felt it when you said "You can probably guess what's going to happen now". brah i have no clue.
    thanks again, you rock.

  • @ArseneGray
    @ArseneGray 9 месяцев назад

    Thank you very much for this video. I knew about blending from working with shaders 5 years long in my job but never assumed that the game maker 2 used some tricks to the normal application surface drawing in comparison to the custom surface drawing.
    This cleared it up for me and now I can blend not only stuff I draw on one surface correctly but also multiple surfaces correctly with each other.
    Subscribed!

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

    Excellent tutorial as always, Greg. I can't think of where I'd be able to begin when running into a problem like this.

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

    I was really losing patience with my project, but the best decision I made was take to time to understand this video.

  • @FoxyOfJungle
    @FoxyOfJungle 4 года назад +3

    Thank you so much!

  • @lunatunny7594
    @lunatunny7594 6 лет назад +4

    Thank you so much I learned a great deal from the first few minutes alone. Unlocked some more of the mystery of application surfaces as well!

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

    Wow. This is SO helpful you don't even know!

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

    excellent teaching

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

    excellent video, is there a way to make a part of my sprite invisible? Like a region? Or am I required to create surfaces?

  • @LegendarySSSparda
    @LegendarySSSparda 7 месяцев назад

    Oh god it worked, thank you!

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

    Wonderful tutorial. Really helped me out

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

    Unfortunately I downloaded the project and tried all of the solutions, and none of them could remove the alpha distortion drawn to my surface. So frustrating!

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

    Thank you a lot for all your video i've learned a lot. From what i understand the method which use premultiplied alpha doesn't work if you try do draw a sprite using "draw_sprite_ext" with an alpha set below 1, am i right ?

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

    I downloaded this project and switched the premultiplied text to an image I made myself - "version 5" doesn't work, even after checking "premultiply alpha". I was going crazy when I did a test project and I couldn't replicate your results at all. I wonder what causes this issue? Is there some new setting that has to be checked somewhere to get this working in newer versions of GM?
    My sprite seems to work fine with version 6 (the one with a shader). Very odd.

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

    If I want to use the shader approach (06), should the code be in a script that every object would call in their draw event? Or what would be the most sensible way to do it in a 2d game?

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

      Actually using a parent with the code in it seems to work ok, I'm using ds grid depth sorting so I can plug this in there too. Thanks for a great tutorial, I hope you do more in the future.

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

    Slowly scratches head.