Jump to content
  • Advertisement
Sign in to follow this  
David Burford

dissolve effects (shader) on an image

This topic is 554 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

Im having a little bit of a mind block when it comes to 2d image effects in a shader and struggling to find resources that focus on this aspect of shader programming.

In this case for example I'm imagining an effect where an image is displayed and starts falling apart pixel by pixel from the bottom (perhaps as if the bottom of the image was being turned to sand, each pixel increasing in velocity until it is off the screen) but due to my lack of experience I am unsure how to implement this in a shader.

Has anyone any advice? I do know the basics such as semantics etc and can generally read shader code.

Thanks!

Share this post


Link to post
Share on other sites
Advertisement

There's a range of things you could do, I assume you are talking about the Doom style fade effect between levels?  You could setup a basic sand simulation inside a compute shader, you'll basically flip between two targets, read the source, run the simulation, write the results to the destination, then flip them and run again next frame.  Each pixel becomes a particle with a color and starting position, then just apply gravity.  If you add a pass to each particle, you can setup a gradient so that the bottom pixels are heavier (fall quicker sooner), and add a random weight factor across the board (or based on average/max/etc color) so that things don't fall uniformly.  Then each particle gets set back as a pixel on the destination, and anything blank gets cleared out using alpha (or color keying/etc).

Edited by xycsoscyx

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!