On Sat, Apr 12, 2008 at 3:01 PM, Zachrahan <[EMAIL PROTECTED]> wrote:
>
>  Thanks, Alex, for the help and suggestions! Hopefully the video card
>  on the microscope machine can handle large, rectangular, non-power-of-
>  two textures, because it sounds like that will make my life the
>  easiest...
>
>  I was initially thinking of doing the tone mapping on the textures
>  (all I need are controls for min/max pixel intensity and maybe a
>  gamma) with the glPixelTransfer and glPixelMap functions, which would
>  modify the intensity values when uploading the texture. But then the
>  texture-upload would need to be repeated each time the brightness/
>  contrast mapping changes. I guess the middle road is to upload the
>  image as an "original" texture, and then copy it around the video
>  memory with glCopyTexImage or similar, which will apply the pixel
>  intensity transforms set by glPixelTransfer and friends.

You'll need to somehow get the image into a texture as 16-bit data if
you do this.  Not impossible, but not something I'm familiar with.
Check out articles on HDR imaging for sample code, I imagine.

>
>  Perhaps most straightforward would be doing the mapping at render-time
>  with a shader, except that I have no idea how to do that in practice,
>  or what the level of support for this sort of thing in pyglet is. I do
>  see the "shader.py" code in the "experimental" directory in SVN, but I
>  don't know how robust that is -- especially for things like "uniform
>  variables" which look useful for changing the intensity mapping
>  parameters on-the-fly.

Writing shaders with pyglet is currentyl no more or less difficult
than writing them with, say, plain C and GLUT.  Besides the
experimental/shader.py code, there are some other pyglet projects
floating around that have some code you can get started with.

Tone mapping with just brightness/contrast would be a very simple
shader to write.

>  Given the current state of pyglet, are any of these approaches more or
>  less reasonable? Or is this basically an openGL question at this
>  point, not a pyglet one?

Pretty much.  If you haven't already, I suggest now is the time to
purchase the Red and Orange books (OpenGL and GLSL programming
guides).

Alex.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to