Re: Texture colour wrapping

Henry Gomersall <[email protected]>
Newsgroups gmane.comp.python.opengl.user
Message-ID <1320517413.16748.4.camel@farnsworth>
On Sat, 2011-11-05 at 12:14 +0000, Brice Thurin wrote:
> I am getting the phase map as 2D numpy array in polar coordinates. And
> i need to display this phase map not as a square but as a disk, which
> i can do with texture mapping. The phase map has type float and i want
> the grayscale to be ranging between 0 and 2ð and not between -15ð and
> 15ð. I have tried to apply the grayscale "wrapping" before the mapping
> but it does not lead to satisfactory result, I believe applying it
> after the polar to cartesian is better. It is how it is currently done
> with the CPU but I am interested to implement it on GPU.

It should be fairly trivial to write a shader to do this, either by
computing it directly or using an indirect texture lookup, since your
phases are well defined to be in the range -15pi to 15pi (that symbol
was meant to be pi right?). Someone more competent that I am could
surely tell you which would be the better option to use in this case
(and I'd be interested to know the answer!).

Cheers,

Henry


------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users
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.