Advertisement

Performance hit with texture mapped quads

Started by December 21, 2000 08:05 PM
2 comments, last by DaWizard 23 years, 11 months ago
I was testing my BSP Tree Demo (written in C++) against Quads and Triangles. I basically created a world from a 2D map using Visual Basic (I know you guys must be laughing but I got the code done in 15 minutes using a control array of Line objects ) Each wall can be essentially rendered as a single quad or two triangles. The demo runs smoothly with lighting. The performance hit comes when I switch to using textures. Even though the number quads used is half that of the triangle version, OpenGL chokes on textured quads. Here''s a comparison (I used back face culling with the BSP Tree) ---------------------------------------------------------------- 52 Quads with textures gives 13 FPS. The BSP tree actually contains 57 polygons (quads, tris and probably other n-gons) due to splits. 104 Triangles with textures gives 60 FPS. The BSP tree actually contains 118 polygons (quads, tris and probably other n-gons) due to splits. ---------------------------------------------------------------- Any one know for a fact that texture mapped Quads are slower than texture mapped Triangles? One thing that may be the problem is my video card: ATI 3D Rage Pro and its GL drivers but I don''t know for sure. If anyone can shed some light on this matter please reply to this post. ------------------------ DaWizard ------------------------
------------------------------------------------DaWizardhttp://www.geocities.com/ahmadkabani------------------------------------------------
I''d guess all hardware renders in triangles. If you draw quads, the driver breaks it into two triangles.

It''s possible that the ATI driver does this poorly. Like points and lines and pixel blitting - all are suported in OpenGL but are usually painfully slow because they aren''t used in Quake



~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL
~~~Cheers!Brett PorterPortaLib3D : A portable 3D game/demo libary for OpenGLCommunity Service Announcement: Read How to ask questions the smart way before posting!
Advertisement
quote: Original post by brettporter

I''d guess all hardware renders in triangles. If you draw quads, the driver breaks it into two triangles.

It''s possible that the ATI driver does this poorly. Like points and lines and pixel blitting - all are suported in OpenGL but are usually painfully slow because they aren''t used in Quake



~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL


Well, I tried to use GL_TRIANGLE_FAN instead of GL_POLYGON. I realized I stored my vertices in clockwise manner so my polygons were described by an array of, say, n vertices v0,v1,v2,...,vn. So a quad (v0,v1,v2,v3) would be rendered as 2 triangle (v0,v1,v2) and (v0,v2,v3).

Using a triangle fan with textures didn''t improve the speed either. It''s fine without textures.


------------------------------------------------
DaWizard
http://members.home.com/ahmadkabani
http://www.geocities.com/ahmadkabani
------------------------------------------------
------------------------------------------------DaWizardhttp://www.geocities.com/ahmadkabani------------------------------------------------
quote: Original post by brettporter

I''d guess all hardware renders in triangles. If you draw quads, the driver breaks it into two triangles.

It''s possible that the ATI driver does this poorly. Like points and lines and pixel blitting - all are suported in OpenGL but are usually painfully slow because they aren''t used in Quake



~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL


Well, I tried to use GL_TRIANGLE_FAN instead of GL_POLYGON. I realized I stored my vertices in clockwise manner so my polygons were described by an array of, say, n vertices v0,v1,v2,...,vn. So a quad (v0,v1,v2,v3) would be rendered as 2 triangles (v0,v1,v2) and (v0,v2,v3).

Using a triangle fan with textures didn''t improve the speed either. It''s fine without textures.

What does not make sense is that a world built purely from triangles has double the number of polygons as the the one built from quads and yet the hardware chokes on quads even when I make it easier for OpenGL by breaking it up myself.

Oh well, I''ll just go buy a GeForce or ATI Radeon some time next month .

Thanks for the insight.


------------------------------------------------
DaWizard
http://members.home.com/ahmadkabani
http://www.geocities.com/ahmadkabani
------------------------------------------------
------------------------------------------------DaWizardhttp://www.geocities.com/ahmadkabani------------------------------------------------

This topic is closed to new replies.

Advertisement