Jump to content
  • Advertisement
Sign in to follow this  
_gl_coder_one_

OpenGL internals of rendering

This topic is 4886 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does OpenGL or any API convert all the polygonal models internally into a triangle representation? Is it actually of any advantage to be doing such a conversion >

Share this post


Link to post
Share on other sites
Advertisement
From what I've been told and what I've observed, quads, quad strips, and polygons are all decomposed into triangles before being sent into the pipeline.

These primitives aren't terribly useful, except as a minor convenience.

Share this post


Link to post
Share on other sites
Yep - everything is always converted down to triangles. Infact most of the time people only send it triangles in the first place, but if you use quads or something in the end it'll come out as a triangle.

The reason why? Speed! Triangles are the simplest shape (3 sides), and you can do alot of optimizations if you know your only every dealing with triangles. Exactly what these are and how it works I don't know, but I'm not one to question NVidia and ATI on speed optimizations :D. The general idea is this: You can speed up your specific triangle case so much that it takes less time to draw 2 triangles than to draw 1 quad. General solutions are always (read: mostly) slower than specific solutions, and when it comes to rendering, the triangle case is fast enough to make it worth your while to just break everything down to triangles.

Share this post


Link to post
Share on other sites
Quote:
Original post by kaysik
Yep - everything is always converted down to triangles. Infact most of the time people only send it triangles in the first place, but if you use quads or something in the end it'll come out as a triangle.

The reason why? Speed! Triangles are the simplest shape (3 sides), and you can do alot of optimizations if you know your only every dealing with triangles. Exactly what these are and how it works I don't know, but I'm not one to question NVidia and ATI on speed optimizations :D. The general idea is this: You can speed up your specific triangle case so much that it takes less time to draw 2 triangles than to draw 1 quad. General solutions are always (read: mostly) slower than specific solutions, and when it comes to rendering, the triangle case is fast enough to make it worth your while to just break everything down to triangles.


So does the OpenGL API itself do the conversion or is it done in hardware ?

Share this post


Link to post
Share on other sites
Quote:
Original post by _gl_coder_one_
So does the OpenGL API itself do the conversion or is it done in hardware ?


I think the graphics card drivers do it. But to be honest I've never actually looked it up so thats a guess. Its pretty trivial to break a quad down into a triangle though, so it probably doesn't make much of a difference.

[Edited by - kaysik on June 5, 2005 11:17:55 PM]

Share this post


Link to post
Share on other sites
previously certain cards done quads in hardware (im not sure about now)
also sending 4 indices is less data than sending 6 indices (also less memeory)
but the main reason to use quads is they look so much better/cleaner in wireframe than triangles do

Share this post


Link to post
Share on other sites
Quote:
Original post by _gl_coder_one_
Quote:
Original post by kaysik
Yep - everything is always converted down to triangles. Infact most of the time people only send it triangles in the first place, but if you use quads or something in the end it'll come out as a triangle.

The reason why? Speed! Triangles are the simplest shape (3 sides), and you can do alot of optimizations if you know your only every dealing with triangles. Exactly what these are and how it works I don't know, but I'm not one to question NVidia and ATI on speed optimizations :D. The general idea is this: You can speed up your specific triangle case so much that it takes less time to draw 2 triangles than to draw 1 quad. General solutions are always (read: mostly) slower than specific solutions, and when it comes to rendering, the triangle case is fast enough to make it worth your while to just break everything down to triangles.


So does the OpenGL API itself do the conversion or is it done in hardware ?


From what I can figure, the OpenGL API does damn near nothing, except providing a unified interface to the driver. It's almost certainly dealt with at a driver level...not least because the ability to draw quads in hardware is dependent on which card you have.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!