Re: [osg-users] TriStripVisitor issue

2009-11-25 Thread Tanguy Fautre
Hi Robert,

I've sent it to you yesterday on your Gmail address. Can you confirm
you've received it?


Tanguy


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: 24 November 2009 5:10 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] TriStripVisitor issue

On Tue, Nov 24, 2009 at 4:59 PM, Tanguy Fautre
tang...@aristechnologies.com wrote:
 I'll do these modifications and check them tonight when I'm back home.
 To speed things up (and because we're going to backport OSG changes),
 I'm not going to do a full release on TriStripper website yet; instead
 I'll send you a zip containing the updated version.

Thanks, just send me the zip file and should be get on to do a
review/merge tomorrow.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TriStripVisitor issue

2009-11-25 Thread Robert Osfield
Hi Tanguy,

On Wed, Nov 25, 2009 at 12:27 PM, Tanguy Fautre
tang...@aristechnologies.com wrote:
 I've sent it to you yesterday on your Gmail address. Can you confirm
 you've received it?

Yes, I received it thanks.  Just been juggling other tasks at this end
so haven't yet dived into the code.

Cheers,
Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TriStripVisitor issue

2009-11-25 Thread Tanguy Fautre
No stress. I just wanted to make sure I've sent it to the correct
address.

Tanguy


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: 25 November 2009 1:06 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] TriStripVisitor issue

Hi Tanguy,

On Wed, Nov 25, 2009 at 12:27 PM, Tanguy Fautre
tang...@aristechnologies.com wrote:
 I've sent it to you yesterday on your Gmail address. Can you confirm
 you've received it?

Yes, I received it thanks.  Just been juggling other tasks at this end
so haven't yet dived into the code.

Cheers,
Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TriStripVisitor issue

2009-11-24 Thread Tanguy Fautre
Hi Emmanuel, Robert,

I think most of the points have already been covered by you two guys, so I 
won't come back on them.

I'll however pick up on the fact that OSG is using a very old TriStripper 
release (1.00 Beta 5). I'd heavily recommend updating to 1.10 B5. Compared to 
1.00 B5, there have been a lot of bug fixes (the most important being 
segmentation faults and invalid iterators fixes) plus speed improvements (10% 
to 50% faster depending on the platform). See the changelog for the full 
details.

I'd recommend updating OSG with the latest version.

As the author of TriStripper, I'm guilty of not doing it myself. I sincerely 
apologize for it. But as I'm currently responsible for managing the next 
release of our product, I don't have time to do it in the near future.

Roberts, note that if no-one has volunteered after a few weeks, just give me 
some serious whipping and force me to do it.


Regards,

Tanguy


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: 23 November 2009 2:30 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] TriStripVisitor issue

Hi Manu,

The TriStripVisitor shouldn't change anything in the data apart form
re-organize it.  Adding in tolerances to the vertex comparisons would
require the vertex data to modified to collapse adjacent vertices's
onto the same position in space.

Would could add such functionality as an extra pass to
TriStripVisitor, but the default would have to be not to do this.
Personally I'd suggest having a separate visitor do this operation of
collapsing nearby vertices on to one another, and then pre-process the
data before tri-stripping it.

Robert.



