tailieunhanh - Lecture Computer graphics - Chapter 7: Advanced OpenGL Topics
This chapter presents the following content: Animation using double buffering, display lists and vertex arrays, alpha blending and antialiasing, using the accumulation buffer, fog, feedback & selection, fragment tests and operations, using the stencil buffer. | Advanced OpenGL Topics An Interactive Introduction to OpenGL Programming 1 Advanced OpenGL Topics Animation Using Double Buffering Display Lists and Vertex Arrays Alpha Blending and Antialiasing Using the Accumulation Buffer Fog Feedback & Selection Fragment Tests and Operations Using the Stencil Buffer 2 An Interactive Introduction to OpenGL Programming 2 Animation and Depth Buffering Discuss double buffering and animation Discuss hidden surface removal using the depth buffer 3 An Interactive Introduction to OpenGL Programming 3 In this section we talk about adding the necessary steps for producing smooth interactive animations with OpenGL using double buffering. Additionally, we discuss hidden surface removal using depth buffering. Double Buffering 4 1 2 4 8 16 1 2 4 8 16 Front Buffer Back Buffer Display CPU DL Poly. Per Vertex Raster Frag FB Pixel Texture An Interactive Introduction to OpenGL Programming 4 Double buffer is a technique for tricking the eye into seeing smooth . | Advanced OpenGL Topics An Interactive Introduction to OpenGL Programming 1 Advanced OpenGL Topics Animation Using Double Buffering Display Lists and Vertex Arrays Alpha Blending and Antialiasing Using the Accumulation Buffer Fog Feedback & Selection Fragment Tests and Operations Using the Stencil Buffer 2 An Interactive Introduction to OpenGL Programming 2 Animation and Depth Buffering Discuss double buffering and animation Discuss hidden surface removal using the depth buffer 3 An Interactive Introduction to OpenGL Programming 3 In this section we talk about adding the necessary steps for producing smooth interactive animations with OpenGL using double buffering. Additionally, we discuss hidden surface removal using depth buffering. Double Buffering 4 1 2 4 8 16 1 2 4 8 16 Front Buffer Back Buffer Display CPU DL Poly. Per Vertex Raster Frag FB Pixel Texture An Interactive Introduction to OpenGL Programming 4 Double buffer is a technique for tricking the eye into seeing smooth animation of rendered scenes. The color buffer is usually divided into two equal halves, called the front buffer and the back buffer. The front buffer is displayed while the application renders into the back buffer. When the application completes rendering to the back buffer, it requests the graphics display hardware to swap the roles of the buffers, causing the back buffer to now be displayed, and the previous front buffer to become the new back buffer. Animation Using Double Buffering Request a double buffered color buffer glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); Clear color buffer glClear( GL_COLOR_BUFFER_BIT ); Render scene Request swap of front and back buffers glutSwapBuffers(); Repeat steps 2 - 4 for animation 5 An Interactive Introduction to OpenGL Programming 5 Requesting double buffering in GLUT is simple. Adding GLUT_DOUBLE to your glutInitDisplayMode() call will cause your window to be double buffered. When your application is finished rendering its current frame, and wants
đang nạp các trang xem trước