@@ -248,7 +248,11 @@ void frame_allocate_objects(ObjectRef<Frame> frameObj)
248
248
gl.BindFramebuffer (GL_READ_FRAMEBUFFER, frameObj->fbo );
249
249
gl.BindBuffer (GL_PIXEL_PACK_BUFFER, frameObj->colorbuffer );
250
250
gl.ReadBuffer (GL_COLOR_ATTACHMENT0);
251
- gl.ReadPixels (0 , 0 , width, height, GL_RGBA, GL_UNSIGNED_BYTE, 0 );
251
+ if (frameObj->colorType == ANARI_FLOAT32_VEC4) {
252
+ gl.ReadPixels (0 , 0 , width, height, GL_RGBA, GL_FLOAT, 0 );
253
+ } else {
254
+ gl.ReadPixels (0 , 0 , width, height, GL_RGBA, GL_UNSIGNED_BYTE, 0 );
255
+ }
252
256
253
257
if (frameObj->sceneubo == 0 ) {
254
258
gl.GenBuffers (1 , &frameObj->sceneubo );
@@ -910,7 +914,11 @@ void frame_render(ObjectRef<Frame> frameObj,
910
914
911
915
gl.BindBuffer (GL_PIXEL_PACK_BUFFER, frameObj->colorbuffer );
912
916
gl.ReadBuffer (GL_COLOR_ATTACHMENT0);
913
- gl.ReadPixels (0 , 0 , width, height, GL_RGBA, GL_UNSIGNED_BYTE, 0 );
917
+ if (frameObj->colorType == ANARI_FLOAT32_VEC4) {
918
+ gl.ReadPixels (0 , 0 , width, height, GL_RGBA, GL_FLOAT, 0 );
919
+ } else {
920
+ gl.ReadPixels (0 , 0 , width, height, GL_RGBA, GL_UNSIGNED_BYTE, 0 );
921
+ }
914
922
915
923
if (gl.VERSION_3_3 ) {
916
924
gl.EndQuery (GL_TIME_ELAPSED);
0 commit comments