On Mon, Nov 23, 2009 at 2:25 PM, Emmanuel Roche
roche.emman...@gmail.com wrote:
 Okay,

 more details on this:

 the problem comes from the helper structure VertexAttribComparitor

 in the function VertexAttribComparitor::compare(unsigned int lhs, unsigned
 int rhs) we call the template array compare(unsigned int lhs, unsigned int
 rhs) function, and there we just use regular comparisons:

     virtual int compare(unsigned int lhs,unsigned int rhs) const
     {
     const T elem_lhs = (*this)[lhs];
     const T elem_rhs = (*this)[rhs];
     if (elem_lhselem_rhs) return -1;
     if (elem_rhselem_lhs) return 1;
     return 0;
     }

 here we don't take any precision into account at all... whereas my
 vertices are given in meter units and may have a little resolution of about
 0.1 millimeter !

 So this implementation won't fit for my needs (and I think there is an high
 chance it may not fit the needs for many other people no ?) maybe we should
 add a precision parameter at some point, but for now I just don't have the
 time to deal with this properly :-)

 Cheers,
 Manu.


 2009/11/23 Emmanuel Roche roche.emman...@gmail.com

 Hi Robert,

 Actually, I've noticed that the problem doesn't come from the underlying
 tristripper library:

 instead, it seems that the indice array generated from my vertices is
 incorrect: I suspect that the comparison function to find if too vertices
 are the same or not is too precise in my case. Do you have a clear idea
 where this is done ? (otherwise, I will just read more code and find it...)

 cheers,

 Manu.



 2009/11/23 Emmanuel Roche roche.emman...@gmail.com

 Actually, I also noticed that OSG v2.8.1 uses version 1.0 of the
 tristripper library.

 As I'm quite in an hurry, I think I will re-implement my own
 tristripvisitor with the latest version of tristripper and check if this
 makes a difference. Will let you know what's the result of this test.

 But I believe this could really be a generic issue (it happens with all
 the models I tested) and thus would mean many people are currently using
 not so well tri-stripped geometries if they use this optimiser feature !
 (it is the case for instance in the OSGExp export plugin for 3DS max as I've
 noticed this issue there for the first time).

 regards,
 Manu.



 2009/11/23 Robert Osfield robert.osfi...@gmail.com

 Hi Manu,

 If the tristripper doesn't connect the triangles together well then it
 can result on few tristrips and lots of unconnected traingles that it
 has to put into a single list of triangles to avoid lots of separate
 primitive calls.

 As to why your model is not being stripped well I can't say.  We've
 used 3rd party code to do the tri-stripping so I'm not best placed to
 answer the low level questions, but... the original author of the cdoe
 Tanguy Fautre is now an OSG user and I believe still on the list so
 perhaps he'll be able to chip in ;-)

 Robert.

 On Mon, Nov 23, 2009 at 11:08 AM, Emmanuel Roche
 roche.emman...@gmail.com wrote:
  Hi everyone,
 
  I have a strange problem with the TryStripVisitor:
 
  When I use it on a model (with about 6000 triangles, described as
  TRIANGLES
  [thus using 18000 vertices]) I get trip strip

Re: [osg-users] TriStripVisitor issue

2009-11-24 Thread Robert Osfield
Hi Tanguy,

Thanks for chipping in. Could you point me at the latest rev your
tri-stripper code.

One thing we will need to do is report your tri-stripping code to all
the compilers/platform that the OSG users put it through, as we've had
to merge quite a few build fixes over the years.  For the OpenGL ES
port I also had to remove the use of throw/catch from the tristripper
code.  It would be good to roll these changes back into your
tri-stripper code.

Good luck with your release,
Robert.

