texture mapping

hello,when we do texture mapping ,the graphic hardware do the interpolation of the sample point ,then put samples to the frame buffer.is it right? then i want to get the value after hardware interpolation to the computer main memory.how to do it ? thank you very much!!

i guess what you need is

glReadPixels(x, y, 1, 1, GL_RGB, GL_FLOAT, values);

to read the RGB pixel values from screen position
(x/y) into an array

GLfloat values[3];

the ones after x,y are the width/height. you can
read the color values of only one pixel by setting
width/height to 1, but you can read the values of
a rectangle, too.

But bear in mind that this will be mostlikly a lot slower than doing the interpolation on your own.

indeed. but glReadPixels is very easy to implement.

if accuracy is a concern, it may be better to
use a bilinear interpolation algorithm. this
would give better results than opengl, which
normally uses a linear algorithm.

I think you mean bicubic interpolation since OpenGL (and all 3d hardware, except some ancient chips) does support bilinear interpolation, but yes, it will give better results.

sorry do you mean read pixel from frame buffer to main memory? i want to read the hardware inpolation result to the main memory, then do after some work ,put them to the frame buffer.could you please give me some advice?thank you !

sorry do you mean read pixel from frame buffer to main memory ? i want to read the hardware interpolation results to the main memory in CPU, then do some work ,and then put them to the frame buffer.could you please give me some advice?thank you !