Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with creating a float pbuffer using CGL/AGL



Hi,
I have been trying to get a float pbuffer working on my powerbook (radeon 9600). I can create a pbuffer in either CGL or AGL without any problems, but they seem to be clamped between 0 and 1. They also are not full precision floats, even though the created pixel format is 128 bit and does use float pixels. The values read back are not, however, fractions of 255, which indicates they are some kind of fixed floating point values. The simplest test was to do a glClear with negative color values or values >1.

In linux i get the correct values from a readback if i create the context and the pbuffer using the glx commands for it, but in OSX they are clamped.

Is it possible to get non-clamped values from a pbuffer in OSX?

Here's the code i use to create the buffers with CGL. The agl version is almost identical.

CGLPBufferObj _hPBuffer;
CGLContextObj _hPBContext;
_hPBscreen;

activatePBuffer(){
CGLSetCurrentContext(_hPBContext);
CGLSetPBuffer(_hPBContext, _hPBuffer,
, , _hPBscreen);
}

createPBuffer( width, height){
CGLPixelFormatAttribute attribs[
];
GLint ind =
;
ATTR_ADD(kCGLPFAAllRenderers);
ATTR_ADD(kCGLPFAColorFloat);
ATTR_ADDV(kCGLPFAColorSize,
);
ATTR_ADD(kCGLPFAAccelerated);
ATTR_ADD(kCGLPFANoRecovery);
ATTR_ADD(kCGLPFAPBuffer);
ATTR_ADD(AGL_NONE);

nScreens=;
CGLPixelFormatObj pix;
CGLChoosePixelFormat( attribs, &pix, &nScreens );
CGLCreateContext( pix,
, &_hPBContext);
CGLError err = CGLCreatePBuffer(width, height, GL_TEXTURE_RECTANGLE_ARB, GL_RGBA,
, &_hPBuffer);
printf(
"Failed to create pbuffer? %i\n", err);
CGLGetVirtualScreen(_hPBContext, &_hPBscreen);
}

My glReadBack call is fairly standard:
], params[],GL_RGBA,GL_FLOAT,texture);

I have queried the GL_COLOR_FLOAT_APPLE enum, and it reports true, so i'm really not sure where i am going wrong.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.