Colormap 3

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Fri May 29, 2009 7:11 am

Hi!

I'm in your constructs, mapping your colors.

Here's how to do a particle emitter that goes through 3 colors instead of two:

Have a normal particle emitter. Have it go from black to white or from white to black.
Then apply colormap3 effect and set the 3 colors and position of the middle point.
Tada!

[url:28ysty1a]http://www.udec.cl/~jfuente_alba/colormap3.fx[/url:28ysty1a]
[url:28ysty1a]http://www.udec.cl/~jfuente_alba/colormap3_test.cap[/url:28ysty1a]

Can be easily extended to 4 or 5 colors, though I don't know how to make it so you can define the number of colors in the ramp. I'll soon extend to 4 and 5. That'll probably be enough.
Can someone check the shader code and see if I made any horrible mistakes in there? I'm quite new to shader code. Maybe the pixel shader version?
Now, if anyone can imagine a way to have this work with textured particles please do tell.
I can't imagine it without modifying the particle emitter to use a texture as a mask for it's own interpolated color.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 1 guest