BASIC

Author Topic: OpenGL Vertice Count  (Read 1275 times)

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 930
  • KodeSource
    • View Profile
    • KodeSource
OpenGL Vertice Count
« on: 2010-Nov-01 »
Is there a way to display the current vertice (or poly) count from OpenGL (or from GLBasic if it has that info)?

I'm adjusting the FAR CLIP limit of the camera in hopes of saving some polys on an iPhone.
But I don't know how to figure out the benefits if I don't know how many polys I'm saving.

Or it would also be handy for dynamic worlds.
You could limit how much detail to draw up until you reach your vertice limit for that device.

Simply counting the number of vertices/poly's in all my models doesn't help since I don't know what models will be clipped from view.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1635
  • Particle Hawk
    • View Profile
Re: OpenGL Vertice Count
« Reply #1 on: 2010-Nov-03 »
I assume you could make a counter.
Include all the polys within objects, which are a certain range(current far clip value) from the cameras origin.
If you download my 3d object viewer from the download section of GLBasic, you can see how to get information from objects, source is included.


Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 930
  • KodeSource
    • View Profile
    • KodeSource
Re: OpenGL Vertice Count
« Reply #2 on: 2010-Nov-03 »
Thanks, that's kinda what I was thinking might be my 'worst case scenario', but should work.

Does anyone know if objects behind (or out of view of) the camera are drawn by GLBasic? (frustum culling)
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10713
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: OpenGL Vertice Count
« Reply #3 on: 2010-Nov-08 »
GLBasic does a frustum culling against the bounding sphere of objects.