Further discussions on VBO and displaylists

Source: Internet
Author: User

The previous discussions about VBO and displaylists are not very detailed. Now I want to repeat them. However, note that my test results are provided without viewing frustum culling.

AboutDisplay listAndVBO

Display list

SetOpenGLCommand to compile, save on the video card, and allow to saveVertex Array

Advantages:

Graphic rendering and data managementOpenGLToOpenGLBrings more optimization opportunities, andDisplay listsIt can be stored in the video card to avoid the bottleneck caused by data transmission on the bus. In addition, you can useDMAPassed to the video card for drawing, reducedCPUAnd batch data and commands can be transferred at one time.

Disadvantages:

Excessive StorageOpenGLThe command will increase the memory burden (this also requires testing specific numbers)

Compilation time is too long

Static onlyGeometry(That is, eachDisplay listThe list of drawn triangles will not change)

Test found, pre-allocatedDisplay listsThe Length Change does not affect the speed, provided that the number of triangles drawn per frame does not exceed a bottleneck. In this way, the pre-createdDisplay listsAs long as the number does not exceed the System Bottleneck (?). The speed is actually affected.Display listsNumber, or the number of triangles drawn per frame.

Comparison found that,VBOThe efficiency will followVBOThe actual usage increases sharply. EspeciallyVBOsWhen the occupied space exceeds the Display memory, there is data transmission between the memory and the existing one, which will lead to a bottleneck.

UseDisplay listsThe maximum number of triangles drawn per second can be close 100 m , And keep40Frame/Second or higher frame rate, but useVBOThe maximum number of triangles drawn per second 30 m Left and Right, Frame Rate15Left and right.

Vertex Array

Transfers and draws data in batches to reduce the call parameters of a single drawing command,CPUAndGPUThe bottleneckOpenGLProgramIs not recommended.

VBO

VBOIs included inOpengl1.5An extension is designed to combineImmediate Mode, displaylistAndVertex ArrayAnd avoid their own shortcomings. The most exciting thing is that data can be fully storedVBOToOpenGLManagement, but also provides a more additional function, without affecting data transmission efficiency, dynamic changeVBO.

What makes me puzzled at the same time is that during the test, we found thatVBOI have not significantly improved the expected performance.AlgorithmRepeated tests inDisplay listsComparisonVBOThis will greatly improve the efficiency.

In my tests, when the number of triangles drawn per frame is smallVBOsAndDisplay listsBut when the number of triangles drawn per frame increases gradually,VBOsThe speed will drop sharply, andDisplay listsThen it remains stable. Knowing that the number of triangles on a data level will reduce the speed.

Issues to be studied:

First:Display listsWhich factors are related to efficiency?

 EachListNumber of triangles to be drawn.ListsTotal

Second: ImpactVBOWhat are the main factors for speed decline?

EachVBONumber of triangles stored, simultaneously drawnVBOsTotal,Frame Size

Third: AnalysisDisplay listsPerformance exceedsVBOWhy?

VBOEach frame is rendered in a state transition (State-change), Resulting inCPUToo much interference and data re-transmission?

What are the differences between the two in formation implementation? New Video Card pair?VBOIs the support better?

Existing hardwareVBOSupport:Hardware-supportAndSoftware-support

Fourth: we need to redesign it.VBO ArrayAndDisplay list ArrayScheduling algorithm, the originalFIFOInefficient, consider usingLRUAlgorithm. In short, make sure thatChunckA small number of unnecessaryVBOOrDisplay list. Especially in useVBOTheVBOIf the number is too large, it will cause insufficient memory and greatly affect the system performance.

Fourth: memory consumption

UseVBOThe largest memory consumption, followedDisplaylistAnd finallyImmediate

UseNVIDIA gdebuggerTest found, useDisplay listThe consumed frame storage isVBOHalf of the cost.

Key Problem: When the terrain data volume is huge, the terrain with the same level of details will be drawn, in order not to re-generate a newVBOAnd maintainedVBOThe number of arrays increases dramatically, leadingAGPMemory usage increases. WhenAGPWhen the memory is insufficient, useVBOOrDisplay listThe performance advantages are not shown.

However, tests show that dynamicVBOSpeed is betterImmediate Mode.

Note: Disable vertical synchronization in the display settings. Otherwise, the maximum value isFPSThe maximum update rate is not exceeded.!!!

Follow_modeAndFly_modeThe test results are different. The former has not been reduced, so all Triangles must be drawn.VBOAnd do not useVBOLittle difference in efficiency. HoweverFly_mode,VBOThe performance is significantly higher than that of non-VBO.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.