On Tue, Nov 24, 2009 at 11:52 AM, Tanguy Fautre
tang...@aristechnologies.com wrote:
 Hi Emmanuel, Robert,

 I think most of the points have already been covered by you two guys, so I 
 won't come back on them.

 I'll however pick up on the fact that OSG is using a very old TriStripper 
 release (1.00 Beta 5). I'd heavily recommend updating to 1.10 B5. Compared to 
 1.00 B5, there have been a lot of bug fixes (the most important being 
 segmentation faults and invalid iterators fixes) plus speed improvements (10% 
 to 50% faster depending on the platform). See the changelog for the full 
 details.

 I'd recommend updating OSG with the latest version.

 As the author of TriStripper, I'm guilty of not doing it myself. I sincerely 
 apologize for it. But as I'm currently responsible for managing the next 
 release of our product, I don't have time to do it in the near future.

 Roberts, note that if no-one has volunteered after a few weeks, just give me 
 some serious whipping and force me to do it.


 Regards,

 Tanguy


 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert 
 Osfield
 Sent: 23 November 2009 2:30 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] TriStripVisitor issue

 Hi Manu,

 The TriStripVisitor shouldn't change anything in the data apart form
 re-organize it.  Adding in tolerances to the vertex comparisons would
 require the vertex data to modified to collapse adjacent vertices's
 onto the same position in space.

 Would could add such functionality as an extra pass to
 TriStripVisitor, but the default would have to be not to do this.
 Personally I'd suggest having a separate visitor do this operation of
 collapsing nearby vertices on to one another, and then pre-process the
 data before tri-stripping it.

 Robert.



 On Mon, Nov 23, 2009 at 2:25 PM, Emmanuel Roche
 roche.emman...@gmail.com wrote:
 Okay,

 more details on this:

 the problem comes from the helper structure VertexAttribComparitor

 in the function VertexAttribComparitor::compare(unsigned int lhs, unsigned
 int rhs) we call the template array compare(unsigned int lhs, unsigned int
 rhs) function, and there we just use regular comparisons:

     virtual int compare(unsigned int lhs,unsigned int rhs) const
     {
     const T elem_lhs = (*this)[lhs];
     const T elem_rhs = (*this)[rhs];
     if (elem_lhselem_rhs) return -1;
     if (elem_rhselem_lhs) return 1;
     return 0;
     }

 here we don't take any precision into account at all... whereas my
 vertices are given in meter units and may have a little resolution of about
 0.1 millimeter !

 So this implementation won't fit for my needs (and I think there is an high
 chance it may not fit the needs for many other people no ?) maybe we should
 add a precision parameter at some point, but for now I just don't have the
 time to deal with this properly :-)

 Cheers,
 Manu.


 2009/11/23 Emmanuel Roche roche.emman...@gmail.com

 Hi Robert,

 Actually, I've noticed that the problem doesn't come from the underlying
 tristripper library:

 instead, it seems that the indice array generated from my vertices is
 incorrect: I suspect that the comparison function to find if too vertices
 are the same or not is too precise in my case. Do you have a clear idea
 where this is done ? (otherwise, I will just read more code and find it...)

 cheers,

 Manu.



 2009/11/23 Emmanuel Roche roche.emman...@gmail.com

 Actually, I also noticed that OSG v2.8.1 uses version 1.0 of the
 tristripper library.

 As I'm quite in an hurry, I think I will re-implement my own
 tristripvisitor with the latest version of tristripper and check if this
 makes a difference. Will let you know what's the result of this test.

 But I believe this could really be a generic issue (it happens with all
 the models I tested) and thus would mean many people are currently using
 not so well tri-stripped geometries if they use this optimiser feature !
 (it is the case for instance in the OSGExp export plugin for 3DS max as 
 I've
 noticed this issue there for the first time).

 regards,
 Manu.



 2009/11/23 Robert Osfield robert.osfi...@gmail.com

 Hi Manu,

 If the tristripper doesn't connect the triangles together well then it
 can result on few tristrips and lots of unconnected traingles that it
 has to put into a single list of triangles to avoid lots of separate
 primitive

Re: [osg-users] TriStripVisitor issue

2009-11-24 Thread Tanguy Fautre
Hi Robert,

http://users.telenet.be/tfautre/softdev/tristripper/

The latest revision is 1.10, Beta 5 (09/06/2005). Don't let the Beta
name scare you, it's actually probably the most stable release due to
several bug fixes.
http://users.telenet.be/tfautre/softdev/tristripper/tristripper-1.1.0-be
ta-5.zip

I suggest you spend a few minutes reading all the interface/feature
changes that were incorporated into the 1.10 release (they're detailed
on the TriStripper main page).

The portability of the TriStripper lib has improved significantly in the
latest releases. I'm hoping you won't have to make as many modifications
as you had to in the past (I think the throw/catch is gone).

