Re: [PyOpenGL-Users] Texture colour wrapping
Brought to you by:
mcfletch
From: Henry G. <he...@ca...> - 2011-11-05 18:23:41
|
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 |