Higher color precision
Hi.
I've been working on a water simulation that offloads physics calculations to the GPU for evaluation. I'm setting up a pixel buffer and binding it as the source for a texture object. It's in this texture that I hold on to data describing the water's surface (which gets updated/recalculated often).
As it is, I have 8 bits of precision per color component in the texture. I'm getting passable results, but it's really less accurate that what I need.
What I'd like is to have 16 or 32 bits per color channel in this texture, but I'm really not sure how to achieve this. I see can ask for more bits per component when setting up the attribute for the pixel format I use when creating the context (AGL_RED_SIZE, etc.), but I always receive a pixel format with 8 bits per component. Apple also has AGL_COLOR_FLOAT listed as a valid extended attribute for pixel formats ("Color buffers store floating point pixels instead of fixed point values"), but using that seems to give me very, very nasty results (kernel panic).
I'm entirely unsure about what I need to do, here. Any suggestions/helpful hints are much appreciated! Thanks guys.
I've been working on a water simulation that offloads physics calculations to the GPU for evaluation. I'm setting up a pixel buffer and binding it as the source for a texture object. It's in this texture that I hold on to data describing the water's surface (which gets updated/recalculated often).
As it is, I have 8 bits of precision per color component in the texture. I'm getting passable results, but it's really less accurate that what I need.
What I'd like is to have 16 or 32 bits per color channel in this texture, but I'm really not sure how to achieve this. I see can ask for more bits per component when setting up the attribute for the pixel format I use when creating the context (AGL_RED_SIZE, etc.), but I always receive a pixel format with 8 bits per component. Apple also has AGL_COLOR_FLOAT listed as a valid extended attribute for pixel formats ("Color buffers store floating point pixels instead of fixed point values"), but using that seems to give me very, very nasty results (kernel panic).
I'm entirely unsure about what I need to do, here. Any suggestions/helpful hints are much appreciated! Thanks guys.
crikey, kernel panic ain't good 
Yes, AGL_COLOR_FLOAT is what you need. Note that it's only supported on Radeon 9500+ and GeForce 6800+ cards, with limited support for GeForce FX cards under Tiger only.
the extension spec:
http://developer.apple.com/graphicsimagi...ixels.html
some random code I found on the web:
http://petewarden.com/notes/archives/200...ffers.html

Yes, AGL_COLOR_FLOAT is what you need. Note that it's only supported on Radeon 9500+ and GeForce 6800+ cards, with limited support for GeForce FX cards under Tiger only.
the extension spec:
http://developer.apple.com/graphicsimagi...ixels.html
some random code I found on the web:
http://petewarden.com/notes/archives/200...ffers.html
What hardware and OS version are you getting a panic with?
What target are you using for the float texture (2D, RECT?)
What target are you using for the float texture (2D, RECT?)
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Normal Mapping Precision on iOS | OptimisticMonkey | 6 | 7,384 |
Apr 13, 2011 11:35 PM Last Post: OptimisticMonkey |
|
| ? Find color value of 'pixel' in color buffer? | Elphaba | 1 | 3,442 |
Jul 22, 2009 01:23 PM Last Post: Bachus |
|
| Poor precision in depth texture | TomorrowPlusX | 59 | 32,885 |
Jul 3, 2007 12:23 AM Last Post: Ciaran |
|

