1 / 5

OpenGL Visibility Detection Functions

OpenGL Visibility Detection Functions. Ravindra R Patil (15CS62 ). OpenGL Visibility Detection Functions. Back-face removal:. glEnable(GL_CULL_FACE); glCullFace(mode);. GL_BACK, GL_FRONT, GL_FRONT_AND_BACK. default. glDisable(GL_CULL_FACE);.

jonesgladys
Download Presentation

OpenGL Visibility Detection Functions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OpenGL Visibility Detection Functions Ravindra R Patil (15CS62)

  2. OpenGL Visibility Detection Functions • Back-face removal: glEnable(GL_CULL_FACE); glCullFace(mode); GL_BACK, GL_FRONT, GL_FRONT_AND_BACK default glDisable(GL_CULL_FACE); • GL_BACK is default. Sometimes we want to see the back faces, for example if we are in a room we can use GL_FRONT

  3. OpenGL Visibility Detection Functions Depth-buffer functions: • Request depth buffer when initializing: glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB|GLUT_DEPTH); • Clear depth buffer each time a new frame is displayed: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); • OpenGL depth-buffer visibility-detection routines can be activated with glEnable(GL_DEPTH_TEST); • and deactivated with glDisable(GL_DEPTH_TEST);

  4. OpenGL Visibility Detection Functions • Wire-frame surface visibility: glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

  5. OpenGL Visibility Detection Functions • Depth cueing: glEnable(GL_FOG); glFogi(GL_FOG_MODE, GL_LINEAR); • This applies the linear depth function to object colors using dmin=0.0 and dmax=1.0. We can set different values for dmin and dmax with the following function calls glFogf(GL_FOG_START, minDepth); glFogf(GL_FOG_END, maxDepth);

More Related