16-perf - Lecture 17 Performance Issue in Rendering...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 17 Performance Issue in Rendering
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
References 1. OpenGL Performance Tuning, John Spitzer, NVidia, 2003 http://www.opengl.org/resources/tutorials/gdc2003/GDC03_Performance.ppt 2. Performance OpenGL: Platform Independent Techniques, Dave Shreiner, SGI, 2001 http://www.opengl.org/resources/tutorials/s2001/perfogl.pdf 3. General Performance Techniques, SGI, 1997 http://www.opengl.org/resources/tutorials/advanced/kitchen/general_perf/index.html 4. Optimization for Real-Time Graphics Applications, Sharon Rose Clay, SGI, 1996 http://www.sgi.com/products/software/performer/presentations/tune_wp.pdf Note: #2 and #3 are more basic. #4 is very general and detail while #1 includes some very advance graphics rendering concept such as shader programming
Background image of page 2
Contents 1. Why Performance Tuning? 2. Verify your program! No Rendering Error! 3. Timing? Frame Rate? It’s all about time. 4. Graphics pipeline quick review 5. Identify the rendering bottleneck 6. Attack the bottleneck (transfer, transform, …) 7. Summary
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Why Performance Tuning? 1. Make your program runs faster! 2. Fully Utilize the Graphics Rendering hardware! 3. When your program runs fast, you can introduce better quality graphics! Note: The concept here not only applies to OpenGL, but also applies to Direct3D because the underlying graphics hardware is the same! The basic architecture of graphics hardware is the same (unless specially built).
Background image of page 4
Any Rendering Error? Note: • Both OGL and DirectX (Direct3D) do not actively alert you if an error occurs (e.g. glEnd without glBegin, invalid enum. input to a function, etc.) • Rendering could slow down significantly if error exists Solution: Use commands: glGetError and gluErrorString OR DXGetErrorString9 and DXGetErrorDescription9
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Any OGL Error? Add this to your header file: #define CHECK_OPENGL_ERROR( cmd ) \ { GLenum error; \ while ( ( error = glGetError() ) != GL_NO_ERROR ) { \ printf( "[%s:%d] ’%s’ failed with error %s\n“, \ __FILE__, __LINE__, \ cmd, gluErrorString(error) ); \ } \ } Note: There are many different kinds of GL error. See reference page of glGetError for detail.
Background image of page 6
Any OGL Error? Catch your OGL Error(s): > CHECK_OPENGL_ERROR(“here1”); > … your OGL coding … > CHECK_OPENGL_ERROR(“here2”); > … your OGL coding … > CHECK_OPENGL_ERROR(“here3”); Use it just like printf, e.g. if no error at here1, but error at here2. Then, your OGL error occurs between here1 and here2. This is a good practice for graphics programming!!!
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Timing? What is it? •F r a m e R a t e is the rate at which new images are drawn. •I t i s m e a s u r e d b y frame per second (fps) and entertainment applications require at least 20 fps (common: 30 fps) for smooth interaction. • Another important measure is
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/19/2009 for the course COMP 341 taught by Professor Qu,huamin during the Spring '09 term at HKUST.

Page1 / 32

16-perf - Lecture 17 Performance Issue in Rendering...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online