原文地址: 使用VBO優化圖像
使用OpenGL中的VBO, 對圖像性能進行優化。app
This assignment is intended to introduce students to graphics performance, measurement, benchmarking and optimisation, primarily through the use of more modern, performant approaches, in particular vertex buffer objects (VBOs) along with associated APIs. It is also intended to introduce SDL for UI and event handling instead of GLUT, although not for performance reasons, but to use an industry strength cross platform library and to see the details of a main interative loop such as provided by glutMainLoop.iview
The assignment may be undertaken in pairs or individually. By undertaking the assignment in pairs students can gain deeper understanding by discussing performance results they observe.ide
In computer graphics - real-time applications in particular - performance is always of interest, or, more accurately, image quality and performance tradeoffs: better images take longer - but how much better for how much longer. In this assignment techniques for improved rendering performance using buffers are used and measured.oop
In the I3D assignments procedural generation was used for shapes and surfaces, possibly a water surface or terrain or other objects in the scene. For investigating graphics performance, this assignment also uses procedurally generated objects, specifically a 3D sine wave, or sum of sine waves, similar to that used in the 'Frogger' assignment in Interactive 3D Graphics semester 1.性能
There are three components to the assignment:優化
There are suggested placeholder functions for implementing the other rendering modes including stored arrays (SAs), VAs and VBOs. To implement VBOs a step wise approach where first stored arrays are used, then vertex arrays then finally vertex buffer objects.ui
All performance measurements are to be done in the Sutherland Lab locally - so that results can be compared - and the aim is that much of it can be done in tutorial time.this
The assignment requires you compare peformance of immediate mode (IM) using complete recomputation (CR), as was done in Interactive 3D Graphics, with several techniques up to using modern vertex buffer objects (VBOs) for both static and animated geometry. Use triangle strips for rendering. Use one strip per column, and not one strip for an entire object. For VBOs use glDrawElements, and optionally glMultiDrawElements.spa
Your program should have a performance meter or 'perfmeter' as an on screen display (OSD) showing frame-rate, frame-time, tesselation and triangle-rate (triangles/second). The OSD can be implemented using GLUT.rest
The program should implement the following controls:
Measure performance and other impacts of:
Use 1920x1080 (HD) resolution with the OSD turned off - print to the console instead.
As part of the investigation you are specifically required to find how many lit shaded triangles (polygons) can be drawn at a 'real-time frame rate' of around 30 fps, i.e. in 1/30th of a second using the fastest rendering approach.
You are also to specifically find how long a wave shape with 1-2 million polygons (triangles) takes to render.
An optional aspect, for higher credit, is to modify the program so that a steady frame rate of around 30 fps is drawn whilst varying rendering mode and parameters. Use a main loop with an idle function as discussed in the SDL lecture. In the 'idle' routine game logic would normally be peformed including game logic, AI, physics, etc but for this assignment idle() should just sleep (use nanosleep()).
Another optional aspect is to use just one strip per object, including the use of dummy vertices. Check the rendering in wireframe mode.
For each question an answer 1-2 paragraphs, in some cases just a sentence.
You are encouraged to ask for help if you have any problems, especially in tutorials, but also including using the online channel. Good luck.
Before you submit anything, read through the assignment specifications again carefully and check that you have followed all instructions. Your code must be written in either C or C++ use SDL and compile and run on the Sutherland machines using either gcc/g++ or clang/clang++.
You must submit all source code, as well as a readme file and performance investigation as a tar or zip archive. If you have worked in pairs only submit one assignment but specify both group members in your readme file.
Submit via Canvas.
Note: subject to (minor) change
(本文出自csprojectedu.com,轉載請註明出處)