Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: anybody using only GL_TRIANGLES?

  1. #1
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    anybody using only GL_TRIANGLES?

    in my engine i render meshes either as triangles (i cull faces before i send them to opengl) or strips + tris.
    today i forced everything to render as triangles ie no strips (like carmack saiz q3a does) i was surprised by the resulting drop in performance '30-40%' so why does q3a just use triangles + no strips. i can see there are a few benifits (hey i cant type a space here)eg simplicity, fewer calls to glDrawElements() but the performance drop is unacceptable. is anyone else out there using only triangles + if so , why?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    662

    Re: anybody using only GL_TRIANGLES?

    what do you mean by unacceptable?
    Do you mean the frame rate go down to like 5-10 fps??

    or it drops from 100 to 70??

  3. #3
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Hannover, Germany
    Posts
    1,258

    Re: anybody using only GL_TRIANGLES?

    Are you presorting the triangles? JC also said triangles which would form a strip are stored directly behind the other.
    - Michael Steinberg

  4. #4
    Junior Member Regular Contributor Roderic (Ingenu)'s Avatar
    Join Date
    Mar 2000
    Location
    Horsham, West Sussex, UK.
    Posts
    161

    Re: anybody using only GL_TRIANGLES?

    Mr Carmack telling to use Triangles instead of Triangle strips ?
    While all 3d accelerators manufacturers are telling us to use strips ?

    Sounds strange any link ?

    [This message has been edited by Ingenu (edited 03-12-2001).]
    -* So many things to do, so little time to spend. *-

  5. #5
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: anybody using only GL_TRIANGLES?

    30-40% drop in performance which is a lot.
    the tris are pretty much sorted (not perfect) but im sending them practically in strip order. it does sort of make sense though

    eg take a strip of 10 triangles
    thus for a tri strip im sending 12 vertices/normals/texcoords*4
    whereas with triangles im sending (10 * 3) / 45% culled is about 16 verts (the longer the strip the bigger the difference)

    granted for trianlges im using far less glDrawElement calls though i believe the extra effort to build the triangle list is offset by this

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Location
    Belgium
    Posts
    857

    Re: anybody using only GL_TRIANGLES?

    If you use glDrawElements(), and your vertices are used more or less in triangle strip order, then most vertices will be reused three times in a very short time span. Let me try some ASCII art:

    Code :
    2--4--6
    |\ |\ |
    | \| \|
    1--3--5
    You might render this with an index array like this: (1, 2, 3; 2, 4, 3; 3, 4, 5; 4, 6, 5). If you reuse vertices this quickly, they will still be in your 3D card's vertex cache, so they only need to be transferred and T&L'ed once. That way, it shouldn't be much slower than actually using a strip. The downside is that it probably will be a lot slower on a non-T&L card.

    - Tom

    [This message has been edited by Tom Nuydens (edited 03-12-2001).]

  7. #7
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: anybody using only GL_TRIANGLES?

    yes i think its time for me to get a hardware tnl card ( prolly a geforce2mx )
    taken from the opengl performance faq ver2
    All NVIDIA GPUs have a 16 element post-T&L vertex cache (also called the “vertex file”),
    though the effective size is closer to 10 elements when you consider pipelining.
    so tristrips with nontnl cards,
    + tris (strips if possible) with tnl cards. got it

  8. #8
    Member Regular Contributor
    Join Date
    Oct 2000
    Location
    USA
    Posts
    322

    Re: anybody using only GL_TRIANGLES?

    But I imagine it wouldn't hurt a T&L card to use strips either. Because, unless I misunderstand here, you need to half-way stripify your triangles anyway even on a T&L card to take advantage of the vertex caching.

    BTW, how are you culling the non-visible faces? Are you actually transforming each face of the mesh and doing a dotproduct to cull it? And then transfering the info of visible faes into a vertex buffer? Is this really worth it? Is GL_CULLFACE not enough? It just seems to me that if you had alot of meshes to render, that'd be ALOT of work to do just to remove some faces.

    Also, I saw someone say earlier that nVidia had some kind of utility that would "stripify" your meshes? Anybody got a link? Thanks!

  9. #9
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: anybody using only GL_TRIANGLES?

    true thats why i say strips if possible. all triangles were in world space thus doing the culling before sending them to the card is pretty cheap. u do remove more than some faces doing it typically 35%-45%

    (nice friendly link to the nvidia tristrip program) http://www.nvidia.com/Marketing/Deve...25693F0065F772

  10. #10
    Member Regular Contributor
    Join Date
    Oct 2000
    Location
    USA
    Posts
    322

    Re: anybody using only GL_TRIANGLES?

    Thanks, zed! BTW, how much of a performance increase can you expect to see doing your own backface culling? Is it very significant? Was the percentage you gave the percentage of faces removed or the performance increase? Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •