1 / 18

Chapter 13 Occlusion Queries

Chapter 13 Occlusion Queries. Chih-Kuo Yeh. Occlusion Queries. Occlusion. Occluder. Occlusion detection. Frame rate was about 50 fps. Occlusion detection. Without occlusion detection. Frame rate was about 30 fps. Generate occlusion query names. Create array memory:

aleron
Download Presentation

Chapter 13 Occlusion Queries

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. Chapter 13 Occlusion Queries • Chih-Kuo Yeh

  2. Occlusion Queries

  3. Occlusion

  4. Occluder

  5. Occlusion detection Frame rate was about 50 fps.

  6. Occlusion detection

  7. Without occlusion detection Frame rate was about 30 fps.

  8. Generate occlusion query names • Create array memory: • GLuint queryIDs[27] • At the beginning: • glGenQueries(27, queryIDs); • At the ending: • glDeleteQueries(27, queryIDs);

  9. Delimit the boundaries glBeginQuery(GL_SAMPLES_PASSED, queryIDs); glEndQuery(GL_SAMPLES_PASSED); Draw your bonding boxes

  10. queryIDs 18 21 24 19 22 25 20 23 15 26 16 11 6 14 17 7 2 5 8 glBeginQuery(GL_SAMPLES_PASSED, queryIDs[(r*9)+(g*3)+b]);

  11. Check if it would be occluded • glGetQueryObjectiv( • queryIDs[sphereNum], • GL_QUERY_RESULT, • &passingSamples); • if (passingSamples == 0) • occluded = GL_TRUE;

  12. Check if it would be occluded if (!occluded) { glutSolidSphere(50.0f, 200, 200); } else { printf("sphereNum:%d\n",sphereNum); }

  13. Bounding Boxes

  14. Bounding Boxes - Box

  15. Bounding Boxes - Tetrahedron

  16. Bounding Boxes - Octahedron

  17. Bounding Boxes - Dodecahedron

  18. Bounding Boxes - Icosahedron

More Related