Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

The shader can be used on anything rendered by the GPU. In this case, the usual approach would be to render everything you'd like to have the effect applied to into a new surface, which you would then draw with the shader active. 

Thanks very much!

(1 edit)

I know it's a big ask, but if you know how to do this for GM2, would you mind demonstrating? You're probably a busy man, so I understand if you'd rather not.

Hi! There's a simple GMS2 example included in the project that demonstrates the usage of the shader with little code.

(1 edit)

I saw, it looks great! But I was wondering if I could apply it to only a single object. I'm new to coding and GM2, I managed to get it to draw onto a surface, but the surface seems to be acting as a sort of window looking into a glitch effect that is the size of an entire screen.

I asked on the Gamemaker 2 forums, but nobody seems to know how to apply it to a single object.

The goal was to have an enemy glitch when they're shot, and I really want to use your shader for it, since it has so many options!

So basically, the issue is that the edges are getting cut off, even though my surface that I created is bigger than the object I want to draw the shader over.

Upon further experimentation, I realize that the shader must have a solid color to draw over, even if the shader is applied to a greater area it will not glitch anywhere that is transparent. I can work around this, thank you for the amazing shader!

The shader is only meant to be applied on surfaces, though you might have luck with sprites, assuming they're on their own separate texture page and provided there's enough empty space around them for the various texture shifting effects to be properly rendered. Also, the shader will work just fine with or without standard alpha blending, there aren't any special requirements in regards to that.