Re: Difficulty with the shaders tutorial

Derakon <[email protected]>
Newsgroups gmane.comp.python.opengl.user
Message-ID <CA+Qo5j6=CKJ5BEkwxzEbKgK14yBqvHu4kTWNgoo5JzO07RyyFQ@mail.gmail.com>
On Fri, Feb 17, 2012 at 12:39 AM, Nicolas Rougier
<[email protected]> 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

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.