Sign in to follow this  

look up table

This topic is 4550 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

Hello, I am simulating corrosion with particles. I adjust the color of a particle according to his life time. If a particle is dead, it get black and i use alpha channel to simulate holes in the surface. But how can i use a lookup table, to find colors according to the life time of a particle? I got the colors from real life images of corrosion. According to his lifetime i have to choose one of them. How longer a particle lives, how darker brown it get.

Share this post


Link to post
Share on other sites
The easiest way to do it is to use a 1D texture. You create your lookup table as a texture 1 pixel high by N pixels across, going from initial time at the left to 'maximum' time at the right (the end of your table). When rendering, divide the life of your particle by the maximum time represented by your texture, and use the resulting 0..1 value as a texture coordinate. You get interpolation between neighbouring entries for free which can be quite nice.

Share this post


Link to post
Share on other sites

This topic is 4550 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.

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