After a quick look at the header, I've noticed protections against
min/max macros that will cause a hard failure when those are detected
(which you probably want to avoid in a library such as OSG). Thinking
about it now, this is a bit harsh as I've learned since now how to avoid
macro expansion. For example, replacing

const size_t Overlap = std::min(PossibleOverlap, size());

by

const size_t Overlap = (std::min)(PossibleOverlap, size());

will avoid the macro replacement and use the std function instead.


Keep me posted on how it goes and I'll look into syncing the TriStripper
code with the OSG modifications.


Tanguy



-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: 24 November 2009 12:13 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] TriStripVisitor issue

Hi Tanguy,

Thanks for chipping in. Could you point me at the latest rev your
tri-stripper code.

One thing we will need to do is report your tri-stripping code to all
the compilers/platform that the OSG users put it through, as we've had
to merge quite a few build fixes over the years.  For the OpenGL ES
port I also had to remove the use of throw/catch from the tristripper
code.  It would be good to roll these changes back into your
tri-stripper code.

Good luck with your release,
Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TriStripVisitor issue

2009-11-24 Thread Tanguy Fautre
Hi Robert,

I'll do these modifications and check them tonight when I'm back home.
To speed things up (and because we're going to backport OSG changes),
I'm not going to do a full release on TriStripper website yet; instead
I'll send you a zip containing the updated version.


Cheers,

Tanguy


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: 24 November 2009 3:33 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] TriStripVisitor issue

Hi Tanguy,

On Tue, Nov 24, 2009 at 2:55 PM, Tanguy Fautre
tang...@aristechnologies.com wrote:
 http://users.telenet.be/tfautre/softdev/tristripper/

Thanks the link and explanation.

 After a quick look at the header, I've noticed protections against
 min/max macros that will cause a hard failure when those are detected
 (which you probably want to avoid in a library such as OSG). Thinking
 about it now, this is a bit harsh as I've learned since now how to
avoid
 macro expansion. For example, replacing

 const size_t Overlap = std::min(PossibleOverlap, size());

 by

 const size_t Overlap = (std::min)(PossibleOverlap, size());

 will avoid the macro replacement and use the std function instead.

Is there any chance you can max this fix the TriStripper before I take
a copy and merge it with the OSG?


Cheers,
Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TriStripVisitor issue

2009-11-24 Thread Robert Osfield
On Tue, Nov 24, 2009 at 4:59 PM, Tanguy Fautre
tang...@aristechnologies.com wrote:
 I'll do these modifications and check them tonight when I'm back home.
 To speed things up (and because we're going to backport OSG changes),
 I'm not going to do a full release on TriStripper website yet; instead
 I'll send you a zip containing the updated version.

Thanks, just send me the zip file and should be get on to do a
review/merge tomorrow.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] TriStripVisitor issue

2009-11-23 Thread Emmanuel Roche
Hi everyone,

I have a strange problem with the TryStripVisitor:

When I use it on a model (with about 6000 triangles, described as TRIANGLES
[thus using 18000 vertices]) I get trip strip primitive sets indeed BUT
actually I get a few TRIANGLE_STRIP primitive sets with 4 vertices in each,
and then a single big TRIANGLES primitive set with about 17950 vertices 

So, most of the model is just not stripped at all ! any idea what I could be
doing wrong ???

Moreother, I've noticed that the geometry is then transformed as an indexed
geometry... correct me if I'm wrong but indexed geometries are slower that
simple vertices ordered arrays. If there a way to switch this or am I on my
own on this ?

Regards,
Manu.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TriStripVisitor issue

2009-11-23 Thread Emmanuel Roche
Okay,

more details on this:

the problem comes from the helper structure VertexAttribComparitor

in the function VertexAttribComparitor::compare(unsigned int lhs, unsigned
int rhs) we call the template array compare(unsigned int lhs, unsigned int
rhs) function, and there we just use regular comparisons:

virtual int compare(unsigned int lhs,unsigned int rhs) const
{
const T elem_lhs = (*this)[lhs];
const T elem_rhs = (*this)[rhs];
if (elem_lhselem_rhs) return -1;
if (elem_rhselem_lhs) return 1;
return 0;
}

here we don't take any precision into account at all... whereas my
vertices are given in meter units and may have a little resolution of about
0.1 millimeter !

So this implementation won't fit for my needs (and I think there is an high
chance it may not fit the needs for many other people no ?) maybe we should
add a precision parameter at some point, but for now I just don't have the
time to deal with this properly :-)

Cheers,
Manu.


2009/11/23 Emmanuel Roche roche.emman...@gmail.com

 Hi Robert,

 Actually, I've noticed that the problem doesn't come from the underlying
 tristripper library:

 instead, it seems that the indice array generated from my vertices is
 incorrect: I suspect that the comparison function to find if too vertices
 are the same or not is too precise in my case. Do you have a clear idea
 where this is done ? (otherwise, I will just read more code and find it...)

 cheers,

 Manu.



 2009/11/23 Emmanuel Roche roche.emman...@gmail.com

 Actually, I also noticed that OSG v2.8.1 uses version 1.0 of the
 tristripper library.

 As I'm quite in an hurry, I think I will re-implement my own
 tristripvisitor with the latest version of tristripper and check if this
 makes a difference. Will let you know what's the result of this test.

 But I believe this could really be a generic issue (it happens with all
 the models I tested) and thus would mean many people are currently using
 not so well tri-stripped geometries if they use this optimiser feature !
 (it is the case for instance in the OSGExp export plugin for 3DS max as I've
 noticed this issue there for the first time).

 regards,
 Manu.



 2009/11/23 Robert Osfield robert.osfi...@gmail.com

 Hi Manu,

 If the tristripper doesn't connect the triangles together well then it
 can result on few tristrips and lots of unconnected traingles that it
 has to put into a single list of triangles to avoid lots of separate
 primitive calls.

 As to why your model is not being stripped well I can't say.  We've
 used 3rd party code to do the tri-stripping so I'm not best placed to
 answer the low level questions, but... the original author of the cdoe
 Tanguy Fautre is now an OSG user and I believe still on the list so
 perhaps he'll be able to chip in ;-)

 Robert.

 On Mon, Nov 23, 2009 at 11:08 AM, Emmanuel Roche
 roche.emman...@gmail.com wrote:
  Hi everyone,
 
  I have a strange problem with the TryStripVisitor:
 
  When I use it on a model (with about 6000 triangles, described as
 TRIANGLES
  [thus using 18000 vertices]) I get trip strip primitive sets indeed
 BUT
  actually I get a few TRIANGLE_STRIP primitive sets with 4 vertices in
 each,
  and then a single big TRIANGLES primitive set with about 17950 vertices
 
 
  So, most of the model is just not stripped at all ! any idea what I
 could be
  doing wrong ???
 
  Moreother, I've noticed that the geometry is then transformed as an
 indexed
  geometry... correct me if I'm wrong but indexed geometries are slower
 that
  simple vertices ordered arrays. If there a way to switch this or am I
 on my
  own on this ?
 
  Regards,
  Manu.
 
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TriStripVisitor issue

2009-11-23 Thread Robert Osfield
Hi Manu,

The TriStripVisitor shouldn't change anything in the data apart form
re-organize it.  Adding in tolerances to the vertex comparisons would
require the vertex data to modified to collapse adjacent vertices's
onto the same position in space.

Would could add such functionality as an extra pass to
TriStripVisitor, but the default would have to be not to do this.
Personally I'd suggest having a separate visitor do this operation of
collapsing nearby vertices on to one another, and then pre-process the
data before tri-stripping it.

Robert.



