Question

So let's say that I have a large VBO that's larger than the screen that contains tiles, can I draw the whole VBO without losing any performance, or is there a method to only draw a sub part of the VBO that fill fill up the screen? Will the VBO take up a large part of the VRAM? The pros of VBO is the speed.

Was it helpful?

Solution

VBOs are just memory pools dedicated for holding vertex data. Nothing more, nothing less. It's prefectly possible to populate a single VBO with separate geometry data. It's even possible to have multiple data sets with different data layouts in a single VBO.

Only when you assign offsets into VBOs to vertex attrubutes using the gl…Pointer functions you add some meaning. The right gl…Draw calls will then make OpenGL take data of the VBOs and submit them for drawing.

It's nothing more and nothing less. So why am I telling you this? Because the notion of a "VBO being bigger than the screen" makes no sense. Portions of the geometry described by the data within a VBO may be outside the clipping region. OpenGL honestly doesn't care. It will just treat like all the other data. Only after the vertex transformation stage, if a primitive lies outside completely outside the clipping region, it will be omitted from rasterization. But it will pass through the whole vertex setup phase, hence consuming computation power.

Will the VBO take up a large part of the VRAM?

A VBO is a part of the VRAM (dedicated for holding vertex data). That's the whole point of it. OpenGL buffer objects are memory pools reserved from the fast memory (and for all practical means fast memory equals VRAM). Period.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top