Re: [PyOpenGL-Users] Difficulty with the shaders tutorial
Brought to you by:
mcfletch
From: Derakon <de...@gm...> - 2012-02-17 21:44:18
|
On Fri, Feb 17, 2012 at 12:39 AM, Nicolas Rougier <Nic...@in...> wrote: > > > No need to go for OpenGL 3.0 to use shaders. > > Here is code that do what you want (translated from glumpy): > > Color are transformed using the alpha channel of the image (see fragment code) and the color lookup table is a 1d texture. Fill it with any color sequence you want. > > Nicolas > That did it! I have working false-color now; all that remains is to integrate it into the rest of my program. For what it's worth, the color sequence I used does the following ramps (percentages indicate distance along the texture): Red: 0 at 35% to 1 at 67%, held through to 86%, down to .5 at 100% Green: 0 at 10% to 1 at 39%, held through to 61%, down to 0 at 90% Blue: .5 at 0% to 1 at 10%, held through to 31%, down tot 0 at 65% This starts at dark blue, then goes to cyan, green, yellow, orange, red. I got the percentages by manually examining the output of using matplotlib's savefig function. -Chris |