On Mon, Nov 23, 2009 at 2:25 PM, Emmanuel Roche
roche.emman...@gmail.com wrote:
 Okay,

 more details on this:

 the problem comes from the helper structure VertexAttribComparitor

 in the function VertexAttribComparitor::compare(unsigned int lhs, unsigned
 int rhs) we call the template array compare(unsigned int lhs, unsigned int
 rhs) function, and there we just use regular comparisons:

     virtual int compare(unsigned int lhs,unsigned int rhs) const
     {
     const T elem_lhs = (*this)[lhs];
     const T elem_rhs = (*this)[rhs];
     if (elem_lhselem_rhs) return -1;
     if (elem_rhselem_lhs) return 1;
     return 0;
     }

 here we don't take any precision into account at all... whereas my
 vertices are given in meter units and may have a little resolution of about
 0.1 millimeter !

 So this implementation won't fit for my needs (and I think there is an high
 chance it may not fit the needs for many other people no ?) maybe we should
 add a precision parameter at some point, but for now I just don't have the
 time to deal with this properly :-)

 Cheers,
 Manu.


 2009/11/23 Emmanuel Roche roche.emman...@gmail.com

 Hi Robert,

 Actually, I've noticed that the problem doesn't come from the underlying
 tristripper library:

 instead, it seems that the indice array generated from my vertices is
 incorrect: I suspect that the comparison function to find if too vertices
 are the same or not is too precise in my case. Do you have a clear idea
 where this is done ? (otherwise, I will just read more code and find it...)

 cheers,

 Manu.



 2009/11/23 Emmanuel Roche roche.emman...@gmail.com

 Actually, I also noticed that OSG v2.8.1 uses version 1.0 of the
 tristripper library.

 As I'm quite in an hurry, I think I will re-implement my own
 tristripvisitor with the latest version of tristripper and check if this
 makes a difference. Will let you know what's the result of this test.

 But I believe this could really be a generic issue (it happens with all
 the models I tested) and thus would mean many people are currently using
 not so well tri-stripped geometries if they use this optimiser feature !
 (it is the case for instance in the OSGExp export plugin for 3DS max as I've
 noticed this issue there for the first time).

 regards,
 Manu.



 2009/11/23 Robert Osfield robert.osfi...@gmail.com

 Hi Manu,

 If the tristripper doesn't connect the triangles together well then it
 can result on few tristrips and lots of unconnected traingles that it
 has to put into a single list of triangles to avoid lots of separate
 primitive calls.

 As to why your model is not being stripped well I can't say.  We've
 used 3rd party code to do the tri-stripping so I'm not best placed to
 answer the low level questions, but... the original author of the cdoe
 Tanguy Fautre is now an OSG user and I believe still on the list so
 perhaps he'll be able to chip in ;-)

 Robert.

 On Mon, Nov 23, 2009 at 11:08 AM, Emmanuel Roche
 roche.emman...@gmail.com wrote:
  Hi everyone,
 
  I have a strange problem with the TryStripVisitor:
 
  When I use it on a model (with about 6000 triangles, described as
  TRIANGLES
  [thus using 18000 vertices]) I get trip strip primitive sets
  indeed BUT
  actually I get a few TRIANGLE_STRIP primitive sets with 4 vertices in
  each,
  and then a single big TRIANGLES primitive set with about 17950
  vertices 
 
  So, most of the model is just not stripped at all ! any idea what I
  could be
  doing wrong ???
 
  Moreother, I've noticed that the geometry is then transformed as an
  indexed
  geometry... correct me if I'm wrong but indexed geometries are slower
  that
  simple vertices ordered arrays. If there a way to switch this or am I
  on my
  own on this ?
 
  Regards,
  Manu.
 
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org

 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___

Re: [osg-users] TriStripVisitor issue

2009-11-23 Thread Stephan Kussmaul

Hi Manu,

