PDA

View Full Version : retrieving values from a cubemap...



gunslinger
07-15-2004, 05:33 AM
I was thinking to use a cubemap to store some normal-dependent values for the various vertices, when it came to my mind the question:
Is it possible to retrieve the data i stuffed into a cubemap from OpenGL apps?
I know it is possible from the shaders, but i need em into the application...

thanks enrico

JustHanging
07-15-2004, 05:39 AM
glGetTexImage?

gunslinger
07-15-2004, 06:04 AM
Originally posted by JustHanging:
glGetTexImage?don't think that would work with cube maps,
and by the way that would give me the entire tex,
while i'd like to have just on cell...

jra101
07-15-2004, 08:06 AM
glGetTexImage will allow you to get the individual faces of a cubemap. Just pass in GL_TEXTURE_CUBE_MAP_{POSITIVE|NEGATIVE}_{X|Y|Z}_AR B as the target parameter.

knackered
07-15-2004, 10:40 AM
It begs the question - you put the cube map there, so why do you need to retrieve it from the hardware resources? Surely keeping a copy of the data you sent would be the sensible choice here?

gunslinger
07-15-2004, 10:16 PM
Originally posted by knackered:
It begs the question - you put the cube map there, so why do you need to retrieve it from the hardware resources? Surely keeping a copy of the data you sent would be the sensible choice here?yep yurright
but it would heve been so nice to have all the commodities of the cubemap without having to build a custom algo for that.

JustHanging
07-15-2004, 10:53 PM
Of course you could draw the data to the back- or pbuffer and read it back using glReadPixels. You might lose some precision on 16-bit displays, though.

-Ilkka