Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)

2011-02-01 Thread Sukender
Hi Tim, I'll try to send an exemple. Can I send it to your address direclty? It's a very simple model with texture coordinates, created from the 3DS reader. I'll dump it as an OSG file beforehand. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Tim

Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)

2011-02-01 Thread Tim Moore
On Tue, Feb 1, 2011 at 11:39 AM, Sukender suky0...@free.fr wrote: Hi Tim, I'll try to send an exemple. Can I send it to your address direclty? Sure. Tim It's a very simple model with texture coordinates, created from the 3DS reader. I'll dump it as an OSG file beforehand. Sukender PVLE

Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)

2011-02-01 Thread Sukender
Fixed :) I'm sumbitting the change. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Tim Moore timoor...@gmail.com a écrit : On Tue, Feb 1, 2011 at 11:39 AM, Sukender suky0...@free.fr wrote: Hi Tim, I'll try to send an exemple. Can I send it

Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP)to DrawElements(TRIANGLES)

2011-01-31 Thread Jean-Sébastien Guay
Hi Wojtek, You probably know this but if not it may be other option for you. One can define restart index that works as terminator for triangle/quad strips (check GL_NV_primitive_restart extension) . So in practice multiple triangle strips can be separated by restart indices and put into one

Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)

2011-01-31 Thread Jean-Sébastien Guay
Hi Tim, That sucks. I'll take a look. OK, let me know what you find out. I was pretty surprised the optimizers would go out of bounds, as I've used them on a variety of models without problems (as I bet you have, and many others too). Thanks in advance, J-S --

Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)

2011-01-31 Thread Jean-Sébastien Guay
Hi Tim, I've found that that problem happens because the attribute arrays are shared among several Geometry objects. The fix is simple, but I haven't submitted it yet because the results of INDEX_MESH are still not great on the sphere object, and I have a different idea for how to approve that.

Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)

2011-01-31 Thread Sukender
Hi Tim, Sorry to jump into that conversation, but I also had a bug related to IndexMeshVisitor: the output geometries do NOT have number of vertices == number of texcoords... Did I miss something? Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)

2011-01-31 Thread Tim Moore
Hi Sukender, I'm not sure what you mean; I need to see an example. The IndexMeshVisitor doesn't work with BIND_PER_PRIMITIVE attributes and bails if it finds any. If the number of vertex coordinates doesn't equal the number of texture coordinates, that's a big bug. Normally the number of indices

Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)

2011-01-29 Thread Tim Moore
On Fri, Jan 28, 2011 at 4:44 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Tim, If I understand correctly how the sky dome mesh is constructed, there was a lot of duplication of vertices in the triangle strip arrays, and this has been carried forward into your indexed

Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)

2011-01-28 Thread Jean-Sébastien Guay
Hi Tim, If I understand correctly how the sky dome mesh is constructed, there was a lot of duplication of vertices in the triangle strip arrays, and this has been carried forward into your indexed mesh approach. The INDEX_MESH optimizer would remove these duplicates. The order of the triangles

Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)

2011-01-27 Thread Jean-Sébastien Guay
Hi again, Well, I've been able to change the 48 small triangle strips per geometry to a single DrawElements call, with naive code that just puts indices to replicate what the strip is doing, i.e. 0 1 2 1 2 3 2 3 4 etc. The result is a small but noticeable decrease in draw time. It's smaller

Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)

2011-01-27 Thread Tim Moore
If I understand correctly how the sky dome mesh is constructed, there was a lot of duplication of vertices in the triangle strip arrays, and this has been carried forward into your indexed mesh approach. The INDEX_MESH optimizer would remove these duplicates. The order of the triangles in the