Features of OpenGL VBO in C ++

I am a little confused about the proper use of VBOs in an OpenGL program.

I want to create a swap algorithm using a map named from the gray color map 4096x4096, as a "whole" map.

From what I read, each vertex stored in VBO will occupy 64 bytes.

The problem is that most sources claim that one VBO should be within 1-4 MB, and fewer VBOs are better. However, according to my calculations, there will be a total of about a gigabyte of data to store each vertex! (4096x4096x64) This does not mean that each vertex can be stored several times for each triangle.

And this does not fit the various vehicles and people who will be on this map as soon as I get the portion of the code section that I worked out.

another solution that I looked at was to print data from the hard disk while the program was running, but another source says that it is a bad idea to create and destroy while the program is running, and that it is also best Suitable for as few VBOs as possible.

What do I really want to know that I am missing? I am sure that I am doing some huge oversight here because the maximum 4 MB VBO size seems very low, even if I load the texture into 64x64 blocks and various interactive objects that will fill the map.

Or is my expectation of what I can achieve simply unrealistic? Is there a better way for me that I don't know about? I look at games like Oblivion or Fallout 3, and to some extent the Boundless Planet, and see massive landscapes, and wonder how this is possible.

I understand how to code, this is not my first look at OpenGL, but this is the first time I am trying to understand and use VBOs.

If someone can shed light on where my understanding of VBOs goes wrong, it would be very appreciated.

+5
source share
6 answers

From what I read, each vertex stored in VBO will occupy 64 bytes.

, , .
position + normal + texcoords = 4 * (3 + 3 + 2) = 32
position + normal + texcoords + ( ) = 4 * (3 + 3 + 2 + 3) = 44

, .

. ( ). Bind buffer , glDrawElements glDrawRangeElements. , OpenGL - .

(4096x4096x64)

. (.. ), . - , . , . . , , "". .

, , VBO 1-4 , VBOs .

, . , , "". , DirectX ( OpenGL) ( ) ( VBO), , , . , "VBO 4 ", .

, API (ATI NVidia). , , ( ) , wannabe. , GDC, Siggraph, ATI, NVidia, . , "-", .

, , Microsoft : " Windows Titles" " (Direct3D 9)" ( DirectX, OpenGL).

, NVidia OpenGL, , (GLexpert , NVIdia OpenGL SDK ..). , , , . , .

, , ! (4096x4096x64)

, . , .

, Oblivion Fallout 3, Boundless Planet, , , .

. , "" . , . .

+9

, . , 12 .

, .

, .

, , , , , , , VBOs, .

, , , . ; / - .

, - , VBO 4 , 6464 , .

64 ; 4MB 65536 . (256256) , , .

: OpenGL OpenGL.

+1

, VBO , , , . VBO, , , , , , .

, VBOs , VBO . , , , .

, , - , , , Chunked LOD. .

, . , , . / , , .

+1

, . 4096x4096, , . ( a.k.a.) , ( ).

. , (4 ) , , . (, , ), - , , 4096x4096. , , .

+1

/ , 4 VBOs, " ". , VBOs , / . "" , OpenGL , , .

0

All Articles