• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

pix elated shift/fuzz shader for gamemaker?

S

Shadowblitz16

Guest
can someone tell me how to do a shader like this?

I like the game style and might do something like this..
 

NightFrost

Member
The base effect itself appears pretty simple, just an x-offset, though one that works at pixel increments. Since it is for the entire screen, you'd apply the shader at post-draw event when app surface is drawn to display. You'd disable automatic draw and do it yourself with the shader. The bigger problem I think would be to make it look good. The offset is not just some random noise, if it was it would look bad and unplayable. The offset might be sine wave base with some small randomness added. Could even be a precalculated array that is looped through. Although, it also could be 1D Perlin noise combined at several amplitudes and frequencies.
 

NightFrost

Member
Some added thoughts: since this is a full-screen effect that affects everything, you'd apply this to application surface draw, meaning you'll need to turn off automatic draw and do it manually while applying the shader. Easiest by making a separate controller object for this operation. Put the object into your first room and make it persistent. In its Create event issue application_surface_draw_enable(false) to turn off automatic drawing. Then add some code to Post Draw event. That event is used because in Post Draw, GMS sets the default draw target to your display, so when we take app surface and do a draw, it becomes visible. This normally happens automatically, but we turned it off so we can apply a shader to the operation. Simply set the shader (and any uniforms it may need), perform draw_surface(application_surface, 0, 0) and then reset the shader. You should try this without the shader first so you can confirm your code is correctly performing the manual draw operation.
 
Top