Better three colors gradient

Three colors gradient is not exactly new subject, but known solutions revolving around affine transformation of right triangle have this annoying problem: color interpolation is different on one edge. This problem vanishes if we use barycentric coordinates to  interpolate color:

Check out this new shader and demo source (see also this post for bender-less implementation).

With this better method available, next question is exactly how much better is it. Following Nicolas’ example, I used random delaunay mesh with colored vertices to see how well would different triangles blend. It appears, however, that triangles edges are still easily noticeable, even though colors now match perfectly :( I guess this is unavoidable with independent triangle gradients. Well… something to think about later; two posts per night are more than enough.

2 Responses to “Better three colors gradient”


  1. 1 nicoptere October 23, 2010 at 02:30

    why is there no sound?


Ask a Question

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Old stuff

March 2010
M T W T F S S
« Feb   Apr »
1234567
891011121314
15161718192021
22232425262728
293031  

Oh, btw…


%d bloggers like this: