Re: [osg-users] FBX reading of GL_POLYGON
Alright then. Hope the algorithm works for all cases. I tested it a bit more, and as far as I can tell it seems okay. Please keep us (I mean the mailing list) in touch. Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : I've had a quick look but I'm going to need to rewrite it to fit with newer code so it's on my to-do list. On 13 July 2010 16:16, Sukender suky0...@free.fr wrote: Hi Michael, hi all, Sorry to push this topic up, but did you test the code (anyone)? Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : Hi Michael, I managed to write the code, but I need testing. Moreover I can't update the FBX plugin because of the regression I told you in another thread, concerning images. Can you, please: - Merge changes to your working copy, and - Make a few tests with your models? Also feel free to commit if everything seems okay. Attached file is against rev. 11322 of the trunk. Many thanks. For info, my implemtation looks like: - Add points of the triangles - Detect how to split quads (02 or 13), and add points for the two triangles - Save polygons in a temporary array - Add a primitive set for all triangles (DrawArray) - Add polygons points AFTER the points of the triangles - Add primitive sets for polygons - Tessellate Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : Alright. I started working on it. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : Oh, right, sorry I didn't spot this. Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : I was referring to that by For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. On 6 July 2010 09:02, Sukender suky0...@free.fr wrote: Oh... What about concave quads (I mean 4 points polygons)? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : OK. If you got time for this before I do... :) Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : Waht you could do is leave all the triangles and quads in one PrimitiveSet (like it is already), but put each polygon with =5 vertices in it's own PrimitiveSet with Mode=POLYGON. Then run the Tesselator on the Geometry which should tesselate the polygons automagically. On 5 July 2010 13:49, Sukender suky0...@free.fr wrote: Hi Michael, Yes, sorry about OpenGL interpretation of polygons, I forgot that. Well actually, I guess the reader has to handle most (all?) cases. So I suggest to have something like: - If number of points = 4, use current code. - Else call GLU tesselation. Do you agree? The problem I have is that osgUtil::Tessellator is intended to operate on osg's structures. Any idea on how to make it work easily in the reader plugin? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : No, 1 to 1 mapping of primitives isn't possible because OpenGL doesn't render concave polygons correctly (in practice GL_POLYGON is the same as GL_TRIANGLE_FAN). Tesselation is possible via GLU but very slow so we need to be careful about how we use that. Most models I've come across have many triangles and quads but few polygons =5 vertices. If we apply triangulation to those few polygons then most models will be unaffected. For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. However, if your content provider could just produce models that are already suitable for real-time rendering that would be best ;) On 5 July 2010 09:09,
Re: [osg-users] FBX reading of GL_POLYGON
I've had a quick look but I'm going to need to rewrite it to fit with newer code so it's on my to-do list. On 13 July 2010 16:16, Sukender suky0...@free.fr wrote: Hi Michael, hi all, Sorry to push this topic up, but did you test the code (anyone)? Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : Hi Michael, I managed to write the code, but I need testing. Moreover I can't update the FBX plugin because of the regression I told you in another thread, concerning images. Can you, please: - Merge changes to your working copy, and - Make a few tests with your models? Also feel free to commit if everything seems okay. Attached file is against rev. 11322 of the trunk. Many thanks. For info, my implemtation looks like: - Add points of the triangles - Detect how to split quads (02 or 13), and add points for the two triangles - Save polygons in a temporary array - Add a primitive set for all triangles (DrawArray) - Add polygons points AFTER the points of the triangles - Add primitive sets for polygons - Tessellate Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : Alright. I started working on it. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : Oh, right, sorry I didn't spot this. Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : I was referring to that by For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. On 6 July 2010 09:02, Sukender suky0...@free.fr wrote: Oh... What about concave quads (I mean 4 points polygons)? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : OK. If you got time for this before I do... :) Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : Waht you could do is leave all the triangles and quads in one PrimitiveSet (like it is already), but put each polygon with =5 vertices in it's own PrimitiveSet with Mode=POLYGON. Then run the Tesselator on the Geometry which should tesselate the polygons automagically. On 5 July 2010 13:49, Sukender suky0...@free.fr wrote: Hi Michael, Yes, sorry about OpenGL interpretation of polygons, I forgot that. Well actually, I guess the reader has to handle most (all?) cases. So I suggest to have something like: - If number of points = 4, use current code. - Else call GLU tesselation. Do you agree? The problem I have is that osgUtil::Tessellator is intended to operate on osg's structures. Any idea on how to make it work easily in the reader plugin? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : No, 1 to 1 mapping of primitives isn't possible because OpenGL doesn't render concave polygons correctly (in practice GL_POLYGON is the same as GL_TRIANGLE_FAN). Tesselation is possible via GLU but very slow so we need to be careful about how we use that. Most models I've come across have many triangles and quads but few polygons =5 vertices. If we apply triangulation to those few polygons then most models will be unaffected. For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. However, if your content provider could just produce models that are already suitable for real-time rendering that would be best ;) On 5 July 2010 09:09, Sukender suky0...@free.fr wrote: Hi all, The FBX reader seems to interpret FBX polygons as triangles. Well I guess this should not be, as 1-to-1 mapping of primitives is possible (as far as I know), but this is not really an issue. What is an issue is that
Re: [osg-users] FBX reading of GL_POLYGON
Hi Michael, hi all, Sorry to push this topic up, but did you test the code (anyone)? Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : Hi Michael, I managed to write the code, but I need testing. Moreover I can't update the FBX plugin because of the regression I told you in another thread, concerning images. Can you, please: - Merge changes to your working copy, and - Make a few tests with your models? Also feel free to commit if everything seems okay. Attached file is against rev. 11322 of the trunk. Many thanks. For info, my implemtation looks like: - Add points of the triangles - Detect how to split quads (02 or 13), and add points for the two triangles - Save polygons in a temporary array - Add a primitive set for all triangles (DrawArray) - Add polygons points AFTER the points of the triangles - Add primitive sets for polygons - Tessellate Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : Alright. I started working on it. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : Oh, right, sorry I didn't spot this. Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : I was referring to that by For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. On 6 July 2010 09:02, Sukender suky0...@free.fr wrote: Oh... What about concave quads (I mean 4 points polygons)? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : OK. If you got time for this before I do... :) Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : Waht you could do is leave all the triangles and quads in one PrimitiveSet (like it is already), but put each polygon with =5 vertices in it's own PrimitiveSet with Mode=POLYGON. Then run the Tesselator on the Geometry which should tesselate the polygons automagically. On 5 July 2010 13:49, Sukender suky0...@free.fr wrote: Hi Michael, Yes, sorry about OpenGL interpretation of polygons, I forgot that. Well actually, I guess the reader has to handle most (all?) cases. So I suggest to have something like: - If number of points = 4, use current code. - Else call GLU tesselation. Do you agree? The problem I have is that osgUtil::Tessellator is intended to operate on osg's structures. Any idea on how to make it work easily in the reader plugin? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : No, 1 to 1 mapping of primitives isn't possible because OpenGL doesn't render concave polygons correctly (in practice GL_POLYGON is the same as GL_TRIANGLE_FAN). Tesselation is possible via GLU but very slow so we need to be careful about how we use that. Most models I've come across have many triangles and quads but few polygons =5 vertices. If we apply triangulation to those few polygons then most models will be unaffected. For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. However, if your content provider could just produce models that are already suitable for real-time rendering that would be best ;) On 5 July 2010 09:09, Sukender suky0...@free.fr wrote: Hi all, The FBX reader seems to interpret FBX polygons as triangles. Well I guess this should not be, as 1-to-1 mapping of primitives is possible (as far as I know), but this is not really an issue. What is an issue is that concave polygons are not intepreted the right way. I think about two solutions: 1. Use tessellation code to get correct splitting 2. Do the 1-to-1 mapping of primitives Am I right ? Other ideas? Anyone having time for this? Thanks folks! Cheers,
Re: [osg-users] FBX reading of GL_POLYGON
Oh, right, sorry I didn't spot this. Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : I was referring to that by For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. On 6 July 2010 09:02, Sukender suky0...@free.fr wrote: Oh... What about concave quads (I mean 4 points polygons)? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : OK. If you got time for this before I do... :) Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : Waht you could do is leave all the triangles and quads in one PrimitiveSet (like it is already), but put each polygon with =5 vertices in it's own PrimitiveSet with Mode=POLYGON. Then run the Tesselator on the Geometry which should tesselate the polygons automagically. On 5 July 2010 13:49, Sukender suky0...@free.fr wrote: Hi Michael, Yes, sorry about OpenGL interpretation of polygons, I forgot that. Well actually, I guess the reader has to handle most (all?) cases. So I suggest to have something like: - If number of points = 4, use current code. - Else call GLU tesselation. Do you agree? The problem I have is that osgUtil::Tessellator is intended to operate on osg's structures. Any idea on how to make it work easily in the reader plugin? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : No, 1 to 1 mapping of primitives isn't possible because OpenGL doesn't render concave polygons correctly (in practice GL_POLYGON is the same as GL_TRIANGLE_FAN). Tesselation is possible via GLU but very slow so we need to be careful about how we use that. Most models I've come across have many triangles and quads but few polygons =5 vertices. If we apply triangulation to those few polygons then most models will be unaffected. For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. However, if your content provider could just produce models that are already suitable for real-time rendering that would be best ;) On 5 July 2010 09:09, Sukender suky0...@free.fr wrote: Hi all, The FBX reader seems to interpret FBX polygons as triangles. Well I guess this should not be, as 1-to-1 mapping of primitives is possible (as far as I know), but this is not really an issue. What is an issue is that concave polygons are not intepreted the right way. I think about two solutions: 1. Use tessellation code to get correct splitting 2. Do the 1-to-1 mapping of primitives Am I right ? Other ideas? Anyone having time for this? Thanks folks! Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ___ 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 ___ 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 ___ 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] FBX reading of GL_POLYGON
Alright. I started working on it. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : Oh, right, sorry I didn't spot this. Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : I was referring to that by For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. On 6 July 2010 09:02, Sukender suky0...@free.fr wrote: Oh... What about concave quads (I mean 4 points polygons)? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : OK. If you got time for this before I do... :) Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : Waht you could do is leave all the triangles and quads in one PrimitiveSet (like it is already), but put each polygon with =5 vertices in it's own PrimitiveSet with Mode=POLYGON. Then run the Tesselator on the Geometry which should tesselate the polygons automagically. On 5 July 2010 13:49, Sukender suky0...@free.fr wrote: Hi Michael, Yes, sorry about OpenGL interpretation of polygons, I forgot that. Well actually, I guess the reader has to handle most (all?) cases. So I suggest to have something like: - If number of points = 4, use current code. - Else call GLU tesselation. Do you agree? The problem I have is that osgUtil::Tessellator is intended to operate on osg's structures. Any idea on how to make it work easily in the reader plugin? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : No, 1 to 1 mapping of primitives isn't possible because OpenGL doesn't render concave polygons correctly (in practice GL_POLYGON is the same as GL_TRIANGLE_FAN). Tesselation is possible via GLU but very slow so we need to be careful about how we use that. Most models I've come across have many triangles and quads but few polygons =5 vertices. If we apply triangulation to those few polygons then most models will be unaffected. For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. However, if your content provider could just produce models that are already suitable for real-time rendering that would be best ;) On 5 July 2010 09:09, Sukender suky0...@free.fr wrote: Hi all, The FBX reader seems to interpret FBX polygons as triangles. Well I guess this should not be, as 1-to-1 mapping of primitives is possible (as far as I know), but this is not really an issue. What is an issue is that concave polygons are not intepreted the right way. I think about two solutions: 1. Use tessellation code to get correct splitting 2. Do the 1-to-1 mapping of primitives Am I right ? Other ideas? Anyone having time for this? Thanks folks! Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ___ 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 ___ 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 ___ osg-users mailing list
Re: [osg-users] FBX reading of GL_POLYGON
Hi Michael, I managed to write the code, but I need testing. Moreover I can't update the FBX plugin because of the regression I told you in another thread, concerning images. Can you, please: - Merge changes to your working copy, and - Make a few tests with your models? Also feel free to commit if everything seems okay. Attached file is against rev. 11322 of the trunk. Many thanks. For info, my implemtation looks like: - Add points of the triangles - Detect how to split quads (02 or 13), and add points for the two triangles - Save polygons in a temporary array - Add a primitive set for all triangles (DrawArray) - Add polygons points AFTER the points of the triangles - Add primitive sets for polygons - Tessellate Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : Alright. I started working on it. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : Oh, right, sorry I didn't spot this. Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : I was referring to that by For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. On 6 July 2010 09:02, Sukender suky0...@free.fr wrote: Oh... What about concave quads (I mean 4 points polygons)? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : OK. If you got time for this before I do... :) Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : Waht you could do is leave all the triangles and quads in one PrimitiveSet (like it is already), but put each polygon with =5 vertices in it's own PrimitiveSet with Mode=POLYGON. Then run the Tesselator on the Geometry which should tesselate the polygons automagically. On 5 July 2010 13:49, Sukender suky0...@free.fr wrote: Hi Michael, Yes, sorry about OpenGL interpretation of polygons, I forgot that. Well actually, I guess the reader has to handle most (all?) cases. So I suggest to have something like: - If number of points = 4, use current code. - Else call GLU tesselation. Do you agree? The problem I have is that osgUtil::Tessellator is intended to operate on osg's structures. Any idea on how to make it work easily in the reader plugin? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : No, 1 to 1 mapping of primitives isn't possible because OpenGL doesn't render concave polygons correctly (in practice GL_POLYGON is the same as GL_TRIANGLE_FAN). Tesselation is possible via GLU but very slow so we need to be careful about how we use that. Most models I've come across have many triangles and quads but few polygons =5 vertices. If we apply triangulation to those few polygons then most models will be unaffected. For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. However, if your content provider could just produce models that are already suitable for real-time rendering that would be best ;) On 5 July 2010 09:09, Sukender suky0...@free.fr wrote: Hi all, The FBX reader seems to interpret FBX polygons as triangles. Well I guess this should not be, as 1-to-1 mapping of primitives is possible (as far as I know), but this is not really an issue. What is an issue is that concave polygons are not intepreted the right way. I think about two solutions: 1. Use tessellation code to get correct splitting 2. Do the 1-to-1 mapping of primitives Am I right ? Other ideas? Anyone having time for this? Thanks folks! Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list
Re: [osg-users] FBX reading of GL_POLYGON
Oh... What about concave quads (I mean 4 points polygons)? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : OK. If you got time for this before I do... :) Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : Waht you could do is leave all the triangles and quads in one PrimitiveSet (like it is already), but put each polygon with =5 vertices in it's own PrimitiveSet with Mode=POLYGON. Then run the Tesselator on the Geometry which should tesselate the polygons automagically. On 5 July 2010 13:49, Sukender suky0...@free.fr wrote: Hi Michael, Yes, sorry about OpenGL interpretation of polygons, I forgot that. Well actually, I guess the reader has to handle most (all?) cases. So I suggest to have something like: - If number of points = 4, use current code. - Else call GLU tesselation. Do you agree? The problem I have is that osgUtil::Tessellator is intended to operate on osg's structures. Any idea on how to make it work easily in the reader plugin? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : No, 1 to 1 mapping of primitives isn't possible because OpenGL doesn't render concave polygons correctly (in practice GL_POLYGON is the same as GL_TRIANGLE_FAN). Tesselation is possible via GLU but very slow so we need to be careful about how we use that. Most models I've come across have many triangles and quads but few polygons =5 vertices. If we apply triangulation to those few polygons then most models will be unaffected. For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. However, if your content provider could just produce models that are already suitable for real-time rendering that would be best ;) On 5 July 2010 09:09, Sukender suky0...@free.fr wrote: Hi all, The FBX reader seems to interpret FBX polygons as triangles. Well I guess this should not be, as 1-to-1 mapping of primitives is possible (as far as I know), but this is not really an issue. What is an issue is that concave polygons are not intepreted the right way. I think about two solutions: 1. Use tessellation code to get correct splitting 2. Do the 1-to-1 mapping of primitives Am I right ? Other ideas? Anyone having time for this? Thanks folks! Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ___ 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 ___ 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] FBX reading of GL_POLYGON
I was referring to that by For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. On 6 July 2010 09:02, Sukender suky0...@free.fr wrote: Oh... What about concave quads (I mean 4 points polygons)? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : OK. If you got time for this before I do... :) Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : Waht you could do is leave all the triangles and quads in one PrimitiveSet (like it is already), but put each polygon with =5 vertices in it's own PrimitiveSet with Mode=POLYGON. Then run the Tesselator on the Geometry which should tesselate the polygons automagically. On 5 July 2010 13:49, Sukender suky0...@free.fr wrote: Hi Michael, Yes, sorry about OpenGL interpretation of polygons, I forgot that. Well actually, I guess the reader has to handle most (all?) cases. So I suggest to have something like: - If number of points = 4, use current code. - Else call GLU tesselation. Do you agree? The problem I have is that osgUtil::Tessellator is intended to operate on osg's structures. Any idea on how to make it work easily in the reader plugin? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : No, 1 to 1 mapping of primitives isn't possible because OpenGL doesn't render concave polygons correctly (in practice GL_POLYGON is the same as GL_TRIANGLE_FAN). Tesselation is possible via GLU but very slow so we need to be careful about how we use that. Most models I've come across have many triangles and quads but few polygons =5 vertices. If we apply triangulation to those few polygons then most models will be unaffected. For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. However, if your content provider could just produce models that are already suitable for real-time rendering that would be best ;) On 5 July 2010 09:09, Sukender suky0...@free.fr wrote: Hi all, The FBX reader seems to interpret FBX polygons as triangles. Well I guess this should not be, as 1-to-1 mapping of primitives is possible (as far as I know), but this is not really an issue. What is an issue is that concave polygons are not intepreted the right way. I think about two solutions: 1. Use tessellation code to get correct splitting 2. Do the 1-to-1 mapping of primitives Am I right ? Other ideas? Anyone having time for this? Thanks folks! Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ___ 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 ___ 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX reading of GL_POLYGON
No, 1 to 1 mapping of primitives isn't possible because OpenGL doesn't render concave polygons correctly (in practice GL_POLYGON is the same as GL_TRIANGLE_FAN). Tesselation is possible via GLU but very slow so we need to be careful about how we use that. Most models I've come across have many triangles and quads but few polygons =5 vertices. If we apply triangulation to those few polygons then most models will be unaffected. For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. However, if your content provider could just produce models that are already suitable for real-time rendering that would be best ;) On 5 July 2010 09:09, Sukender suky0...@free.fr wrote: Hi all, The FBX reader seems to interpret FBX polygons as triangles. Well I guess this should not be, as 1-to-1 mapping of primitives is possible (as far as I know), but this is not really an issue. What is an issue is that concave polygons are not intepreted the right way. I think about two solutions: 1. Use tessellation code to get correct splitting 2. Do the 1-to-1 mapping of primitives Am I right ? Other ideas? Anyone having time for this? Thanks folks! Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ___ 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] FBX reading of GL_POLYGON
Hi Michael, Yes, sorry about OpenGL interpretation of polygons, I forgot that. Well actually, I guess the reader has to handle most (all?) cases. So I suggest to have something like: - If number of points = 4, use current code. - Else call GLU tesselation. Do you agree? The problem I have is that osgUtil::Tessellator is intended to operate on osg's structures. Any idea on how to make it work easily in the reader plugin? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : No, 1 to 1 mapping of primitives isn't possible because OpenGL doesn't render concave polygons correctly (in practice GL_POLYGON is the same as GL_TRIANGLE_FAN). Tesselation is possible via GLU but very slow so we need to be careful about how we use that. Most models I've come across have many triangles and quads but few polygons =5 vertices. If we apply triangulation to those few polygons then most models will be unaffected. For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. However, if your content provider could just produce models that are already suitable for real-time rendering that would be best ;) On 5 July 2010 09:09, Sukender suky0...@free.fr wrote: Hi all, The FBX reader seems to interpret FBX polygons as triangles. Well I guess this should not be, as 1-to-1 mapping of primitives is possible (as far as I know), but this is not really an issue. What is an issue is that concave polygons are not intepreted the right way. I think about two solutions: 1. Use tessellation code to get correct splitting 2. Do the 1-to-1 mapping of primitives Am I right ? Other ideas? Anyone having time for this? Thanks folks! Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ___ 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] FBX reading of GL_POLYGON
Waht you could do is leave all the triangles and quads in one PrimitiveSet (like it is already), but put each polygon with =5 vertices in it's own PrimitiveSet with Mode=POLYGON. Then run the Tesselator on the Geometry which should tesselate the polygons automagically. On 5 July 2010 13:49, Sukender suky0...@free.fr wrote: Hi Michael, Yes, sorry about OpenGL interpretation of polygons, I forgot that. Well actually, I guess the reader has to handle most (all?) cases. So I suggest to have something like: - If number of points = 4, use current code. - Else call GLU tesselation. Do you agree? The problem I have is that osgUtil::Tessellator is intended to operate on osg's structures. Any idea on how to make it work easily in the reader plugin? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : No, 1 to 1 mapping of primitives isn't possible because OpenGL doesn't render concave polygons correctly (in practice GL_POLYGON is the same as GL_TRIANGLE_FAN). Tesselation is possible via GLU but very slow so we need to be careful about how we use that. Most models I've come across have many triangles and quads but few polygons =5 vertices. If we apply triangulation to those few polygons then most models will be unaffected. For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. However, if your content provider could just produce models that are already suitable for real-time rendering that would be best ;) On 5 July 2010 09:09, Sukender suky0...@free.fr wrote: Hi all, The FBX reader seems to interpret FBX polygons as triangles. Well I guess this should not be, as 1-to-1 mapping of primitives is possible (as far as I know), but this is not really an issue. What is an issue is that concave polygons are not intepreted the right way. I think about two solutions: 1. Use tessellation code to get correct splitting 2. Do the 1-to-1 mapping of primitives Am I right ? Other ideas? Anyone having time for this? Thanks folks! Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ___ 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX reading of GL_POLYGON
OK. If you got time for this before I do... :) Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : Waht you could do is leave all the triangles and quads in one PrimitiveSet (like it is already), but put each polygon with =5 vertices in it's own PrimitiveSet with Mode=POLYGON. Then run the Tesselator on the Geometry which should tesselate the polygons automagically. On 5 July 2010 13:49, Sukender suky0...@free.fr wrote: Hi Michael, Yes, sorry about OpenGL interpretation of polygons, I forgot that. Well actually, I guess the reader has to handle most (all?) cases. So I suggest to have something like: - If number of points = 4, use current code. - Else call GLU tesselation. Do you agree? The problem I have is that osgUtil::Tessellator is intended to operate on osg's structures. Any idea on how to make it work easily in the reader plugin? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Michael Platings mplati...@gmail.com a écrit : No, 1 to 1 mapping of primitives isn't possible because OpenGL doesn't render concave polygons correctly (in practice GL_POLYGON is the same as GL_TRIANGLE_FAN). Tesselation is possible via GLU but very slow so we need to be careful about how we use that. Most models I've come across have many triangles and quads but few polygons =5 vertices. If we apply triangulation to those few polygons then most models will be unaffected. For quads I imagine it would be possible to write some fast specialised code to see if they should be split across vertices (0,2) or (1,3) so that loading times remain bearable. However, if your content provider could just produce models that are already suitable for real-time rendering that would be best ;) On 5 July 2010 09:09, Sukender suky0...@free.fr wrote: Hi all, The FBX reader seems to interpret FBX polygons as triangles. Well I guess this should not be, as 1-to-1 mapping of primitives is possible (as far as I know), but this is not really an issue. What is an issue is that concave polygons are not intepreted the right way. I think about two solutions: 1. Use tessellation code to get correct splitting 2. Do the 1-to-1 mapping of primitives Am I right ? Other ideas? Anyone having time for this? Thanks folks! Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ___ 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 ___ 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