We found a bug those days in TriStripVisitor.cpp. I didn't really read 
your latest email, but this might be related to your precision issues:


class WriteValue : public osg::ConstValueVisitor
{
   ...
   // add those 3 lines
   virtual void apply(const Vec2d v) { _o  v; }
   virtual void apply(const Vec3d v) { _o  v; }
   virtual void apply(const Vec4d v) { _o  v; }
   ...
}

class RemapArray : public osg::ArrayVisitor
{
   ...
   // add those 3 lines
   virtual void apply(osg::Vec2dArray array) { remap(array); }
   virtual void apply(osg::Vec3dArray array) { remap(array); }
   virtual void apply(osg::Vec4dArray array) { remap(array); }
   ...
}

Hope this helps.

Regards,

Stephan

Emmanuel Roche schrieb:

Hi Robert,

Actually, I've noticed that the problem doesn't come from the 
underlying tristripper library:


instead, it seems that the indice array generated from my vertices is 
incorrect: I suspect that the comparison function to find if too 
vertices are the same or not is too precise in my case. Do you have a 
clear idea where this is done ? (otherwise, I will just read more code 
and find it...)


cheers,

Manu.



2009/11/23 Emmanuel Roche roche.emman...@gmail.com 
mailto:roche.emman...@gmail.com


Actually, I also noticed that OSG v2.8.1 uses version 1.0 of the
tristripper library.

As I'm quite in an hurry, I think I will re-implement my own
tristripvisitor with the latest version of tristripper and check
if this makes a difference. Will let you know what's the result of
this test.

But I believe this could really be a generic issue (it happens
with all the models I tested) and thus would mean many people are
currently using not so well tri-stripped geometries if they use
this optimiser feature !  (it is the case for instance in the
OSGExp export plugin for 3DS max as I've noticed this issue there
for the first time).

regards,
Manu.



2009/11/23 Robert Osfield robert.osfi...@gmail.com
mailto:robert.osfi...@gmail.com

Hi Manu,

If the tristripper doesn't connect the triangles together well
then it
can result on few tristrips and lots of unconnected traingles
that it
has to put into a single list of triangles to avoid lots of
separate
primitive calls.

As to why your model is not being stripped well I can't say.
 We've
used 3rd party code to do the tri-stripping so I'm not best
placed to
answer the low level questions, but... the original author of
the cdoe
Tanguy Fautre is now an OSG user and I believe still on the
list so
perhaps he'll be able to chip in ;-)

Robert.

On Mon, Nov 23, 2009 at 11:08 AM, Emmanuel Roche
roche.emman...@gmail.com mailto:roche.emman...@gmail.com
wrote:
 Hi everyone,

 I have a strange problem with the TryStripVisitor:

 When I use it on a model (with about 6000 triangles,
described as TRIANGLES
 [thus using 18000 vertices]) I get trip strip primitive sets
indeed BUT
 actually I get a few TRIANGLE_STRIP primitive sets with 4
vertices in each,
 and then a single big TRIANGLES primitive set with about
17950 vertices 

 So, most of the model is just not stripped at all ! any idea
what I could be
 doing wrong ???

 Moreother, I've noticed that the geometry is then
transformed as an indexed
 geometry... correct me if I'm wrong but indexed geometries
are slower that
 simple vertices ordered arrays. If there a way to switch
this or am I on my
 own on this ?

 Regards,
 Manu.



 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
mailto:osg-users@lists.openscenegraph.org


http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
mailto:osg-users@lists.openscenegraph.org

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  


--
-
Stephan Kussmaul
Geschaeftsfuehrender Gesellschafter / Managing Director
TrianGraphics GmbH
Schoenhauser Allee 45
10435 Berlin
Germany
Tel: +49 (0)30 48495565   FAX: +49 (0)30 48495581
Email: stephan.kussm...@triangraphics.de
Web: 

Re: [osg-users] TriStripVisitor issue

