Shaun's Colour Dissolve Shader
A downloadable Shader
Create a real-time dissolve effect that can disintegrate or materialize any sprite using a size-matched black and white dissolve mask.
Different colours and masks can create many different effects!
Just two scripts and one shader. Demo includes above example masks + settings.
This asset is free for all of my Tier 3 Patreon supporters!
In order to download this Shader you must purchase it at or above the minimum price of $5 USD. You will get access to the following files:
DissolveShader GMS2 (yyz) 97 kB
DissolveShader GMS1.4 (gmz) 33 kB
Log in with itch.io to leave a comment.
Hi Shaun, is there any chance to update this shader to work with existing GMS2 versions. On import it converts the project as it's an "old format". Consequently the shader is now broken whereas before it worked flawlessly. Thanks buddy.
*** It was the VCREDIST exe needed from Microsoft ***
*** Not your code at all sorry :-) ***
For some reason, whenever I make an object dissolve away, the spots that should be empty are being replaced with whatever the 1st color is, making a flat color background instead of nothing. After setting the edge to 0, it turns out that the problem is that it isn't actually dissolving the sprite at all. The effect works properly in terms of the dissolve look, but it's only affecting the sprite's color without changing the alpha from 1 to 0. It works properly when dissolving objects back in, but not when dissolving them away.
Hey, does this work without color? I can't seem to get it to, I wanted it to look like the top row of your example gif here.
Edit: I figured it out! I have very limited experience with shaders so it took me a bit but, I found the one line of code to remove to make it just transparent. Thanks for this great shader resource!
I'm using this shader in my project and it worked fine. But images, processed by the shader, started to appear incorrectly, simply after I add a large sprite in my project. Not even after trying using the large sprite. Efforts to fix this were fruitless. Can you help me out, please?
After adding another sprite to the project, the bug was gone. I think the shader has some calculation problems - I guess, it works incorrectly when it takes a sprite from the game's texture sheet if processing the numbers of the texture's size can't give integer or something.
This sounds like a GameMaker cache issue. If importing a big sprite has caused your texture pages to be rearranged it might simply have confused GM's internal knowledge about where a sprite is kept on what sheet. The shader doesn't do *any* calculations as such when it comes to a sprites location or position. It just uses the built in GM functions for finding these things.
Try running the 'clean' option on your project, reloading the IDE, etc. As you discovered, simply adding another sprite was one potential fix.
I'm not discounting the possibility of it being an issue on my code's end but given that it doesn't manually interact with any texture sheet positioning I'm finding it hard to identify what an issue on my end could be.
PS. Apologies for such a late response, I only just caught your comment on one of my videos.
So I bought this, opened the read me and the first things was "turn off interpolate colors between pixels" and I was like nooooooooooo because I don't use pixel art. I tried it anyway. It works perfectly fine with it on. Not sure why it says to do that but it didn't crash and the effect looks great. I'm using 1.4x so maybe it's only with 2.0 that it doesn't work so well with interpolate on?
I was literally going to make this same shader which probably would have taken me days to figure out. $5.00 totally worth it.
It's been a while now and I can't remember the exact reason, but I believe it was to do with the effect not looking great in areas with mixed alpha. Glad it's working for you anyway!
Will this be available for GMS 1.4.x? I'd certainly purchase it if it was, as I'm sure others would too.
You know for some reason I thought it wouldn't work but I can't see why not? Will look into it asap.
Excellent news 👍
Just added this now!