Re: [osg-users] Model(s) load ~10 times longer in 3.6.x than 3.4.x series in osgviewer (and my in-house software)
After changing two files, I have ive files loading very fast AND osgconv converting obj files to osg and ive files very fast. You'll have to forgive my lack of understanding a lot of the internals of OSG. The code I changed was due to noticing where bottle necks (for loops) were occurring when loading .ive files in my program. Once I changed the code and created new libraries, I tested them on the osgconv with speed success. The code I changed was NOT in the obj plugin but in the osg library itself. I changed a few lines to previous changes compared to 3.4.1. Note that I did attempt at trying to use the 3.4.1 obj plugin, but quickly found it was not the problem. The two files I changed were Geometry.cpp and Drawable.cpp, and I'll need some help understanding why my changes really made a difference. When I would 'break' in my debugger when loading an ive file, most of the time the process ended up on a for loop in Geometry.cpp (line 582) in the getOrCreateElementBufferObject method. The callstack was Geometry::read, Geometry::addPrimitiveSet, Geometry::addElementBufferObjectRequired. I decided to make the change line 28 to #if 1 and add back all the if conditions of _useVertexBufferObjects. This fixed the load .ive issue but still did not fix the osgconv. I had to change Drawable.cpp line 229 to #if 1 to make _userVertecBufferObjects = false. Can someone take a look at the impact _useVertexBufferObjects has on certain files being loaded. It seems a check needs to be before the for loop of traversing through the drawElementList if it really doesn't need to be called. Thanks! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=74366#74366 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Extra draw calls in osgText?
Robert, While doing some performance testing on the nifty new osgText code, I found that for every text being drawn there are one or two extra glDrawElements calls with a count of zero. I was able to eliminate them by checking for an empty primitive set before this draw call: https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osgText/Text.cpp#L1151 It works, but I can't help wondering why the empty primitive sets exist in the first place. So I figured I'd see if you knew :) I am using the tip of the OSG 3.6.x branch. Glenn Waldron / osgEarth ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Model(s) load ~10 times longer in 3.6.x than 3.4.x series in osgviewer (and my in-house software)
On Thu, 19 Jul 2018 at 16:19, James Davis wrote: > I wanted to see if anyone had a chance to come up with some test code I might > could try out. Sorry if I sound like I'm nagging. :? I haven't personally looked at the code since I last replied. Perhaps others have. You have full access to the source code so no need to wait on others, you can dive in a make ammendments, if they are sound then I'd be happy to review and merge them in appropriate. As a general note, till the end of August my main focus is on the Vulkan Exploration Phase, I did a major push on OSG bug fixes for 3.6.2 and for the time being will be taking a back seat on non critical OSG bugs. Cheers, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Model(s) load ~10 times longer in 3.6.x than 3.4.x series in osgviewer (and my in-house software)
I wanted to see if anyone had a chance to come up with some test code I might could try out. Sorry if I sound like I'm nagging. :? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=74363#74363 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Can I use Material, Color, LightSource, etc. in Android?
Hi, http://forum.openscenegraph.org/viewtopic.php?t=11390 Chris is explaining well here. Hope it helps Cheers, Nick On Thu, Jul 19, 2018 at 12:09 PM Daniel Ponsoda wrote: > Hi, > > I'm playing with the OSG sample code for Android (GLES2) and as I see, it > attaches user defined GLSL shaders to the drawable objects in order to > display them with the proper shading effects. > > Is it not possible to use the OSG API Objects such as Material, Color, > LightSource etc. when programming for Android? > > I tried them but all I get is plain color shapes for my 3d objects with no > shading effects at all as we can see in the PC version of the sample code. > > I tried this code (scene draws shaded on Windows, but with plain colors on > Android): > > > Code: > > // Create a light source > osg::LightSource ls = new LightSource; > ls->getLight()->setPosition(Vec4(10, 10, 20, 0)); > ls->getLight()->setAmbient(Vec4(0.2, 0.2, 0.2, 1.0)); > ls->getLight()->setDiffuse(Vec4(0.7, 0.4, 0.6, 1.0)); > ls->getLight()->setSpecular(Vec4(1.0, 1.0, 1.0, 1.0)); > root->addChild(ls.get()); > > // Create a sphere > ShapeDrawable* sphere = new ShapeDrawable(new Sphere(Vec3f(0, 0, 0), 2)); > Material *material = new Material(); > material->setDiffuse(Material::FRONT, Vec4(0, 1, 0, 1)); > sphere->getOrCreateStateSet()->setAttribute(material); > > > > > Is there a portable way to do this in Android? > > Thank you! > > Cheers, > Daniel[/code] > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=74361#74361 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Can I use Material, Color, LightSource, etc. in Android?
Hi, I'm playing with the OSG sample code for Android (GLES2) and as I see, it attaches user defined GLSL shaders to the drawable objects in order to display them with the proper shading effects. Is it not possible to use the OSG API Objects such as Material, Color, LightSource etc. when programming for Android? I tried them but all I get is plain color shapes for my 3d objects with no shading effects at all as we can see in the PC version of the sample code. I tried this code (scene draws shaded on Windows, but with plain colors on Android): Code: // Create a light source osg::LightSource ls = new LightSource; ls->getLight()->setPosition(Vec4(10, 10, 20, 0)); ls->getLight()->setAmbient(Vec4(0.2, 0.2, 0.2, 1.0)); ls->getLight()->setDiffuse(Vec4(0.7, 0.4, 0.6, 1.0)); ls->getLight()->setSpecular(Vec4(1.0, 1.0, 1.0, 1.0)); root->addChild(ls.get()); // Create a sphere ShapeDrawable* sphere = new ShapeDrawable(new Sphere(Vec3f(0, 0, 0), 2)); Material *material = new Material(); material->setDiffuse(Material::FRONT, Vec4(0, 1, 0, 1)); sphere->getOrCreateStateSet()->setAttribute(material); Is there a portable way to do this in Android? Thank you! Cheers, Daniel[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=74361#74361 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org