2009-11-23 Thread Robert Osfield
HI Stephan,

On Mon, Nov 23, 2009 at 2:31 PM, Stephan Kussmaul
stephan.kussm...@triangraphics.de wrote:
 We found a bug those days in TriStripVisitor.cpp. I didn't really read your
 latest email, but this might be related to your precision issues:

What bug was this?  Could you explain?  Which version of the OSG?


 class WriteValue : public osg::ConstValueVisitor
 {
   ...
       // add those 3 lines
       virtual void apply(const Vec2d v) { _o  v; }
       virtual void apply(const Vec3d v) { _o  v; }
       virtual void apply(const Vec4d v) { _o  v; }
   ...
 }

 class RemapArray : public osg::ArrayVisitor
 {
   ...
       // add those 3 lines
       virtual void apply(osg::Vec2dArray array) { remap(array); }
       virtual void apply(osg::Vec3dArray array) { remap(array); }
       virtual void apply(osg::Vec4dArray array) { remap(array); }
   ...
 }

And these lines do what?  To address what issue?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TriStripVisitor issue

2009-11-23 Thread Stephan Kussmaul

Hi Robert,

We are using OSG 2.8.2.

The problem we encountered was when the TriStripVisitor was used with 
double data (e.g. for OpenFlight with double precision). As far as I can 
remember in this case the wrong member function (remap(...))  in the 
base class was used. That's why we had to add those additional 
overloads. Otherwise we later encountered crashes with indices pointing 
to Nirvana.


-Stephan



Robert Osfield schrieb:

HI Stephan,

On Mon, Nov 23, 2009 at 2:31 PM, Stephan Kussmaul
stephan.kussm...@triangraphics.de wrote:
  

We found a bug those days in TriStripVisitor.cpp. I didn't really read your
latest email, but this might be related to your precision issues:



What bug was this?  Could you explain?  Which version of the OSG?

  

class WriteValue : public osg::ConstValueVisitor
{
  ...
  // add those 3 lines
  virtual void apply(const Vec2d v) { _o  v; }
  virtual void apply(const Vec3d v) { _o  v; }
  virtual void apply(const Vec4d v) { _o  v; }
  ...
}

class RemapArray : public osg::ArrayVisitor
{
  ...
  // add those 3 lines
  virtual void apply(osg::Vec2dArray array) { remap(array); }
  virtual void apply(osg::Vec3dArray array) { remap(array); }
  virtual void apply(osg::Vec4dArray array) { remap(array); }
  ...
}



And these lines do what?  To address what issue?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


  


--
-
Stephan Kussmaul
Geschaeftsfuehrender Gesellschafter / Managing Director
TrianGraphics GmbH
Schoenhauser Allee 45
10435 Berlin
Germany
Tel: +49 (0)30 48495565   FAX: +49 (0)30 48495581
Email: stephan.kussm...@triangraphics.de
Web: www.triangraphics.de
-
Sitz der Gesellschaft / Corporate Headquarters:
TrianGraphics GmbH, Berlin
Registereintragung / Registration:
Amtsgericht Berlin-Charlottenburg HRB 93807 B
Geschaeftsfuehrer / Managing Directors:
Stephan Kussmaul, Mirco Nierenz, Volker Walkiewicz 



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TriStripVisitor issue

2009-11-23 Thread Robert Osfield
Hi Stephan,

On Mon, Nov 23, 2009 at 4:15 PM, Stephan Kussmaul
stephan.kussm...@triangraphics.de wrote:
 The problem we encountered was when the TriStripVisitor was used with double
 data (e.g. for OpenFlight with double precision). As far as I can remember
 in this case the wrong member function (remap(...))  in the base class was
 used. That's why we had to add those additional overloads. Otherwise we
 later encountered crashes with indices pointing to Nirvana.

Could you send me the whole modified file to osg-submissions so I can
do a full review.

Thanks,
Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org