Discussion:
GL_TRIANGLE or GL_TRIANGLE_STRIP+GL_TRIANGLE_FAN
(too old to reply)
Magnus Jonneryd
2005-10-13 11:35:39 UTC
Permalink
When rendering a geometric shape i have two, essentially, options:

1. Use GL_TRIANGLES or GL_POLYGON and only one call to GL_BEGIN and GL_END
(render everything in one go).

2. Use GL_TRIANGLE_STRIP and GL_TRIANGLE_FAN and issue multiple calls to
GL_BEGIN and GL_END (render the object piece-by-piece).

I'm wondering, with efficiency in mind, which approach you would recommend?

Thanks, in advance.
--
(Should insert humorous quotation here)
fungus
2005-10-13 12:36:30 UTC
Permalink
Post by Magnus Jonneryd
1. Use GL_TRIANGLES or GL_POLYGON and only one call to GL_BEGIN and GL_END
(render everything in one go).
2. Use GL_TRIANGLE_STRIP and GL_TRIANGLE_FAN and issue multiple calls to
GL_BEGIN and GL_END (render the object piece-by-piece).
I'm wondering, with efficiency in mind, which approach you would recommend?
Use whichever produces the least calls to glVertex().

(And that will depend on your data...)
--
<\___/>
/ O O \
\_____/ FTB. For email, remove my socks.

In science it often happens that scientists say, 'You know
that's a really good argument; my position is mistaken,'
and then they actually change their minds and you never
hear that old view from them again. They really do it.
It doesn't happen as often as it should, because scientists
are human and change is sometimes painful. But it happens
every day. I cannot recall the last time something like
that happened in politics or religion.

- Carl Sagan, 1987 CSICOP keynote address
Magnus Jonneryd
2005-10-13 13:18:05 UTC
Permalink
Post by fungus
Post by Magnus Jonneryd
1. Use GL_TRIANGLES or GL_POLYGON and only one call to GL_BEGIN and GL_END
(render everything in one go).
2. Use GL_TRIANGLE_STRIP and GL_TRIANGLE_FAN and issue multiple calls to
GL_BEGIN and GL_END (render the object piece-by-piece).
I'm wondering, with efficiency in mind, which approach you would recommend?
Use whichever produces the least calls to glVertex().
(And that will depend on your data...)
So, you mean that the calls to GL_BEGIN and GL_END is not an issue? Go
figure... Well, thanks.
--
(Should insert humorous quotation here)
fungus
2005-10-13 14:02:26 UTC
Permalink
Post by Magnus Jonneryd
Post by fungus
Use whichever produces the least calls to glVertex().
So, you mean that the calls to GL_BEGIN and GL_END is not an issue? Go
figure... Well, thanks.
They're not free, but they're not usually as expensive
as a vertex.
--
<\___/>
/ O O \
\_____/ FTB. For email, remove my socks.

In science it often happens that scientists say, 'You know
that's a really good argument; my position is mistaken,'
and then they actually change their minds and you never
hear that old view from them again. They really do it.
It doesn't happen as often as it should, because scientists
are human and change is sometimes painful. But it happens
every day. I cannot recall the last time something like
that happened in politics or religion.

- Carl Sagan, 1987 CSICOP keynote address
Continue reading on narkive:
Loading...