Chapter
Download
1 / 18

Chapter 13 Occlusion Queries - PowerPoint PPT Presentation


  • 218 Views
  • Uploaded on

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:

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Chapter 13 Occlusion Queries' - aleron


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Chapter 13

Occlusion Queries

  • Chih-Kuo Yeh





Occlusion detection
Occlusion detection

Frame rate was about 50 fps.



Without occlusion detection
Without occlusion detection

Frame rate was about 30 fps.


Generate occlusion query names
Generate occlusion query names

  • Create array memory:

    • GLuint queryIDs[27]

  • At the beginning:

    • glGenQueries(27, queryIDs);

  • At the ending:

    • glDeleteQueries(27, queryIDs);


Delimit the boundaries
Delimit the boundaries

glBeginQuery(GL_SAMPLES_PASSED, queryIDs);

glEndQuery(GL_SAMPLES_PASSED);

Draw your bonding boxes


Queryids
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]);


Check if it would be occluded
Check if it would be occluded

  • glGetQueryObjectiv(

  • queryIDs[sphereNum],

  • GL_QUERY_RESULT,

  • &passingSamples);

  • if (passingSamples == 0)

  • occluded = GL_TRUE;


Check if it would be occluded1
Check if it would be occluded

if (!occluded)

{

glutSolidSphere(50.0f, 200, 200);

}

else

{

printf("sphereNum:%d\n",sphereNum);

}







Bounding boxes icosahedron
Bounding Boxes - Icosahedron


ad