Chapter
This presentation is the property of its rightful owner.
Sponsored Links
1 / 18

Chapter 13 Occlusion Queries PowerPoint PPT Presentation


  • 150 Views
  • Uploaded on
  • Presentation posted in: General

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:

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.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

Chapter 13

Occlusion Queries

  • Chih-Kuo Yeh


Occlusion queries

Occlusion Queries


Occlusion

Occlusion


Occluder

Occluder


Occlusion detection

Occlusion detection

Frame rate was about 50 fps.


Occlusion detection1

Occlusion detection


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

Bounding Boxes


Bounding boxes box

Bounding Boxes - Box


Bounding boxes tetrahedron

Bounding Boxes - Tetrahedron


Bounding boxes octahedron

Bounding Boxes - Octahedron


Bounding boxes dodecahedron

Bounding Boxes - Dodecahedron


Bounding boxes icosahedron

Bounding Boxes - Icosahedron


  • Login