Texture buffer or frame buffer?

Started by
2 comments, last by V-man 15 years, 3 months ago
In the red bible I can only find documentation about a framebuffer. But I have also heard that there is something called a texture buffer, what are the difference between a frame buffer and a texture buffer? I need to render a frame to a texture so I assume that I need the texture buffer and not the frame buffer. Are there any tutorials around regarding how to write a frame to a texture?
Advertisement
Yes, there is one here on gamedev.net....somewhere

there is also sample code here
http://www.opengl.org/wiki/index.php/GL_EXT_framebuffer_object
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Thanks, but are there any difference between a texture buffer and a framebuffer?
That's an GPU implementation detail which GL doesn't care about.
Usually, the framebuffer is layed out in a linear format, very much like a bmp file. A texture, there might be arranged differently
http://www.opengl.org/wiki/index.php/Texture_Mapping

Quote:GL_TEXTURE_2D has width and height and usually the GPU stores this in memory in a format that is quick to access.
For example, small blocks of the texture are stored in sequence so that cache memory works better. This has been part of GL since 1.0
Texture coordinates are normalized. That means if you have a dimension like 256x256, texcoords are from 0.0 to 1.0.
Of course, if you go beyond that, such as -1.0 to 5.0, then the texture will repeat over your polygon.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement