Vertices and Indices

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Vertices and Indices

Adrian May
Hi Folks,

I'm looking at the OpenGL stuff in Haskell and one thing is worrying me.
Doing OpenGL in the past I used to pass an array of vertices to the GPU and
then a list of indices into that array together with a method of joining
them up, e.g. TriangleStrip. In Haskell though, it seems like I'm just
supposed to send a list of vertices and the method, meaning that lots of
vertices get duplicated. Is Haskell doing something clever under the hood
here or is it really that wasteful? Or can I persuade it to use these index
lists?

TIA,
Adrian.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130405/85fc755b/attachment.htm>

Reply | Threaded
Open this post in threaded view
|

Vertices and Indices

Thomas Davie

On 5 Apr 2013, at 09:12, Adrian May <adrian.alexander.may at gmail.com> wrote:

> Hi Folks,
>
> I'm looking at the OpenGL stuff in Haskell and one thing is worrying me. Doing OpenGL in the past I used to pass an array of vertices to the GPU and then a list of indices into that array together with a method of joining them up, e.g. TriangleStrip. In Haskell though, it seems like I'm just supposed to send a list of vertices and the method, meaning that lots of vertices get duplicated. Is Haskell doing something clever under the hood here or is it really that wasteful? Or can I persuade it to use these index lists?

This has nothing to do with Haskell, but instead the fact that someone chose to call glDrawArrays instead of glDrawElements.

Thanks

Tom Davie