PDA

View Full Version : PBOs and textures



pixelita
03-20-2011, 09:03 AM
Hi again

I have 2 questions regards Pixel Buffer Objects
1.In my terrain engine I use PBO to store a texture for currently loaded area. Now I would like to add terrain paging- when user navigates away then to load a new area. So after loading the new area I need to update the texture stored in PBO.
How to do that - by calling glTexSubImage2D(.. ) or glBufferSubData(...)

Do I need to bind both the texture and the pbo before updating (with glBindTexture(..) or glBindBuffer(..)?

2.Please help me to understand this statement from the RedBook regards glTexSubImage2D(..) :

From RedBook 7th edition page 408:

"
...Also, there are no size restrictions for
glTexSubImage2D() that force the height or width to be a power of 2.
(This is helpful for processing video images, which generally do not have
sizes that are powers of 2. However, you must load the video images into
an initial, larger image that must have 2n texels for each dimension, and
adjust texture coordinates for the subimages.)
"

Thank you very much in advance

Alfonse Reinheart
03-20-2011, 11:19 AM
In my terrain engine I use PBO to store a texture for currently loaded area.

PBOs do not store texture data. Texture objects store texture data.

PBOs exist to help you transfer texture data from your application to OpenGL. Once OpenGL completes the glTexSubImage2D call, the contents of the PBO are irrelevant.


Please help me to understand this statement from the RedBook regards glTexSubImage2D(..)

Looks like some old information that wasn't properly culled.

pixelita
03-21-2011, 01:48 AM
Thank you, it works now! I found nowhere better explanation of PBOs-texture relation then yours...

Alfonse Reinheart
03-21-2011, 03:54 AM
I put a more comprehensive writeup (http://www.opengl.org/wiki/Pixel_Buffer_Object) on PBOs on the wiki.

pixelita
03-22-2011, 06:17 AM
Alfonse, Hi

Since you aren't accepting private messages then I'll write it here
1.Thanks for PBO info on wiki
2.I started to read your amazing tutorial,it completes many holes and arranges all the newbie OpenGL chaos I have in my head...
And I wanted to inform you that I cant see many equation and figure images.

Alfonse Reinheart
03-22-2011, 11:31 AM
Since you aren't accepting private messages

I'm not? I didn't even know there was a setting to turn those off.


And I wanted to inform you that I cant see many equation and figure images.

You're probably using Internet Explorer, which doesn't support SVG. Upgrade to IE9, which does support SVG (though possibly not in <object> tags. I'm working on a solution for that).