Sign in to follow this  

Paper burning

Recommended Posts

soconne    105
Here's a very simple way to simulate that.

Model your paper as a single quad, with 2 textures. 1 texture is the actual paper material itself, and the other texture is an alpha map that with transparency values for each location on the quad.

Initially set the alpha values in the texture to be all 1, so the paper is fully opaque. Then select a location to start a flame. That location on the texture should be given an alpha value of 0, then using some sort of algorithm, simply spread out from that point on the alpha texture and decrement the pixel values by some given amount each frame. This will basically simulate the paper looking like its fading away.

At the same time you can be coloring the corresponding pixels in the paper texture itself. Simply darken each one as you go along the alpha texture.

Share this post

Link to post
Share on other sites
Rasmadrak    196
or perhaps use and alpha image with the final burn and use glEnable(GL_ALPHA_TEST); with an increasing value....? :) that way you´d get crisp edges too, and if you want, you could even manipulate the colors of the paper with the burn alpha... i.e transforming the alpha values into colors that is...


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this