Re: [osg-users] Intercepting Windows messages
Hi Anders, You can create a separate "message-only" window to receive windows messages from the SpaceMouse. See the following MSDN page: https://msdn.microsoft.com/en-us/library/windows/desktop/ms632599(v=vs.85).aspx#message_only I've integrated the 3DConnexion SpaceNavigator into our application using this method, along with other 3rd party APIs that require a window handle. Cheers, Farshid On Thu, Nov 12, 2015 at 11:01 AM, Anders Backmanwrote: > So there seem to be only a very few alternatives for integrating such a > windows oriented toolkit as the 3DConnexion SpaceMouse... > > My idea of being able to create a custom implementation of a > GraphicsWindowWin32 would really open up for a better integration, albeit > not a portable one... > > Right now, using VRPN feels a bit strange in a native application (as it > requires a server). > > As far as I know there is no polling API for the 3DConnexion devices, no? > > I see older emails about accessing it through Direct3D, and native > USB...whereas listening to windows messages would be the "correct" way of > integrating it. > I would have to hack into the context classes to do this... > > Hm > > /Anders > > > On Thu, Nov 12, 2015 at 3:54 PM, Anders Backman wrote: > >> That is certainly an important call yes. >> >> I guess my problem is that these two calls are not interchangeable: >> >> #if 1 >> osg::ref_ptr gc = >> osg::GraphicsContext::createGraphicsContext(traits.get()); >> #else >> osg::ref_ptr window = new >> osgViewer::GraphicsWindowWin32(traits); >> gc = window.get(); >> #endif >> >> createGraphicsContext() will do a few more things which the creation of a >> osgViewer::GraphicsWindowWin32 does not. The question is really, is it >> possible to even consider this? >> Is there a mechanism for creating a custom GraphicsWindowWin32 or is this >> path doomed to fail. >> >> /Anders >> >> >> >> On Thu, Nov 12, 2015 at 3:31 PM, Trajce Nikolov NICK < >> trajce.nikolov.n...@gmail.com> wrote: >> >>> Did you tried something like: >>> >>> osgViewer::Viewer viewer; >>> viewer.getCamera()->setGraphicContext(gc); >>> >>> ? >>> >>> On Thu, Nov 12, 2015 at 2:52 PM, Anders Backman >>> wrote: >>> I notice that there is a major difference between osgViewer::Viewer and osgViewer::CompositeViewer: The following code: osgViewer::CompositeViewer viewer; osg::ref_ptr traits = new osg::GraphicsContext::Traits; traits->x = 100; traits->y = 100; traits->width = 1000; traits->height = 800; traits->windowDecoration = true; traits->doubleBuffer = true; traits->sharedContext = 0; osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); osgViewer::View* view = new osgViewer::View; view->setName("View one"); viewer.addView(view); view->setSceneData(scene.get()); view->getCamera()->setViewport(new osg::Viewport(0, 0, traits->width / 2, traits->height / 2)); view->getCamera()->setGraphicsContext(gc.get()); viewer.realize(); // Context already created. No call to GraphicsWIndowWIn32::GraphicsWIndowWin32 will be called If I replace osgViewerCompositeViewer with a osgViewer::Viewer and remove the creation of View, I get: viewer.realize(); // A new context is created. A new call to GraphicsWIndowWIn32::GraphicsWIndowWin32 will be called So it seems that osgViewer::Viewer does not respect? the previously created GraphicsCOntext? /Anders On Thu, Nov 12, 2015 at 2:24 PM, Anders Backman wrote: > That is quite explicit. I was thinking about some method for > intercepting events. > I tried fiddling with creating a custom GraphicsWindowWin32 class, but > it turns out that this is explicitly created internally in: > > osg::GraphicsContext* Win32WindowingSystem::createGraphicsContext( > osg::GraphicsContext::Traits* traits ) > { > ... > osg::ref_ptr window = new > GraphicsWindowWin32(traits); > > } > > So this does not seem to be the way to catch windows messages. > My idea was that I could register my instance of the > GraphicsWindowWin32 to implement the virtual method: > > LRESULT GraphicsWindowWin32::handleNativeWindowingEvent( HWND hwnd, > UINT uMsg, WPARAM wParam, LPARAM lParam ) > > > Where I could catch all windows events. > > > Turns out that I do not have enough understanding when and where > context etc is created. > > It seems that a GraphicsWindowWIn32 is first created at the call to: > > osg::ref_ptr gc = > osg::GraphicsContext::createGraphicsContext(traits.get()); > > > And then at the call to: >
Re: [osg-users] issue about getting the material properties from the current state in rendering info
Hi Gianluca, Have you tried using getLastAppliedAttribute on the osg::State object? const osg::Material* mat = dynamic_castconst osg::Material*(state.getLastAppliedAttribute(osg::StateAttribute::MATERIAL)); if(mat) { // do something with material } I've used this method to access attributes from the current state and it has worked for me. Cheers, Farshid On Tue, Jun 23, 2015 at 9:49 AM, Gianluca Natale nat...@europe.altair.com wrote: Thanks Sebastian, I’m simply trying to get the alpha value of the diffuse component of the material properties, because I have to pass it to an underlying graphic library that I use for rendering that custom drawable. BTW, I further investigated. In the following function: State::captureCurrentState(StateSet stateset) The _attributeMap actually contains as MATERIAL attribute exactly the pointer to the osg::Material property that I created. But in the attribute stack it appears as the ‘last_applied_attribute’, and ‘changed’ is set to true. For all other attributes the pointers stored in ‘last_applied_attribute’ are correct as well, but ‘changed’ is set to false. Also, in that AttributeStack the member attributeVec contains just one element, that is not the correct one (it points to a different osg::Material). While for all the other attributes, which have ‘changed’ set to false, last_applied_attribute coincides with the first element in attributeVec. I don’t know anything of that code, but I don’t understand why osg::Material appears to be changed while other attributes not. Or should I use a different API to get the current osg::Material? Thanks, Gianluca Natale *From:* osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Sebastian Messerschmidt *Sent:* martedì 23 giugno 2015 18:15 *To:* OpenSceneGraph Users; Osg Users *Subject:* Re: [osg-users] issue about getting the material properties from the current state in rendering info Am 23.06.2015 18:05, schrieb Gianluca Natale: Hi all, I’m using OSG 3.0.1. I have an issue when I try to retrieve the material properties from the rendering info, in my custom drawable. To be clearer: I have a custom drawable, for which I implemented a myDrawable::drawImplementation(osg::RenderInfo osgRenderInfo). When I try to get the material properties inside that function, by following code: osg::StateSet drwbStateSet; osg::State *state = osgRenderInfo.getState(); state-captureCurrentState(drwbStateSet); the returned material properties is invalid. Specifically, I put a breakpoint in following function: StateSet::setAttribute(StateAttribute *attribute, StateAttribute::OverrideValue value) that is called inside captureCurrentState. When the attribute is an osg::Material, the _ptr is different from the one allocated when the material has been set, in the state set associated to a parent node of that drawable. Furthermore, _userDataContainer is 0x, so no valid osg::Material is returned in the captured state set. User data defaults to nullptr. So if you're not setting it up that is expected. As you don't explain why you are trying to inspect state during draw it is hard to guess what you are after. I simply guess that your state is set up somewhere further up in the stategraph (i.e. in one of the parents) and that state is set up lazy. Maybe Robert can give some insights here. Any idea of the possible cause of the issue? Where did I go wrong? BTW, all other attributes (polygon offset, polygon mode, etc…) are returned correctly. Are you sure you are setting up an osg::Material state attribute somewhere? Thanks, Gianluca Natale ___ 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] Regarding Converting 3ds Max file in OSG format
Hi, Once you have installed the exporter, you should see a OpenSceneGraph Exporter option in the 3ds max export dialog. What version of 3ds max do you have installed? Cheers, Farshid On Mon, Jun 22, 2015 at 12:02 AM, HITESH Singhal ug201211...@iitj.ac.in wrote: Hi, I have a 3d model in 3ds max format, I want to change it in OSG format. I have also downloaded that OSG Exporter.But I don't know how to use it, because I'm not seeing any software after downloading this exporter. So can any one please help me out with this problem. Its urgent for my project work. Please reply at your earliest!! -- Regards Hitesh Singhal Electrical Engineering +91-8386837430 ___ 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] Regarding Converting 3ds Max file in OSG format
The exporter works as a plugin to 3ds max, so you will need to have 3ds max installed in order to use it. What exact format is the file in (.3ds or .max)? OSG comes with a .3ds file loader, so that should work if the file is in .3ds format. On Mon, Jun 22, 2015 at 10:23 AM, HITESH Singhal ug201211...@iitj.ac.in wrote: Hi, Thanks for reply. I'm not having any 3ds max software because I' unable to download it in my laptop. So can you suggest me any way to download it or is there any other way to convert 3ds file in OSG format. -- Regards Hitesh Singhal Electrical Engineering +91-8386837430 On Mon, Jun 22, 2015 at 10:49 PM, Farshid Lashkari fla...@gmail.com wrote: Hi, Once you have installed the exporter, you should see a OpenSceneGraph Exporter option in the 3ds max export dialog. What version of 3ds max do you have installed? Cheers, Farshid On Mon, Jun 22, 2015 at 12:02 AM, HITESH Singhal ug201211...@iitj.ac.in wrote: Hi, I have a 3d model in 3ds max format, I want to change it in OSG format. I have also downloaded that OSG Exporter.But I don't know how to use it, because I'm not seeing any software after downloading this exporter. So can any one please help me out with this problem. Its urgent for my project work. Please reply at your earliest!! -- Regards Hitesh Singhal Electrical Engineering +91-8386837430 ___ 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] How to use more than 4 texture units?
Hi Jannik, I suspect your driver only supports 4 texture units using the fixed function. Check the GL_MAX_TEXTURE_UNITS value to verify: GLint units; glGetIntegerv(GL_MAX_TEXTURE_UNITS, units); My GeForce GTX 760 only supports 4 fixed function texture units, but up to 32 units using the shader pipeline. Are you sure the non-OSG based app was using the fixed function pipeline? Cheers, Farshid On Wed, Jun 17, 2015 at 10:47 AM, Jannik Heller scr...@baseoftrash.de wrote: Oops, posted wrong code - that should have been 4 instead of 3, of course. Code: diff --git a/examples/osgbillboard/osgbillboard.cpp b/examples/osgbillboard/osgbillboard.cpp index a6243e8..64f893c 100644 --- a/examples/osgbillboard/osgbillboard.cpp +++ b/examples/osgbillboard/osgbillboard.cpp @@ -67,7 +67,7 @@ osg::Drawable* createSquare(const osg::Vec3 corner,const osg::Vec3 width,const (*tcoords)[1].set(1.0f,0.0f); (*tcoords)[2].set(1.0f,1.0f); (*tcoords)[3].set(0.0f,1.0f); -geom-setTexCoordArray(0,tcoords); +geom-setTexCoordArray(4,tcoords); geom-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4)); @@ -76,7 +76,7 @@ osg::Drawable* createSquare(const osg::Vec3 corner,const osg::Vec3 width,const osg::StateSet* stateset = new osg::StateSet; osg::Texture2D* texture = new osg::Texture2D; texture-setImage(image); - stateset-setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON); + stateset-setTextureAttributeAndModes(4,texture,osg::StateAttribute::ON); geom-setStateSet(stateset); } -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64112#64112 ___ 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] Global draw callback
Hi Robert, I understand not wanting to add extra overhead. I'll look into the custom RenderBin approach. Also, I noticed the RenderLeaf::render method is virtual, but I don't see any way to provide a custom RenderLeaf class. The creation seems to be hard-coded within CullVisitor. Was this class originally designed to allow custom implementations? Cheers, Farshid On Tue, May 26, 2015 at 10:29 AM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Farshid, Added a if call on an inner loop of the draw dispatch traversal just for the purpose of niche debugging isn't something I feel is justifying as there will be CPU cost for everyone, even though very few people will use that feature. This type of customization would be better done via a custom RenderBin that overrides the RenderBin::drawImplementation(..); This way only those who need this customization would pay the extra cost of it. Robert. On 26 May 2015 at 18:24, Farshid Lashkari fla...@gmail.com wrote: Hi Robert, I've run into the situation multiple times where having a global draw callback would have been very convenient. It's mostly been for debugging scenarios, but I can also see other situations where being able to globally augment draw calls would also be useful. What are your thoughts on having a global draw callback part of the osg::State object? It doesn't seem like much code would need to be changed, and the performance impact should be minimal. Essentially, osgUtil::RenderLeaf would be modified to call: state.draw(_drawable, renderInfo); And osg::State::draw would look like: if(_drawCallback.valid()) _drawCallback-draw(_drawable, renderInfo); else _drawable-draw(renderInfo); Does this seem like a reasonable feature to add? I can work on a patch if you feel it's appropriate. Cheers, Farshid ___ 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] Global draw callback
Hi Robert, I've run into the situation multiple times where having a global draw callback would have been very convenient. It's mostly been for debugging scenarios, but I can also see other situations where being able to globally augment draw calls would also be useful. What are your thoughts on having a global draw callback part of the osg::State object? It doesn't seem like much code would need to be changed, and the performance impact should be minimal. Essentially, osgUtil::RenderLeaf would be modified to call: state.draw(_drawable, renderInfo); And osg::State::draw would look like: if(_drawCallback.valid()) _drawCallback-draw(_drawable, renderInfo); else _drawable-draw(renderInfo); Does this seem like a reasonable feature to add? I can work on a patch if you feel it's appropriate. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Texture Mapping Meeting Point Shadow
Hi Erik, That looks like a texture wrap issue. Try setting your texture wrap mode to CLAMP_TO_EDGE: pTexture-setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE); pTexture-setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE); Cheers, Farshid On Mon, May 11, 2015 at 12:39 PM, Erik Hensens ehens...@hunter.com wrote: Hello all! I'm having trouble with image texture mapping a geode. Specifically, where the top and the bottom of the image meet, there is a dark shadow effect that I want to avoid. I've created the simplest example of how I'm attempting the texture mapping and I've taken screenshots that show the unwanted shadow (please see the attached screenshots and the overlay image itself). Below is the code I'm using. As you can see, it's very simple: just four quadrangle faces that form four sides of an open-ended box. I've attempted to map the overlay image around the entire box so that the top and bottom meet at one of the four edges. Does anyone have any idea what I'm doing wrong or how I can modify my code to get rid of the shadow effect? Thanks a bunch in advance! Code: // Create the new geode node osg::ref_ptr osg::Geode pGeode = new osg::Geode; // Create the single new geometry osg::ref_ptr osg::Geometry pGeometry = new osg::Geometry; // The vertex array to define the geometry shape osg::ref_ptr osg::Vec3Array pVertices = new osg::Vec3Array; // Add face 1/4 quad vertices pVertices-push_back(osg::Vec3(0.0f, 0.0f, 0.0f)); pVertices-push_back(osg::Vec3(10.0f, 0.0f, 0.0f)); pVertices-push_back(osg::Vec3(10.0f, 5.0f, 5.0f)); pVertices-push_back(osg::Vec3(0.0f, 5.0f, 5.0f)); // Add face 2/4 quad vertices pVertices-push_back(osg::Vec3(0.0f, 5.0f, 5.0f)); pVertices-push_back(osg::Vec3(10.0f, 5.0f, 5.0f)); pVertices-push_back(osg::Vec3(10.0f, 0.0f, 10.0f)); pVertices-push_back(osg::Vec3(0.0f, 0.0f, 10.0f)); // Add face 3/4 quad vertices pVertices-push_back(osg::Vec3(0.0f, 0.0f, 10.0f)); pVertices-push_back(osg::Vec3(10.0f, 0.0f, 10.0f)); pVertices-push_back(osg::Vec3(10.0f, -5.0f, 5.0f)); pVertices-push_back(osg::Vec3(0.0f, -5.0f, 5.0f)); // Add face 4/4 quad vertices pVertices-push_back(osg::Vec3(0.0f, -5.0f, 5.0f)); pVertices-push_back(osg::Vec3(10.0f, -5.0f, 5.0f)); pVertices-push_back(osg::Vec3(10.0f, 0.0f, 0.0f)); pVertices-push_back(osg::Vec3(0.0f, 0.0f, 0.0f)); // Set the vertex array on the geometry pGeometry-setVertexArray(pVertices); // Create the geometry's color array osg::ref_ptr osg::Vec4Array pColors = new osg::Vec4Array; pColors-push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f)); // Set the color array on the geometry pGeometry-setColorArray(pColors); pGeometry-setColorBinding(osg::Geometry::BIND_OVERALL); // Set the quad draw array on the geometry osg::ref_ptr osg::DrawArrays pDrawArrays = new osg::DrawArrays(osg::PrimitiveSet::QUADS, 0, static_cast GLsizei (pVertices-size())); pGeometry-addPrimitiveSet(pDrawArrays); // Load the overlay image osg::ref_ptr osg::Image pImage = osgDB::readImageFile(overlay.png); // Create the image texture osg::ref_ptr osg::Texture2D pTexture = new osg::Texture2D(pImage); // Create the texture coordinates array osg::ref_ptr osg::Vec2Array pTexCoords = new osg::Vec2Array; // Set face 1/4 quad texture overlay coordinates pTexCoords-push_back(osg::Vec2(0.0f, 0.0f)); pTexCoords-push_back(osg::Vec2(1.0f, 0.0f)); pTexCoords-push_back(osg::Vec2(1.0f, 0.25f)); pTexCoords-push_back(osg::Vec2(0.0f, 0.25f)); // Set face 2/4 quad texture overlay coordinates pTexCoords-push_back(osg::Vec2(0.0f, 0.25f)); pTexCoords-push_back(osg::Vec2(1.0f, 0.25f)); pTexCoords-push_back(osg::Vec2(1.0f, 0.50f)); pTexCoords-push_back(osg::Vec2(0.0f, 0.50f)); // Set 3/4 quad texture overlay coordinates pTexCoords-push_back(osg::Vec2(0.0f, 0.50f)); pTexCoords-push_back(osg::Vec2(1.0f, 0.50f)); pTexCoords-push_back(osg::Vec2(1.0f, 0.75f)); pTexCoords-push_back(osg::Vec2(0.0f, 0.75f)); // Set 4/4 quad texture overlay coordinates pTexCoords-push_back(osg::Vec2(0.0f, 0.75f)); pTexCoords-push_back(osg::Vec2(1.0f, 0.75f)); pTexCoords-push_back(osg::Vec2(1.0f, 1.0f)); pTexCoords-push_back(osg::Vec2(0.0f, 1.0f)); // Set the geometry's texture coordinates array pGeometry-setTexCoordArray(0, pTexCoords); // Get the geometry's stateset osg::ref_ptr osg::StateSet pStateSet = pGeometry-getOrCreateStateSet(); // Set the texture on the stateset pStateSet-setTextureAttributeAndModes(0, pTexture, osg::StateAttribute::ON); // Set the geometry's stateset pGeometry-setStateSet(pStateSet); // Add the single drawable to the geode node pGeode-addDrawable(pGeometry); // Add this new geode to the scene pTopGroupNode-addChild(pGeode); Cheers, Erik -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63711#63711 ___ osg-users mailing list
Re: [osg-users] shipping custom file format plug-ins as part of an OSG application binary?
Hi Christian, Yes, this is possible. Once you have implemented your custom osgDB::ReaderWriter, you can use the osgDB::RegisterReaderWriterProxy to globally register the class. For example, if your custom class is named MyReaderWriter, just add the following in your source file: static osgDB::RegisterReaderWriterProxyMyReaderWriter g_MyReaderWriterProxy; This essentially adds an instance of your custom loader class with the global osgDB::Registry instance. As long as your class properly implements the acceptsExtension method, your application should now be able to handle the specified file format. Cheers, Farshid On Wed, Mar 11, 2015 at 10:43 AM, Christian Buchner christian.buch...@gmail.com wrote: Hi, let's say I have developed a plug-in to read a specific file format. Is it possible to make this plug-in part of the my application binary without shipping an additionall DLL in the osgPlugins folder? The rest of OSG remains a dynamic build - only that extra plugin is desired to be statically linked with my application. How would I go about registering said plug-in with OSG so it's getting used? Christian ___ 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] Unresolved External on set/getUserValue
Hi João, It sounds like you need to include the ValueObject header: #include osg/ValueObject Cheers, Farshid On Tue, Mar 10, 2015 at 3:38 PM, João joao.henrique.pi...@hotmail.com wrote: Everything else is working fine, but when I try to use the set/getUserValue functions, this happens: Error 2 error LNK2001: unresolved external symbol public: bool __cdecl osg::Object::getUserValueint(class std::basic_stringchar,struct std::char_traitschar,class std::allocatorchar const ,int )const (??$getUserValue@H@Object@osg@@QEBA_NAEBV?$basic_string@DU?$char_traits@D @std@@V?$allocator@D@2@@std@@AEAH@Z) C:\Users\Joao\documents\visual studio 2013\Projects\VRProjectDemo\VRProjectDemo\Main.obj VRProjectDemo Error 1 error LNK2001: unresolved external symbol public: void __cdecl osg::Object::setUserValueint(class std::basic_stringchar,struct std::char_traitschar,class std::allocatorchar const ,int const ) (??$setUserValue@H@Object@osg@@QEAAXAEBV?$basic_string@DU?$char_traits@D @std@@V?$allocator@D@2@@std@@AEBH@Z) C:\Users\Joao\documents\visual studio 2013\Projects\VRProjectDemo\VRProjectDemo\Main.obj VRProjectDemo Anyone have a clue about which lib I am missing? It's weird considering I have everything else working fine, including setUserData... ___ 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] #pragma(tic) shader composition support now checked into svn/trunk
Hi Robert, The new shader composition feature seems really interesting. The code sample is easy to follow and at first glance it does appear to be simpler to work with than the previous osg::ShaderComposer implementation. However, as someone who has invested a lot of time and work into the older framework, I'd like to also voice my concern over your plan to deprecate/remove it. I haven't had a chance to really dive into the implementation details, so forgive me if my concerns are completely overblown. Like David, I can't really provide a concise example program that demonstrates how I'm currently using the ShaderComposer framework. However, there are a couple features of the existing framework I'd like to point out that are absolutely critical for my use case. 1) Being able to override osg::ShaderComposer::getOrCreateProgram(). This is huge, because I can implement my own algorithm for composing shader code. It also gives me control of how the osg::Program object is generated and allows me to automatically apply uniforms based on the shader components. Another benefit is that I can implement my own shader caching strategy. 2) The osg::ShaderComposer object is called within the context of osg::State::apply. This is crucial, because it allows my composer to automatically apply textures based on the specified shader components. For example, if I wanted to add caustic lighting to the scene, my custom shader component would specify the caustic texture and shader code. The composer would then apply the texture to the next available texture unit and automatically apply the necessary sampler uniform. This makes it easy for us to define self contained shader effects that use textures, without needing to be aware of the scene and which texture units are available. This is also used for adding texture projected lights, ambient light cube maps, ramp-based lighting models, etc... If the new framework allows for such use cases, then great! If not, then I think it's reasonable to keep the old framework around for advanced use cases that require more low-level hooks into the scene graph. Again, the new framework looks great and I'm not criticizing it at all. I'm just worried about losing years of work I've invested into the old framework. Cheers, Farshid On Fri, Feb 13, 2015 at 7:00 AM, Robert Osfield robert.osfi...@gmail.com wrote: Hi All, I have now checked in core OSG support for a new form of shader composition that leverages #pragma's to extended GLSL shaders to specify which #define's that it requires from the scene graph. The scene graph passes these to the shaders via StateSet::setDefine(..) and provides full support for the OSG's state override/protected options. I have modified the osgshadercomposition example to illustrate a very simple example that utlizes three shaders checked into OpenSceneGraph-Data/shaders trunk. So on the code look for OpenSceneGraph/examples/osgshadercomposition.cpp and on the shader from look at OpenSceneGraph-Data/shaders/osgshadercompostion.vert, osgshadercomposition.frag and lighting.vert. I will write more later about how to use this new capability. It's gotta be one of the coolest features added to the OSG for quite a few years :-) Cheers, Robert. ___ 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] Half Side-by-side
Hi Francesco, For 3D TVs, the Side-by-Side and Top-Bottom modes will take the image on each half of the output, and stretch it to fill the entire display. Robert's advice of turning OFF the OSG_SPLIT_STEREO_AUTO_ADJUST_ASPECT_RATIO option should solve your problem. You want each eye to be rendered using the full aspect ratio of the TV. The output will look squished on your monitor, but the 3D TV will display it at the proper aspect ratio. Cheers, Farshid On Mon, Dec 1, 2014 at 3:40 AM, Francesco Argese kekk...@gmail.com wrote: Hello, I'm trying to display a simple OpenSceneGraph application on a 3d active tv that supports SBS Half (Half Side-by-Side) in FullHD resolution. I've already tried using stereo configuration for Side-by-side (HORIZONTAL_SPLIT) but the result is a stretched image. It seems that HORIZIONTAL_SPLIT was introduced to support output for CardBoard-like devices. Does exist a simple configuration to obtain the type of output I'm looking for? Or it is required to set it manually configuring the osg camera? Thanks in advance, Francesco Argese ___ 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] OSG deployment on Windows
Hi Émeric, Placing the external libraries in OSG_ROOT\bin should work as long as the main executable is also in OSG_ROOT\bin. Windows should first search for DLLs in the same folder as the executable before searching in PATH. So there is no need to add your application to PATH, or worry about conflicting DLLs in PATH. I've deployed my application like this for years and never had any issues. Cheers, Farshid On Wed, Sep 24, 2014 at 10:03 AM, Émeric MASCHINO emeric.masch...@gmail.com wrote: Hi, What's the best practice regarding OSG deployment on Windows? Indeed, several plug-ins depend on external libraries. Is it best to put the required DLLs in OSG_ROOT\bin\osgPlugins-X.Y.Z or rather in OSG_ROOT\bin, thus ensuring that OSG_ROOT\bin is in the PATH so that the plug-ins can find them? With this last approach, there's only one copy of each DLL shared by the OSG applications, plug-ins and examples. The drawback is that if a similarly named DLL is found in the PATH before reaching OSG_ROOT\bin, an incorrect DLL may be loaded. By contrast, copying the required DLLs in OSG_ROOT\bin\osgPlugins-X.Y.Z may also require copying them in OSG_ROOT\bin as well as in OSG_ROOT\share\OpenSceneGraph\bin. Any advice on what's better? Émeric ___ 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] OSG deployment on Windows
Hi Émeric, I'm assuming OSG_ROOT refers to the install folder of your OSG based application. The plug-ins should go into OSG_ROOT\bin\osgPlugins-X.Y.Z. OSG will automatically prepend the osgPlugins-X.Y.Z\ path when attempting to load osgdb_*.dll plugins. For example, let's say I install my application into the C:\MyApp\ folder. Here is how I organize the files: C:\MyApp\bin\ contains: - Executables (.exe) - OSG library files (osg.dll, osgDB.dll, osgUtil.dll, ...) - External dependencies (zlib1.dll, libxml2.dll, ...) C:\MyApp\bin\osgPlugins-X.Y.Z\ contains: - All OSG reader/writer plugins (osgdb_*.dll) Any executable launched from the C:\MyApp\bin\ folder, will automatically load dependencies from that folder before searching PATH. When attempting to load a reader/writer plugin, OSG will automatically look in C:\MyApp\bin\osgPlugins-X.Y.Z\. If any of those plugins have external dependencies, they will be loaded from C:\MyApp\bin\, before searching in PATH. This should allow multiple OSG based applications using different versions to be installed on the system without conflicts. Hope this clears it up. Cheers, Farshid On Wed, Sep 24, 2014 at 10:39 AM, Émeric MASCHINO emeric.masch...@gmail.com wrote: Hi Farshid, Correct, but what about the plug-ins and examples? They aren't installed in OSG_ROOT\bin. So if you only copy the DLLs in OSG_ROOT\bin, when trying to load a plug-in (installed in OSG_ROOT\bin\osgPlugins-X.Y.Z) or running an example (installed in OSG_ROOT\shared\OpenSceneGraph\bin) that requires an external DLL, this last one will thus be searched in the PATH, with the risk of finding a similarly named DLL elsewhere in the filesystem before reaching the expected on in OSG_ROOT\bin. How do you manage this situation on your own? Cheers, Émeric 2014-09-24 19:12 GMT+02:00 Farshid Lashkari fla...@gmail.com: Hi Émeric, Placing the external libraries in OSG_ROOT\bin should work as long as the main executable is also in OSG_ROOT\bin. Windows should first search for DLLs in the same folder as the executable before searching in PATH. So there is no need to add your application to PATH, or worry about conflicting DLLs in PATH. I've deployed my application like this for years and never had any issues. Cheers, Farshid On Wed, Sep 24, 2014 at 10:03 AM, Émeric MASCHINO emeric.masch...@gmail.com wrote: Hi, What's the best practice regarding OSG deployment on Windows? Indeed, several plug-ins depend on external libraries. Is it best to put the required DLLs in OSG_ROOT\bin\osgPlugins-X.Y.Z or rather in OSG_ROOT\bin, thus ensuring that OSG_ROOT\bin is in the PATH so that the plug-ins can find them? With this last approach, there's only one copy of each DLL shared by the OSG applications, plug-ins and examples. The drawback is that if a similarly named DLL is found in the PATH before reaching OSG_ROOT\bin, an incorrect DLL may be loaded. By contrast, copying the required DLLs in OSG_ROOT\bin\osgPlugins-X.Y.Z may also require copying them in OSG_ROOT\bin as well as in OSG_ROOT\share\OpenSceneGraph\bin. Any advice on what's better? Émeric ___ 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] osgExp 3ds max transforms
Hi Jorge, Can you provide the code you are using to load the model and place it under the MatrixTransform? I don't know what could cause this issue other than the scene graph not being setup properly. Christian mentioned it could be caused by a parent with an absolute reference frame. The exporter does not change the reference frame of any transforms, so maybe you are changing the reference frame in your code? Either way, seeing some code would help a lot. Cheers, Farshid On Mon, Aug 25, 2014 at 7:41 AM, Jorge D'Alpuim jorgealp...@gmail.com wrote: Hi, I am willing to export a 3D model from 3ds studio max to .osg files. Then, in my OSG application I assemble the exported model into a MatrixTransform node and apply some transformation. Althought, no matter which transformation I apply (rotate, translate or scale), it takes no effect in the final image. I realized that in the .osg file all the MatrixTransform nodes have their DataVariance attribute set to STATIC, but I already hard-coded it to DYNAMIC, but their transformations are still having no effect. Am I exporting the model the wrong way, or is the problem in the OSG application side? Thank you! Cheers, Jorge -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=60766#60766 ___ 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] 3d control in scene (ignore scene depth test)
Hi Jason, Robert's suggestion is usually the most efficient and what I use in most cases. However, if the object itself needs depth testing enabled to render properly, then another technique is to use an osg::Camera node. Set its render order to POST_RENDER and its clear mask to GL_DEPTH_BUFFER_BIT. The subgraph below the camera node will now be rendered over the main scene, but with depth testing enabled. Cheers, Farshid On Thu, Aug 14, 2014 at 6:17 PM, Jason Anderssen janders...@exactal.com wrote: Hi, Just a simple question that you probably will know the answer too. If I want to have a control in the scene, but I don’t want this object to obey the depth testing against the scene itself, how do I go about this. For example, the scene has a building, and I want to position an axis control in the centre of it, if it obeys the scenes depth testing it will not be shown, however I still want depth testing on the control itself to be correct. Thank you in advance for your help Cheers Jason Internet Email Confidentiality Footer: This email and any files transmitted with it contain privileged/confidential information intended for the addressee. Neither the confidentiality of nor any privilege in the email is waived, lost or destroyed by reason that it has been transmitted other than to the addressee. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. ___ 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] [osgPlugins] Very confused about plugins
Hi Bram, First off, I feel your pain. Is osgdb_png.dll in your osgPlugins-XXX subfolder? If so, then the DLL might be dynamically linking to the libpng library, instead of statically linking. If this is the case, then you will need to place the libpng13.dll file in your application folder (next to your exe). When dealing with DLL issues like this, I find the Dependency Walker ( http://www.dependencywalker.com/) application invaluable. Opening an exe/dll file in the application will list all its DLL dependencies and let you know which ones are missing or failed to load. Regarding the error message, I agree that they could be a little more clear. The error message does not distinguish between failing to find the DLL vs failing to load the DLL. Cheers, Farshid On Wed, Jul 16, 2014 at 11:58 AM, Bram Vaessen bram.vaes...@gmail.com wrote: Hi, I'm having issues with loading png. It just says: Warning: Could not find plugin to read objects from file GUI/canvas.png. The same line replaced with .jpg works fine. I built OSG 3.2 from source some time ago (using some tutorial, and CMake and such), and I recall that I tried to enable both jpg and png. Somehow png doesn't work. Now the real problem is: I have absolutely no clue to how this whole build system and plugin system works, and I can't seem to find decent information on it... only this: http://trac.openscenegraph.org/projects/osg//wiki/Support/UserGuides/Plugins also: when I try to load a non-existing file as an image, I get the exact same error. There is no way for a 'noob' like me (at least a noob in building systems) to understand or find out what the problem is. It looks like there is a libpng13d.lib in the lib dir, and I found a osgdb_png.dll and osgdb_png.dll somewhere that I copied to my projects working directory, but that doesn't seem to be enough... Honestly, I'm desperately confused. I have to admit that I just don't know that much about cmake, libraries and dll's etc. just know the basics, but there's a huge information gap between some very general information that you can find on cmake and osg plugins, and how the actual build system works in reality. There also doesn't seem info on how you can track down errors like plugins that are not loading. I also looked on the forums and there are some general tips like: you have to rebuild the png library... but then I'm like... ok ... how??? is that part of the osg source? I have no clue how to do this :( I know that with some random hints from users I may be able to fix this one problem this time, but then again I still wouldn't know what happened or how to fix the next problem with plugins. Isn't there more information on this? Or can someone explain it here how it all works? Like: -What are the steps that are involved in building the libraries, and loading them as plugins? -In each of these steps what files are supposed to be created and how can you check if that happened etc.? -how can you get more error information from the failing the loading of the plugin? I would be very very grateful for any information! Thank you! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=60302#60302 ___ 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] Promoting Drawable from being subclassed from osg::Object to osg::Node
Hi Robert, I'm definitely in favor of this change. It will simplify a lot of code. Regarding the change to Node::ParentList, I think this will cause some breakage. I know I have a lot of code that assumes the elements of ParentList are group nodes and performs Group operations on them (addChild, removeChild, etc..). Perhaps Geode could be modified to inherit from Group instead? The add/remove drawable methods could simply be wrappers for add/remove child. Just throwing the idea out there, I'm sure this would cause a whole host of other problems though. In general, I think breaking code is going to be unavoidable. The bounding sphere/box wrapper class is an interesting solution. I'm worried about the potential for segfaults though. It might be better to simply rename the method and force people to update their code at compile time, rather than dealing with possible segfaults at runtime. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Cull callbacks and Geodes
Hi Robert, all, I have an application that will load a model from file and attach a custom cull callback to the node. I recently discovered that my cull callback does not work properly if the root node of the model is a Geode. When encountering a Geode, the CullVisitor will handle the cull callbacks and then traverse the Geode. However, the drawables are processed after the traversal, regardless of the result of the cull callbacks. I typically use cull callbacks to either prevent traversal of a node under certain conditions, or to wrap some custom operation around the traversal of the sub-graph. Neither of these are currently possible with Geodes. I recall a discussion a few years ago about making Drawable objects another kind of Node. Is this still being considered? If this would cause too much compatibility issues, how about adding an additional NodeVisitor::apply(Drawable) method? This would just require implementing a Geode::traverse method and should not cause much compatibility issues. With some minor changes to the CullVisitor, this would allow cull callbacks to work properly with geodes. I also think this would simplify implementing custom node visitors that operate on drawable objects. Does this seem like a reasonable change? Thoughts/suggestions? Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Cull callbacks and Geodes
Hi Robert, On Wed, May 7, 2014 at 10:52 AM, Robert Osfield robert.osfi...@gmail.comwrote: Feel free to have bash implementing it, see what happens when you try to make the changes. Unfortunately I'm just too hazy on the whole issue to know of the potential issues that might need resolving off the top of my head. I made the proposed changes and everything seems to work properly after some initial tests. I still want to play around some more before submitting a patch though. Currently, I have the Geode::traverse method call NodeVisitor::apply(Drawable) directly, since there is no Drawable::accept(NodeVisitor) method. Would you prefer that Drawable::accept(NodeVisitor) be added so that it follows the visitor pattern? Drawables don't currently support node masks and can't be added to the NodePath, so the accept method would be directly calling NodeVisitor::apply() anyway. However, one benefit of this route would be the potential for supporting apply for other drawable types (ie. Geometry). Don't know if it's worth the extra overhead though. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Modify Alpha Test Value
Hi Steven, You can use the osg::AlphaFunc state attribute for changing the alpha test function and reference value. Just apply the attribute to the stateset of the subgraph you would like to modify. Cheers, Farshid On Thu, Feb 13, 2014 at 9:28 AM, Steven Powers stevenapow...@gmail.comwrote: Hi, How can I modify the alpha test value used in GL_ALPHA_TEST?? Thank you! Cheers, Steven -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58242#58242 ___ 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] [ANN] OSG Max Exporter 1.2.0 released
Hello OSGers, OSG Max Exporter 1.2.0 has just been released. You can download the installer or source code from the downloads page (http://goo.gl/Gzq1Hy). This is mainly a bug fix release. To see the full list of changes, visit http://goo.gl/1Sdw3 The documentation for the exporter is available at http://goo.gl/le7NC As always, if you experience any issues or need help, please post your questions to this mailing list. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Saving a Named Group in Optimize
Hi Karl, Setting the data variance of a node to DYNAMIC should prevent the optimizer from removing it: group-setDataVariance(osg::Object::DYNAMIC); Cheers, Farshid On Tue, Feb 4, 2014 at 1:49 PM, Cary, Karl A. karl.a.c...@leidos.comwrote: Is there a way to save a named group from being optimized away by setting either some type of option or flag before running the optimizer? I can always write a custom optimize visitor to handle it, but it just seemed like it might be a common case that is handled and I haven't known about. Thanks. Karl ___ 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] Retrobooster trailer
Congratulations Terry, that looks amazing! On Mon, Jan 27, 2014 at 11:58 AM, Terry Welsh mogu...@gmail.com wrote: If you want to see some artsy OSG work, I got my new trailer done last week. http://youtu.be/z9a2SYQtWcE Terry Welsh http://www.reallyslick.com ___ 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] Using the OSG Max Exporter Plugin - Biped Animation
Hi Dominik, The max exporter does not currently support character animations. It's been requested a few times though. My schedule is mostly free this week, so I will spend some time looking into it. I don't have much experience with the osgAnimation library though. I'm hoping there is a straightforward mapping from the 3ds Max character animation/skinning features to osgAnimation. Cheers, Farshid On Monday, December 16, 2013, shinyclaw wrote: Hi all, is there a possibility to export a character using biped animation? When I try to export animation in that way, only biped parts are animated, but not the character. Also, I think, that biped data should not be exported at all as a part of exported geometry... Regards, Dominik ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG logo, now in 3D!
I was surprised to find that there is no 3D version of the OpenSceneGraph logo, at least not in the osg-data repository. I think OSG has been around long enough to deserve a 3D logo, so I had one of our artists whip up something. Here are two versions of the logo as osgb files. One is normal and the other has a black outline around the geometry. Normal: http://goo.gl/XgpjUQ Outline: http://goo.gl/IM6RKB Feel free to use these models however you like or add it to the osg-data repo. The model was created with 3ds Max and exported using the osgmaxexp exporter. You can find the 3ds Max file in the examples/logo folder of the osgmaxexp project (http://sourceforge.net/projects/osgmaxexp/). Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Reusing depth buffer for render targets
Hi Bram, The water camera is not clearing the depth buffer, which means it will be performing depth tests against the depth values from the world camera. Try setting the clear mask for the water camera to the following: waterCamera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); Cheers, Farshid On Thu, Nov 14, 2013 at 2:09 PM, Bram Vaessen bram.vaes...@gmail.comwrote: Hi, I'm trying to reuse a depth buffer for rendering two different passes. The first one does terrain, the second one some water surface (to another output buffer, but that's not the issue here) Based on posts from the forum I though I had it figured out but it doesn't work well. Depending on how I move the camera in my application, it either looks like the depth buffer was not used at all (I see water everywhere), or it works as expected, or sometimes something in between, some parts seem to be non-rendered as they should but not everywhere. I wonder if I did anything wrong, here is the code I used, any comments would be useful, thanks! Code: //set up a depth buffer to be reused in two cameras osg::Texture2D* depthBuffer; depthBuffer = new osg::Texture2D; depthBuffer-setTextureSize(screenWidth, screenHeight); depthBuffer-setInternalFormat(GL_DEPTH_COMPONENT32); depthBuffer-setSourceFormat(GL_DEPTH_COMPONENT); depthBuffer-setSourceType(GL_FLOAT); //set up the world (scene) camera osg::ref_ptrosg::Camera worldCamera = new osg::Camera(); worldCamera-setViewport(new osg::Viewport(0,0,screenWidth,screenHeight)); worldCamera-setProjectionMatrixAsPerspective(30.0, 16.f/9.f, 0.5, 1); worldCamera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //camera-setClearColor(fog-getFogColor()); worldCamera-setClearColor(osg::Vec4(0,0,0,0)); worldCamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); worldCamera-setRenderOrder(osg::Camera::PRE_RENDER,0); worldCamera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); worldCamera-addChild(worldNode); //add the world to the world camera worldCamera-attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER0), colorsRect); worldCamera-attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER1), normalsRect); worldCamera-attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER2), positionsRect); worldCamera-attach(osg::Camera::DEPTH_BUFFER, depthBuffer); //set up the water surface camera osg::ref_ptrosg::Camera waterCamera = new osg::Camera(); waterCamera-setViewport(new osg::Viewport(0,0,screenWidth,screenHeight)); waterCamera-setProjectionMatrixAsPerspective(30.0, 16.f/9.f, 0.5, 1); waterCamera-setClearMask(GL_COLOR_BUFFER_BIT); waterCamera-setClearColor(osg::Vec4(0,0,0,0)); waterCamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); waterCamera-setRenderOrder(osg::Camera::PRE_RENDER,1); waterCamera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); waterCamera-addChild(waterNode); waterCamera-attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER0), waterRect); waterCamera-attach(osg::Camera::DEPTH_BUFFER, depthBuffer); ... rootNode-addChild(worldCamera); rootNode-addChild(waterCamera); Thank you! Cheers, Bram -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=57218#57218 ___ 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] Reusing depth buffer for render targets
Hi Bram, Sorry, I misunderstood your question. The values in the depth buffer are normalized based on the near/far clip planes. If you are automatically computing the near/far planes, then they can end up being different for each camera, which causes the depth test for the water scene to be computed incorrectly. Disabling computing of near/far and forcing the same clip plane values should ensure proper depth testing between the two cameras. Does that make sense? Cheers, Farshid On Thu, Nov 14, 2013 at 2:50 PM, Bram Vaessen bram.vaes...@gmail.comwrote: Farshid, I should have been more clear about it, but that was actually my intention. The terrain and water are in the same world so i wanted to use the depth information from the terrain render to draw only visible portions of the water to the other buffer. Sebastian, I always get this error: Warning: detected OpenGL error 'invalid framebuffer operation' at After Renderer::compile but I got this from the very beginning of when I started on the project, when I didn't have any framebuffers or anything else for that matter, it was just always there from the first time I used OSG. I tried looking it up but nobody on the forum could help me with it, and it doesn't seem to do any harm... for the buffers and resulations, let me just paste the code here, this is how I set them up: Code: //set up fragment color raster osg::TextureRectangle* colorsRect; colorsRect = new osg::TextureRectangle; colorsRect-setTextureSize(screenWidth, screenHeight); colorsRect-setInternalFormat(GL_RGBA32F_ARB); colorsRect-setSourceFormat(GL_RGBA); colorsRect-setSourceType(GL_FLOAT); colorsRect-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST); colorsRect-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST); //set up fragement normal raster osg::TextureRectangle* normalsRect; normalsRect = new osg::TextureRectangle; normalsRect-setTextureSize(screenWidth, screenHeight); normalsRect-setInternalFormat(GL_RGBA32F_ARB); normalsRect-setSourceFormat(GL_RGBA); normalsRect-setSourceType(GL_FLOAT); normalsRect-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST); normalsRect-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST); //set up fragment coordinate raster osg::TextureRectangle* positionsRect; positionsRect = new osg::TextureRectangle; positionsRect-setTextureSize(screenWidth, screenHeight); positionsRect-setInternalFormat(GL_RGBA32F_ARB); positionsRect-setSourceFormat(GL_RGBA); positionsRect-setSourceType(GL_FLOAT); positionsRect-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST); positionsRect-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST); //set up fragment color raster 2 for water osg::TextureRectangle* waterRect; waterRect = new osg::TextureRectangle; waterRect-setTextureSize(screenWidth, screenHeight); waterRect-setInternalFormat(GL_RGBA32F_ARB); waterRect-setSourceFormat(GL_RGBA); waterRect-setSourceType(GL_FLOAT); waterRect-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST); waterRect-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST); //set up a depth buffer to be reused in two cameras osg::Texture2D* depthBuffer; depthBuffer = new osg::Texture2D; depthBuffer-setTextureSize(screenWidth, screenHeight); depthBuffer-setInternalFormat(GL_DEPTH_COMPONENT32); depthBuffer-setSourceFormat(GL_DEPTH_COMPONENT); depthBuffer-setSourceType(GL_FLOAT); add the depth texture as input sampler to the consecutive passes if they use it for writing. do you mean as a texture? I tried waterCamera-getOrCreateStateSet()-setTextureAttributeAndModes(0, depthBuffer, osg::StateAttribute::ON); but that didn't help. I was looking at it again and it looked like it was clipping when I moved the camera around, so I tried this (also for the other camera): worldCamera-setComputeNearFarMode(osg::CullSettings::ComputeNearFarMode::DO_NOT_COMPUTE_NEAR_FAR); worldCamera-setProjectionMatrixAsPerspective(30.0, 16.f/9.f, 0.1, 10); that seems to solve it! I suppose the clipping was causing it, but not sure how exactly. Would be helpful if I understood what was happening exactly, any idea? Thanks :) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=57221#57221 ___ 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] Reusing depth buffer for render targets
Support for 32-bit depth buffers is driver dependent. I believe some will fallback on 24-bit if 32-bit is not supported. On Thu, Nov 14, 2013 at 3:49 PM, Bram Vaessen bram.vaes...@gmail.comwrote: Thanks, that makes perfect sense. I didn't know it was normalized, so I just have to make sure the camera's have the same clipping planes, didn't need to increase it to 10 (my scene is much smaller than that :) The depth buffer is based on 32 bits floats right (just for my information)? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=57223#57223 ___ 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] [3rdparty] OSG EXPORTER for 3DS MAX - Y-up
Hi Tim, That exporter should behave correctly, meaning it should export the model in OSGs Z-up coordinate system. Which version were you previously using that exported as Y-up? Cheers, Farshid On Mon, Oct 21, 2013 at 7:31 AM, Tim Larson tlar...@hunter.com wrote: We are using Version 1.1.0, installed from here: http://sourceforge.net/projects/osgmaxexp/files/OpenSceneGraph%20Max%20Exporter/1.1.0/ Tim -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56913#56913 ___ 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] [3rdparty] OSG EXPORTER for 3DS MAX - Y-up
Hi Tim, Which version of the exporter are you using? Did you use one of the pre-built installers, and if so where did you download the installer? Cheers, Farshid On Fri, Oct 18, 2013 at 9:51 AM, Tim Larson tlar...@hunter.com wrote: I know this is an old thread, but I would like to ask the original poster if he ever found a resolution to this issue. I have also found that after a recent update to osgexp my model's up orientation has changed. ... Thank you! Cheers, Tim -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56878#56878 ___ 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] Collada node name vs id
Hi all, I noticed that the Collada loader was modified a while back to assign the node name to the osg::Node, instead of the node ID. This seems like a good change overall, but we have existing customers/applications that depend on the previous use of the node ID. In order to support legacy code, I'm thinking of making one of the following changes to the Collada loader: 1) Add a loader option that will control whether the node id or name is assigned to the osg::Node (defaulting to name) 2) Assign the node ID as a named user data attribute of the osg::Node (ie. collada_node_id) I'm leaning towards option #2. I know this probably does not affect most users, but does anybody have any thoughts/suggestions on the matter? Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Model Load Crash
Hi John, Do you know what version of OSG the model was created with? I've noticed that older versions of OSG will crash when attempting to load osgb files created with newer versions. I haven't pinpointed exactly which version caused this issue, but it happened when I upgraded from 72 to 93. I noticed that you are using version 80, so this could explain the crashes you are experiencing. Cheers, Farshid On Mon, Aug 19, 2013 at 11:24 AM, John Farrier john.farr...@gmail.comwrote: Hi, I am attempting to load a 3D model (.osgb) in my application using Code: auto model = osgDB::readNodeFile(this-_modelFile); After that, I immediately want to get the bounding sphere size: Code: osg::BoundingSphere bs = model-getBound(); While this generally works fine, there are some models that this consistently crashes (it's not an exception) on. It seems to be calling discardAllDeletedDisplayLists just before the crash. Here's the stack trace: Code: osg80-osg.dll!osg::Drawable::Extensions::setupGLExtensions() + 2336 bytes osg80-osg.dll!osg::Drawable::discardAllDeletedDisplayLists() + bytes osg80-osg.dll!osg::Geometry::accept() + 543 bytes osg80-osg.dll!osg::Drawable::computeBound() + 123 bytes osg80-osg.dll!osg::Drawable::getBound() + 124 bytes osg80-osg.dll!osg::Geode::computeBound() + 120 bytes osg80-osg.dll!osg::Node::getBound() + 96 bytes osg80-osg.dll!osg::Group::computeBound() + 209 bytes osg80-osg.dll!osg::Node::getBound() + 96 bytes osg80-osg.dll!osg::Group::computeBound() + 209 bytes osg80-osg.dll!osg::Transform::computeBound() + 56 bytes osg80-osg.dll!osg::Node::getBound() + 96 bytes osg80-osg.dll!osg::Group::computeBound() + 209 bytes osg80-osg.dll!osg::Node::getBound() + 96 bytes osg80-osg.dll!osg::Switch::computeBound() + 382 bytes osg80-osg.dll!osg::Node::getBound() + 96 bytes osg80-osg.dll!osg::Group::computeBound() + 209 bytes osg80-osg.dll!osg::Transform::computeBound() + 56 bytes osg80-osg.dll!osg::Node::getBound() + 96 bytes osg80-osg.dll!osg::Group::computeBound() + 209 bytes osg80-osg.dll!osg::Transform::computeBound() + 56 bytes osg80-osg.dll!osg::Node::getBound() + 96 bytes osg80-osg.dll!osg::Group::computeBound() + 209 bytes osg80-osg.dll!osg::Transform::computeBound() + 56 bytes osg80-osg.dll!osg::Node::getBound() + 96 bytes osg80-osg.dll!osg::Group::computeBound() + 209 bytes osg80-osg.dll!osg::Transform::computeBound() + 56 bytes osg80-osg.dll!osg::Node::getBound() + 96 bytes osg80-osg.dll!osg::Switch::computeBound() + 382 bytes osg80-osg.dll!osg::Node::getBound() + 96 bytes osg80-osg.dll!osg::Group::computeBound() + 209 bytes osg80-osg.dll!osg::Node::getBound() + 96 bytes osg80-osg.dll!osg::Group::computeBound() + 209 bytes osg80-osg.dll!osg::Node::getBound() + 96 bytes osg80-osg.dll!osg::Group::computeBound() + 209 bytes osg80-osg.dll!osg::Node::getBound() + 96 bytes The really odd thing here is that the model loads just fine with osgViewer. Is there something I could be doing to the state of OSG that would cause it to fail in my own application? (The application isn't trivial, or I would post more code.) Thank you! Cheers, John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=55871#55871 ___ 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] Cannot resize when rendering to FBO
Hi Terry, I use osg::Camera objects to render FBOs that are the same size as the window. When the window is resized, I clear the rendering cache of the camera and reset the texture size: texture-setTextureSize(w,h); texture-dirtyTextureObject(); camera-setRenderingCache(0); This has worked fine for me for a while now. What version of OSG are you using? Cheers, Farshid On Fri, Aug 2, 2013 at 3:51 PM, Terry Welsh mogu...@gmail.com wrote: I render to an FBO texture attachment the same size as my window. But when I expand the window and try to resize the texture to match it, I end up rendering to a rectangle the size of my original window in the lower left corner of the now-larger texture. It seems like a lot of people would have tried this by now. Any advice from someone who is doing it successfully? I have tried this code that has been recommended in a few emails, but no luck. mColorTex-setTextureSize(w, h); mColorTex-dirtyTextureObject(); mColorTex-dirtyTextureParameters(); mCamera-setViewport(x, y, w, h); mCompositeCamera-setViewport(x, y, w, h); mMainSceneView-getRenderStage()-setFrameBufferObject(NULL); mMainSceneView-getRenderStage()-setCameraRequiresSetUp(true); This seems to be the exact same problem as this unanswered email from last year. There have been similar threads from time to time as well. http://lists.openscenegraph.org/htdig.cgi/osg-users-openscenegraph.org/2012-March/057126.html -- Terry Welsh www.reallyslick.com ___ 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] Deprecating vertex indices in osg::Geometry
Hi Robert, These changes sound good. I'm all for cleaning up the Geometry class. You mentioned implementing some sort of backwards compatibility for the serialization plugins. Does that mean existing osg files (osg, ive, osgb, etc...) that use indices will automatically fall back to the GeometryDeprecated class? I know the 3ds max exporter plugin generates vertex indices in some cases. Just curious how those existing files will be handled now. Cheers, Farshid On Tue, Jun 4, 2013 at 12:14 AM, Robert Osfield robert.osfi...@gmail.comwrote: Hi All, One of the changes I've discussed before, but as yet no made, is to simplify osg::Geometry so that it drops the index arrays that you can currently associated for vertex, normal, colour, texcoord arrays. These index arrays aren't supported by OpenGL, instead have to be emulated by breaking the primitive data up into small chunks and sending the vertex data and primitive data in small batches. This is very inefficient, so what having separate vertex indicies might seem like a good way of reducing vertex data overhead by sharing more it causes a big CPU overhead and results in lower performance. While there are clear warnings in the osg::Geometry header that this feature is deprecated and forces and OpenGL slow path I know it still gets used on occasion - against best practice advice. What I'd like now to do is drop the index arrays from osg::Geometry, and provide a GeometryDeprecated class for the those who need backwards compatibility. Potentially this GeometryDeprecated class could go in the core osg library, but I'm tempted to move it out into one of the optional NodeKits to reduce the size of the core osg library. To be clear OpenGL indexed primitives will still be fully support by osg::Geometry - DrawElement* has always been available and will remain, it's the long been the preferred way to pass your primitive data to OpenGL. Another step in making these changes that I'm considering is moving the normalize parameter from Geometry::ArrayData into osg::Array, with this change ArrayData ceases to have a role and can be removed further simplifying osg::Geometry. Thoughts? Robert. ___ 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] Incorrect zfar/znear when scene rendered under a PRE_RENDER camera
Hi Fred, OSG does compute the correct near/far values for pre-render cameras, assuming it is enabled for it. As you can tell, the main problem is getting access to the computed projection matrix. What I have done to get the computed near/far values from camera nodes is to attach a cull callback to the camera that retrieves the computed projection matrix from the cull visitor after the camera has been traversed. The cull callback function looks something like this: void MyCullCallback::operator()(osg::Node* node, osg::NodeVisitor* nv) { if (nv-getVisitorType() == osg::NodeVisitor::CULL_VISITOR) { osgUtil::CullVisitor* cv = dynamic_castosgUtil::CullVisitor*(nv); if(cv) { traverse(node,nv); cv-computeNearPlane(); if (cv-getComputeNearFarMode() cv-getCalculatedFarPlane() = cv-getCalculatedNearPlane()) { osgUtil::CullVisitor::value_type znear = cv-getCalculatedNearPlane(); osgUtil::CullVisitor::value_type zfar = cv-getCalculatedFarPlane(); //Do something with znear/zfar values } return; } } traverse(node,nv); } This works really well for my application. I think every time I've encountered some tricky problem like this, cull callbacks were the solution. I don't know what I would do without them :) Cheers, Farshid On Mon, Jun 3, 2013 at 9:00 AM, Fred Smith osgfo...@tevs.eu wrote: Robert, Sorry to further fill in this thread with a question - but couldn't it be that the OSG indeed correctly calculates the near/far values for my pre_render camera, and that I simply just do not know (yet) a proper way to correctly retrieve the projection matrix? I see the CullVisitor calculates the near/far values, maybe I should hook into this and grab the values from there? Any hint is appreciated really, and again sorry for the verbose thread. Cheers, Fred -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=54407#54407 ___ 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] Saving a screenshot as a scaled up image
Hi Jonathan, You can get the context ID from the global osg::State object. You can also use the osg::State object to bind the texture as well. So to read the image for a texture, you could do the following: osg::State *state; // TODO: Get access to state object texture-apply(*state) osg::ref_ptrosg::Image img = new osg::Image; img-readImageFromCurrentTexture(state-getContextID(), false); This code will need to be executed within the OpenGL context associated with the state object. Cheers, Farshid On Mon, Jun 3, 2013 at 8:51 AM, Jonathan Mclaughlin jonat...@mve.comwrote: Hi, ** ** I am looking for a bit of help with a problem I’ve been having. I’m trying to take a screenshot of an osg scene, scale it up while maintaining resolution, and save the result out to an image file. ** ** At the moment, I have looked at the osgdistortion example and have managed to create a texture and display it on a textured quad. However, when I attempt to read the pixels out to an image, whether from the camera or the texture, nothing is produced. I am unsure as to the best way to go about this as it seems it should be simple to read the pixels from the frame buffer object or the texture but I have had no joy as yet. It seems like perhaps using osg::Image:: *readImageFromCurrentTexture*http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00305.html#e7e7a51a074aa4b4e0931b7fd7a98af9() would be the best way to do this but I was having problems getting the context ID. I could possibly get this within a camera call back?... I notice also within the documentation this methods description says “Read the contents of the current bound texture” – Is there something more I have to do to make the texture “bound”? ** ** Thanks for any info, ** ** ** ** Jonathan McLaughlin Software Engineer Midland Valley will next be presenting at Hedberg Research Conference, 23rd – 27th June 2013 Midland Valley Exploration Ltd. 144 West George Street Glasgow G2 2HG United Kingdom Tel: +44 (0) 141 332 2681 Fax:+44 (0) 141 332 6792 The structural geology experts ** ** ___ 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] Culling w/ RTT
Hi Jeremy, This sound very similar to an issue I've encountered before. Does your RTT Camera object use a RELATIVE or ABSOLUTE reference frame? Also, are you applying any ComputeBoundingSphereCallbacks to you scene or override the computeBound method of any nodes? Cheers, Farshid On Mon, May 27, 2013 at 11:07 AM, Jeremy Moles cubic...@gmail.com wrote: Hello everyone! I'm running into a problem in my application where I'm trying to switch between two different subgraphs as the result of some event (key press or similar). The first of these two objects is a standard subgraph with nothing too sophisticated going on. The second of these is a RTT stack of Camera objects. The problem manifests in that if I switch FROM the standard graph (just a random grouping of models) to the RTT Camera stack, the bounds of the previous node are used for the RTT Camera. This means that while the same scene rendered within my RTT stack is fine as long as you don't adjust the view matrix, as soon as you move the scene around it begins to get culled. I can remedy this problem by disabling culling on the main viewer camera when my RTT stack is in effect, but I feel like I'm doing something wrong... the reason I think this is because I can add the RTT stack to my scene as the FIRST scene (and never toggle it to anything else) and the culling occurs correctly. The problem only manifests when I switch from the RTT stack to a standard node AND THE BACK to the RTT scene. Has anyone tried anything like this in the past? Does anyone have any hints? :) __**_ osg-users mailing list osg-users@lists.**openscenegraph.org osg-users@lists.openscenegraph.org http://lists.openscenegraph.**org/listinfo.cgi/osg-users-** openscenegraph.orghttp://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] Culling w/ RTT
Hi Jeremy, One more question, how are you switching between scene graphs ( switch node, node masks, add/remove child)? If your Camera nodes are using ABSOLUTE reference frame, then I believe disabling culling on its parent nodes is the best solution. If you look at the Group::computeBound method, you will notice it ignores child transforms with ABSOLUTE reference frame when computing the bounding sphere. What might be happening is that when you switch to the Camera scene, the group node containing the camera is culling based off a non-representative bounding sphere. Also, if you happen to be using node masks to turn scene graphs on/off, then you might need to manually call dirtyBound() on the nodes. The Node::setNodeMask method does not automatically call dirtyBound(), and this has caused culling issues for me before. Cheers, Farshid On Tue, May 28, 2013 at 11:29 AM, Jeremy Moles cubic...@gmail.com wrote: On 05/28/2013 01:20 PM, Farshid Lashkari wrote: Hi Jeremy, This sound very similar to an issue I've encountered before. Does your RTT Camera object use a RELATIVE or ABSOLUTE reference frame? Also, are you applying any ComputeBoundingSphereCallbacks to you scene or override the computeBound method of any nodes? ABSOLUTE. And no, I'm not applying any BoundingSphere callbacks... Cheers, Farshid On Mon, May 27, 2013 at 11:07 AM, Jeremy Moles cubic...@gmail.commailto: cubic...@gmail.com wrote: Hello everyone! I'm running into a problem in my application where I'm trying to switch between two different subgraphs as the result of some event (key press or similar). The first of these two objects is a standard subgraph with nothing too sophisticated going on. The second of these is a RTT stack of Camera objects. The problem manifests in that if I switch FROM the standard graph (just a random grouping of models) to the RTT Camera stack, the bounds of the previous node are used for the RTT Camera. This means that while the same scene rendered within my RTT stack is fine as long as you don't adjust the view matrix, as soon as you move the scene around it begins to get culled. I can remedy this problem by disabling culling on the main viewer camera when my RTT stack is in effect, but I feel like I'm doing something wrong... the reason I think this is because I can add the RTT stack to my scene as the FIRST scene (and never toggle it to anything else) and the culling occurs correctly. The problem only manifests when I switch from the RTT stack to a standard node AND THE BACK to the RTT scene. Has anyone tried anything like this in the past? Does anyone have any hints? :) __**_ osg-users mailing list osg-users@lists.**openscenegraph.orgosg-users@lists.openscenegraph.org mailto:osg-users@lists.**openscenegraph.orgosg-users@lists.openscenegraph.org http://lists.openscenegraph.**org/listinfo.cgi/osg-users-** openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org __**_ osg-users mailing list osg-users@lists.**openscenegraph.org osg-users@lists.openscenegraph.org http://lists.openscenegraph.**org/listinfo.cgi/osg-users-** openscenegraph.orghttp://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] DatabasePager setTargetMaximumNumberOfPageLOD behavior
Thanks Robert. I'll just submit my patch and get feedback from there. Cheers, Farshid On Mon, May 20, 2013 at 11:59 PM, Robert Osfield robert.osfi...@gmail.comwrote: HI Farshid, The TargetMaximumNumberOfPageLOD is a hint to the pager to try and expire inactive PageLOD so that the total number stays at or below the specified number. It only expires inactive PagedLOD though, so it's a target not a hard fast measure, if the current view requires more than the target then PagedLOD are active and can't be discarded. If you've found an error in the maths or a better scheme for working out which to expire then send it along to osg-submissions. The scheme has to be efficient as not to bog down the pager or update threads. Robert. On 21 May 2013 04:41, Farshid Lashkari fla...@gmail.com wrote: Hi, I'm hoping to get some clarification on how the DatabasePager::setTargetMaximumNumberOfPageLOD is supposed to work. I am setting this value to 3 in my application. I then use the following function to create and add PagedLODs the the scene: void AddPagedLOD() { osg::ref_ptrosg::PagedLOD lod = new osg::PagedLOD; lod-addChild( new osg::Group, 10.0f, FLT_MAX ); lod-setFileName(1,large.osgb); lod-setRange(1,0.0f,10.0f); root-addChild(lod); } When I add 3 PagedLODs to my scene and have them load the file, they are never released from memory once I leave the active range. This makes sense since the number PagedLODs is not above the target. However, when I add 4 PagedLODs then leave the active range, all 4 files are released from memory. I was expecting only 1 of the files to be released. Am I misunderstanding the behavior of this setting or should only 1 file be released in this case? I had a quick glance at the DatabasePager source and was able to make two small changes to get the behavior I was expecting. However, I don't have much experience dealing with PagedLODs and wanted to verify that this should be the correct behavior before submitting a patch. Cheers, Farshid ___ 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] DatabasePager setTargetMaximumNumberOfPageLOD behavior
Hi, I'm hoping to get some clarification on how the DatabasePager::setTargetMaximumNumberOfPageLOD is supposed to work. I am setting this value to 3 in my application. I then use the following function to create and add PagedLODs the the scene: void AddPagedLOD() { osg::ref_ptrosg::PagedLOD lod = new osg::PagedLOD; lod-addChild( new osg::Group, 10.0f, FLT_MAX ); lod-setFileName(1,large.osgb); lod-setRange(1,0.0f,10.0f); root-addChild(lod); } When I add 3 PagedLODs to my scene and have them load the file, they are never released from memory once I leave the active range. This makes sense since the number PagedLODs is not above the target. However, when I add 4 PagedLODs then leave the active range, all 4 files are released from memory. I was expecting only 1 of the files to be released. Am I misunderstanding the behavior of this setting or should only 1 file be released in this case? I had a quick glance at the DatabasePager source and was able to make two small changes to get the behavior I was expecting. However, I don't have much experience dealing with PagedLODs and wanted to verify that this should be the correct behavior before submitting a patch. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [ANN] OSGExp 1.1.0 released
Hello fellow 3ds Max users, OSGExp 1.1.0 has just been released. You can download the installer or source code from the downloads page (http://goo.gl/Q7KKD). This version supports the latest 3ds Max 2014 release. Please note, Autodesk has discontinued 3ds Max for 32-bit platforms starting with 2014. This means the 32-bit installer will only work with 3ds Max 2013 and below. To see the full list of changes, visit http://goo.gl/1Sdw3 The documentation for the exporter is available at http://goo.gl/le7NC As always, if you experience any issues or need help, please post your questions to this mailing list. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] Bump map with 3DS Max
Hi Maia, That option simply controls whether the texture map is exported or not. The exporter does not generate any shaders to perform the normal mapping. It is left up to the user to apply a shader that properly renders the material within their environment. Cheers, Farshid On Mon, Apr 1, 2013 at 12:40 PM, Maia Randria veneree.randrianari...@crulrg.ulaval.ca wrote: Hi, I applied a bump map on a model in 3DS Max. In the Max Exporter, there is a Bump map option to be checked or not. Is this working (after reading some old posts, some people said that it is not working) ? I tried to check it with a modeled object in 3DS Max with a bump, but I got nothing, though the bump is there while rendering in 3DS Max. Is it obsolete ? Is it better to program a shader (I found tutorial/examples explaining that, e.g osgFX) ? Thank you! Cheers, Maia -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53405#53405 ___ 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] [osgPPU] osgPPU and wireframe
Hi Daniel, You will need to apply an osg::PolygonMode attribute to the screenquad stateset with the mode set to osg::PolygonMode::FILL. I haven't used osgPPU, but I've used this when displaying fullscreen quads with rendered textures and it worked fine. Cheers, Farshid On Fri, Mar 22, 2013 at 7:51 AM, Daniel Schmid daniel.sch...@swiss-simtec.ch wrote: Hi all Maybe you noticed that when using osgPPU and pressing 'w' to change the polygon mode to wireframe, the screen goes black, because only the screenquad is rendered in wireframe, but the actual scene is not rendered anymore. Does anybody know how to change this? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53207#53207 ___ 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] Quad buffered on Windows?
Hi Chris, In the Manage 3D settings section of the nVidia control panel, there should be an option labeled Stereo - Enable. It defaults to OFF. Have the customer make sure that setting is set to ON. Cheers, Farshid On Fri, Mar 1, 2013 at 9:44 AM, Chris Hanson xe...@alphapixel.com wrote: I've been working with a client that wants to show off some spiffy OSG stuff on a real 3D display at a convention. Not owning a real 3D display, I've tested with a pair of red/blue glasses and the environment vars to enable ANAGLYPHIC mode and it works great. So far, they have been unable to get into 3D mode using the OSG_STEREO=ON OSG_STEREO_MODE=QUAD_BUFFER environment variable. System specs are: Windows 7 64-bit, Intel Xeon CPU 2.00GHz 2 processors, 12 GB of RAM) Quadro FX 3700 total memory 4095, driver version 310.90 3D Stereo Enabled: On-board DIN connector Dell Alienware2310 Monitor, 120 Hz Anyone have any tricks for making this work? Doesn't seem like it should be too hard. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android @alphapixel https://twitter.com/alphapixel facebook.com/alphapixel (775) 623-PIXL [7495] ___ 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] [osgPlugins] 3DS max to osg problem
Hi Maia, Are you using the latest version of the max exporter plugin? This sounds similar to an issue where texture colors would export incorrectly when gamma correction was enabled in max. The latest version of the exporter should have resolved this, but maybe it's not fully resolved. Can you try disabling gamma correction (Rendering - Gamma/LUT Setup), then exporting again? Cheers, Farshid On Fri, Dec 7, 2012 at 9:09 AM, Maia Randria veneree.randrianari...@crulrg.ulaval.ca wrote: Hi, I have a strange color change when exporting an object from 3DS Max 2013 to OSG. Could someone have idea on why I obtained that (this is the first time I see that, no problem until now with the plug-in). Thank you! Cheers, Maia -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51467#51467 ___ 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] [osgPlugins] 3DS max to osg problem
Hi Maia, Are you using 3ds Max Design? There was a fix to the install script since the last release that allowed detection for certain 3ds Max Design installations. The installer on the sourceforge page has not been rebuilt since then. I will try to make a new release soon though. Cheers, Farshid On Fri, Dec 7, 2012 at 11:58 AM, Maia Randria veneree.randrianari...@crulrg.ulaval.ca wrote: Hi Farshid, May I ask you to check if the two versions on sourceforge and on worrdviz website are the same ? When I launch the one from Worldviz website, everything is correct (I can install), but I have that message error No 3ds max installed with the one from sourceforge. Many thanks, -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51473#51473 ___ 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] [osgPlugins] 3DS max to osg problem
Do you have the 32 or 64-bit version of max installed? Are you downloading the matching installer? The one on the homepage is for 32-bit. If you are using 64-bit, then you'll need to download the 64-bit installer from the files page. On Fri, Dec 7, 2012 at 12:54 PM, Maia Randria veneree.randrianari...@crulrg.ulaval.ca wrote: No, I don't. I just have 3DS max. Farshid Lashkari wrote: Hi Maia, Are you using 3ds Max Design? There was a fix to the install script since the last release that allowed detection for certain 3ds Max Design installations. The installer on the sourceforge page has not been rebuilt since then. I will try to make a new release soon though. Cheers, Farshid On Fri, Dec 7, 2012 at 11:58 AM, Maia Randria () wrote: Hi Farshid, May I ask you to check if the two versions on sourceforge and on worrdviz website are the same ? When I launch the one from Worldviz website, everything is correct (I can install), but I have that message error No 3ds max installed with the one from sourceforge. Many thanks, -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51473#51473 ( http://forum.openscenegraph.org/viewtopic.php?p=51473#51473) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org( http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51475#51475 ___ 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] lighting not consistent across images in osgprerendercubemap
Hi Andrew, Try applying an osg::LightModel state attribute to your scene graph with setLocalViewer set to true. I use this to get consistent specular highlights across walls in our CAVE setups. Hope this helps. Cheers, Farshid On Wed, Nov 7, 2012 at 5:22 AM, Andrew Straw straw...@astraw.com wrote: Dear Robert, Thanks for your suggestion, but that does not fix the issue. (Diff to osgprerendercubemap.cpp attached.) Any other ideas? -Andrew On 11/05/2012 10:37 AM, Robert Osfield wrote: HI Andrew, Try putting an osg::LightSource with a positional light into the scene. Robert. On 3 November 2012 13:01, Andrew Straw straw...@astraw.com wrote: Hi, (I have a vague memory of this question being asked years ago but I cannot find the discussion.) In the example program osgprerendercubemap, if you study the reflections you can see, at the borders between the faces of the cubemap used to render the reflects, inconsistencies in the specular highlights. Upon further inspection in my own code (just rendering the cubemap itself), it appears that the lighting, and hence the specular reflections, are calculated for a light that is fixed relative to the per-cubemap-face camera rather than fixed in world coordinates. Consequently, when an object shifts from the right edge of one camera to the left edge of the next camera, the reflection is rendered from a totally different relative light position. The visual seams are quite obvious when you know what to look for, and even more so in my program based off this one. Any advice on how to eliminate this effect would be greatly appreciated. Thanks in advance, Andrew ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://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 Files Textures
Hi Randall, On Fri, Oct 12, 2012 at 10:18 AM, Randall Hand randall.h...@gmail.comwrote: I wanted to ask here, is this a known issue when exporting from Maya? Before I tell him what's wrong, I wanted to know if there's something simple I could try or ask him to do that might resolve it. (eg: check a box in the export for Making OpenScenegraph compliant Textures :) ). I'm not sure if this is related to your problem, but certain Autodesk products embed a proprietary material format that is not even supported by their own FBX SDK. This prevents 3rd party applications from reading in the material color/texture information. We've run into the same issue before and couldn't find a suitable workaround. There is a post on the Autodesk forum regarding this issue: http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/cannot-get-materials-from-fbx-files-exported-from-revit/ Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Backward compatibility with custom serializers
Hi Wang, On Fri, Oct 5, 2012 at 10:19 AM, Wang Rui wangra...@gmail.com wrote: Oh, this seems to be already discussed in another thread. I was thinking of implementing a user version macro at that time but then I was a little too busy to worked on it. I will consider adding a new UPDATE_TO_USER_VERSION macro to allow version control of custom serializers as soon as possible, maybe tomorrow. :-) Sorry, I missed that thread. That sounds excellent! Yes, this is a bug just found in osgWrappers/serializers/osg/Node.cpp, which uses UPDATE_TO_VERSION incorrectly so it also affects the following StateSet serializer. I think the brackets after the macro really confuses us and will do something soon to make it more readable. Great news, I was worried there for a second :) Cheers, Farshid Thanks, Wang Rui ___ 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] Backward compatibility with custom serializers
Hi, I recently added serialization support for a custom osg::Object derived class in my application. I saved the object to a osgt and osgb file and attempted to load it into an older version of my application, which didn't have serialization support for my custom object yet. Loading the osgt file gives me the following warning message: InputStream::readObject(): Unsupported wrapper class MyLibrary::MyObject This is expected. However, when I attempt to load the osgb file I get the following output then my application crashes: InputStream::readObject(): Unsupported wrapper class MyLibrary::MyObject InputStream::readObject(): Unsupported wrapper class Before I spend time looking into this, I was wondering if it is expected for the binary loader to crash on unsupported objects? I'm working with osg 2.9.12, if that makes a difference. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LineSegmentIntersector question...
Hi Shayne, On Thu, Sep 13, 2012 at 10:32 AM, Shayne Tueller shayne.tuel...@hill.af.mil wrote: I first tried LIMIT_ONE. Performance did improve over the NO_LIMIT case but I noticed that the number of intersections calculated were as high as 6 for some of the line segments. I would have expected just one intersection calculated. Why is more than one intersection being done in this case? LIMIT_ONE should only report one intersection. Are you intersecting with multiple line segments? Can you post the code you are using to setup the intersector? Next I tried LIMIT_NEAREST. This resulted in many more intersections calculated. Some segments got as high as 27 intersections. That would suggest that this option is calculating intersections and then sorting through to determine which one is closest to the line segment starting point? LIMIT_NEAREST can report many intersections. As I mentioned earlier, it is more of a hint that you are only interested in the nearest hit. This allows it to reject subgraphs early on before performing any intersections with the actual mesh. However, in the worst case scenario where the scene is traversed in farthest to closest order, then there will be no difference in the number of hits between LIMIT_NEAREST and NO_LIMIT. Cheers, Farshid I should point out that I'm intersecting my line segments with a terrain database... -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50026#50026 ___ 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] LineSegmentIntersector question...
Hi Shayne, Is each LineSegmentIntersector instance getting more than one intersection result? Or is the total number of results among all intersectors more than 1? The limit is applied to each intersector instance, so the total number of results should max out at the number of intersectors being used. You can try applying the limit to the IntersectorGroup object as well, but you might still get more than 1 result. However, I think the IntersectorGroup::intersect method can be modified to break out of the intersector iteration if the limit has been reached. Cheers, Farshid On Thu, Sep 13, 2012 at 11:33 AM, Shayne Tueller shayne.tuel...@hill.af.mil wrote: Farshid, I'm actually modifying the osgSim::LineOfSight class for my tests. I went into LineOfSight.cpp and modified the computeIntersections() method to support setIntersectionLimit() since there's currently no way to control this for the Line of Sight stuff in OSG. I added the call setIntersectionLimit() for each LineSegmentIntersector instanced in the computeIntersections() method. This was done at the top of the method where the iterator loop is for each entry of _LOSlist. I believe this is the correct way to do it... I then called LineOfSight::computeIntersections() in my app to test it out against my terrain database. I would include the actual code snippet but my email machine doesn't have the code on it so I hope that the above description of what I did makes sense... It does make sense on how the LIMIT_NEAREST option works. Thanks for that explanation. -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50029#50029 ___ 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] LineSegmentIntersector question...
Hi Shayne, The base osgUtil::Intersector class supports setting the limits on intersection results, using the setIntersectionLimit() method. The current options are NO_LIMIT, LIMIT_ONE_PER_DRAWABLE, LIMIT_ONE, LIMIT_NEAREST. On Tue, Sep 11, 2012 at 9:47 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC shayne.tuel...@hill.af.mil wrote: **1) **Does it support a feature of detecting a “hit” and then returning without the need to compute all the intersections? This would be sort of like a visibility test. Set the intersection limit to LIMIT_ONE **2) **Does it have the ability to find the closest intersection without the need to compute all the intersections? In other words, does it step along from the starting point of the line segment until an intersection is found and then bail out? Set the intersection limit to LIMIT_NEAREST. This mode could be optimized more, but it will currently reject a subgraph if the nearest point of the bounding sphere is further than the nearest hit. So it can still provide significant savings in computation time. Cheers, Farshid **3) **If it doesn’t support these features, is it possible to modify the LineSegmentIntersector to support these? ** ** I would think that having this capability would improve performance where applicable. ** ** Thanks for any input in advance… ** ** -Shayne ** ** ** ** ___ 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] LineSegmentIntersector question...
Hi Shayne, Yes, the default is NO_LIMIT. I'm using it in version 2.9.12, but I think I might have backported it from a newer version. Sounds like you'll need to do an upgrade to get this feature. Cheers, Farshid On Tue, Sep 11, 2012 at 10:25 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC shayne.tuel...@hill.af.mil wrote: Just a follow on question to my previous email... Is this functionality of setting limits on intersection results only found in later versions of OSG? I'm currently using OSG 2.9.11 and I can't find any support for this. I guess this would explain why I asked the questions in the first place. If true, I need to upgrade to a later version like 3.0.1... -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Tueller,Shayne R Civ USAF AFMC 519 SMXS/MXDEC Sent: Tuesday, September 11, 2012 11:13 AM To: OpenSceneGraph Users Subject: Re: [osg-users] LineSegmentIntersector question... Farshid, Thanks much for the input and addressing my questions. That is good news that the support is there. I'm assuming the default is NO_LIMIT. Is this true? Thanks, -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Farshid Lashkari Sent: Tuesday, September 11, 2012 11:08 AM To: OpenSceneGraph Users Subject: Re: [osg-users] LineSegmentIntersector question... Hi Shayne, The base osgUtil::Intersector class supports setting the limits on intersection results, using the setIntersectionLimit() method. The current options are NO_LIMIT, LIMIT_ONE_PER_DRAWABLE, LIMIT_ONE, LIMIT_NEAREST. On Tue, Sep 11, 2012 at 9:47 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC shayne.tuel...@hill.af.mil wrote: 1) Does it support a feature of detecting a hit and then returning without the need to compute all the intersections? This would be sort of like a visibility test. Set the intersection limit to LIMIT_ONE 2) Does it have the ability to find the closest intersection without the need to compute all the intersections? In other words, does it step along from the starting point of the line segment until an intersection is found and then bail out? Set the intersection limit to LIMIT_NEAREST. This mode could be optimized more, but it will currently reject a subgraph if the nearest point of the bounding sphere is further than the nearest hit. So it can still provide significant savings in computation time. Cheers, Farshid 3) If it doesn't support these features, is it possible to modify the LineSegmentIntersector to support these? I would think that having this capability would improve performance where applicable. Thanks for any input in advance... -Shayne ___ 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.or g ___ 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] Check if a Drawable was culled or not
Hi Janna, From my understanding there is no built-in and simple way of accomplishing this, but it is possible. I have a similar feature working in my application that does the following: - I attach a custom cull callback to the drawable I am interested in. This cull callback simply records the frame number from the cull visitor. - I then attach another cull callback to the RTT camera node. This cull callback compares the current frame number to the last recorded frame number in the drawable cull callback. If the frame numbers don't match, then the drawable has been culled and the cull callback will disable the RTT node. - An important note about this technique is that it depends on the traversal order of the drawable and RTT node. For this to work, the RTT node must be traversed AFTER the drawable node. So make sure the drawable appears before the RTT node in the scene graph. Hope this is helpful. Cheers, Farshid On Tue, Sep 11, 2012 at 11:36 AM, Janna Terde brja...@gmail.com wrote: Hi Jeremy, I can cull the RTT camera using its cull mask or node mask however I need to know when should I do it. I would like to cull the camera when the node representing the mirror (Geode) is culled so when it is outside of the viewing frustum. This is what I am trying to do, I've tried to use CullVisitor and isCulled function and also tried to construct the Polytope from main camera but still did not get the correct behavior. :( So I am wondering if there is something I don't know since it seems to be very common thing to do and should be simple to do. Cheers, Janna -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49946#49946 ___ 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] Retrobooster - OSG-based game
Hi Terry, Wow, that is awesome! I really like the particle effects and lighting. Did you use osgParticle for that? Cheers, Farshid On Wed, Mar 21, 2012 at 10:50 AM, Terry Welsh mogu...@gmail.com wrote: At the risk of sounding like a shameless self-promoter, here's level playthrough video from a hobby project I've been working on. I'd be grateful to hear any critiques or ideas anyone has. Plus, I thought people might get a kick out of seeing a pretty involved OSG project in development. http://www.youtube.com/watch?v=VkVbq4jIr2k -- Terry Welsh mogumbo 'at' gmail.com www.reallyslick.com ___ 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] osgDB::Options osgviewer
Hi Paul, Have you tried the following: osgDB::Registry::instance()-setOptions(options); This should set the global default options. Cheers, Farshid On Fri, Mar 16, 2012 at 11:41 AM, Paul Leopard paul.leop...@gmail.comwrote: Is there any way to set the options for plugins (osgDB::Options) when using osgviewer? Thanks, Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46363#46363 ___ 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] GL_STENCIL_TEST in draw implementation callback
Hi Doug, How exactly is this library drawing the video? Is it feeding the video data into a texture, and applying that texture onto a simple quad? If so, it seems like the best approach would be to use the osg::TexMat class to transform the texture coordinates of the quad to simulate a zooming in effect. Either way, it's difficult to say what is going wrong without knowing more about how this library works. Cheers, Farshid On Thu, Mar 15, 2012 at 1:01 PM, Doug Domke doug.do...@boeing.com wrote: Hi, We have an OSG-based application that uses a 3rd party library to draw video. We want my application to perform a digital zoom on this video. Given the API to this library, we wrote an OSG node with a draw callback that calculates the viewport for the video to draw in, and lets the library do its magic. My theory for the digital zoom feature is to give the library a larger viewport (it always draws the same scene into the viewport) and cull/clip/stencil the result. My current attempt is in using a glStencil in the draw callback as follows: Code: glEnable(GL_STENCIL_TEST); glClear(GL_STENCIL_BUFFER_BIT); glStencilFunc(GL_ALWAYS, 1, 1); glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); glBegin(GL_QUADS); glVertex2d(left, bottom); glVertex2d(left, top); glVertex2d(right, top); glVertex2d(right, bottom); glEnd(); glStencilFunc(GL_EQUAL, 1, 1); draw video glDisable(GL_STENCIL_TEST); Unfortunately, the video ends up disappearing entirely. If I remove the Code: glEnable(GL_STENCIL_TEST); line, the video draws in the larger viewport and overlaps areas that it shouldn't. Can anyone identify a flaw in my code? Is there another approach that may be better? Thank you! -Doug[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46318#46318 ___ 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] osgmaxexp problems
Hi Seppo, On Tue, Jan 24, 2012 at 12:37 AM, Seppo se...@kuutio.net wrote: I have compiled osgmaxexp svn rev 236 without problems, but when using that I get this error when running 3DS max 2012 (32bit version): DLL (OSGEXP.dle) failed to initialize. Error code 998 - Invalid access to memory location. Are you getting this error when 3ds max starts up or when you try to export? Cheers, Farshid ** ** ** ** ___ 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] Color in ShapeDrawable
Hi Jason, On Fri, Dec 2, 2011 at 11:30 AM, Jason Daly jd...@ist.ucf.edu wrote: I don't understand what you mean here. If you disable lighting, material colors are irrelevant. The ShapeDrawable's colors are the ONLY way to set the color. That's actually not the case with OSG. If you look at the source for osg::Material, you will notice it calls glColor with one of the material colors (depending on the color mode). This means you can use osg::Material to control the color of geometry even when lighting is disabled. If ShapeDrawable did not call glColor, it would be possible to use osg::Material to control the color with lighting disabled. At the very least, I think there should be an option to have ShapeDrawable inherit the color. I don't see anything wrong with having such an option and I'm sure Robert would accept a patch for it. Cheers, Farshid I'm not sure what's inconsistent about it. It behaves like any other OpenGL geometry. As Filip indicated, the color only applies if lighting is disabled. When you disable lighting, no lighting calculations are done, and material colors become irrelevant, just as they do with any OpenGL rendering when lighting is disabled. Only the geometry color is used. If you want an unlit red cube, this is how you'd do it. When lighting is enabled, the material can be set to either ignore the geometry colors: material-setColorMode(osg::Material::OFF); or to use the geometry colors as one of the material colors: material-setColorMode(osg::Material::DIFFUSE); (for example) It's your choice how you want to apply the material. --J ___ 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] OsgMaxExp (OSGExp for 3dsmax) patch for crash on mixmaps
Hi Laurens, I just committed your patch. Thanks a lot! Cheers, Farshid On Thu, Nov 17, 2011 at 4:34 AM, Laurens Voerman l.voer...@rug.nl wrote: Hi Farshid, I experienced a crash while exporting a file from max2012 (x64). I traced the problem to a mixmap having no texture on one of the imputs, that triggered a bug in MtlKeeper.cpp line812: texUnits[i] = getNextTexUnit(stateset, subTexmap-GetMapChannel()); BUG: subTexmap is NULL Also the mixmap doesn't respond to lighting due to the way the texEnv is set up. To fix both problems I rewrote the entire MtlKeeper::convertMixTexmap functon, setting up the texEnv to first mix texure 1/2 controlled by tex3 and a second texEnv for modulating the result (of the previous texEnv) with the primary fragment color. Attached as MtlKeeper.zip Second problem I encountered with max2012 is that the exported textures are garbage is gamma correction is enabled in 3dstudio. Attached is a simple fix disabling gamma correction during export. Attached as OSGExp.zip Both files are based on svn trunk rev. 230 Regards, Laurens. ___ 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] Stereo and Render to Texture effects
Hi Kim, On Thu, Nov 10, 2011 at 6:21 AM, Kim Bale kcb...@googlemail.com wrote: Is there a way of reusing the FBOs so that I don't need to duplicate them all for each eye? I couldn't seem to find a way of doing that without the previous data being overwritten. Which stereo mode are you using? I run into this problem a lot as well. I believe the reason the previous data gets overwritten is that osgUtil::SceneView explicitly calls RenderStage::drawPreRenderStages() on both eyes, before drawing the main render stage. You might be able to fix this by commenting out these calls and letting RenderStage::draw() take care of the prerender stages, depending on which stereo mode you are using. I believe these explicit calls are necessary for the anaglyphic and interlace stereo modes, because you wouldn't want the color/stencil mask affecting the prerender stages. However, for the split and quad buffer stereo modes, I don't believe these calls are necessary and it should be safe to comment those lines out. With a slight modification to SceneView::draw() it should be possible to get this working with anaglyphics/interlace modes as well. This is something that's been on my todo list for a while. Now might be a good time to try and tackle the issue :) Cheers, Farshid Regards, Kim. ___ 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] Switch node, and multiple views
Hi Lars, On Mon, Sep 26, 2011 at 11:58 AM, Lars Karlsson klars3...@yahoo.com wrote: Any ideas or pointers as of how to architect this in OSG? Thank you. I've accomplished the same thing you are trying to do by using cull callbacks on each node. It gives you much more flexibility than node masks. There are many ways to go about this. I created a custom data structure that stores a unique identifier for each view, and saved this data structure in the user data field of the cull visitor of the view. My cull callback then retrieves this identifier from the cull visitor and determines whether or not to render to the view. My cull callback maintains a list of all the view identifiers it is either allowed or not allowed to render to. This way you are not limited to 32 bit node masks to control the rendering of nodes. Hope this information was helpful and let me know if you would like more details. Cheers, Farshid --- On Mon, 9/26/11, Ulrich Hertlein u.hertl...@sandbox.de wrote: From: Ulrich Hertlein u.hertl...@sandbox.de Subject: Re: [osg-users] Switch node, and multiple views To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Date: Monday, September 26, 2011, 10:56 AM Hi Lars, On 26/09/11 11:30 , Lars Karlsson wrote: Yes, I'd like to render one single scenegraph, however four times DIFFERENTLY (i.e. in four different views), and of course simultaneously. ... I looked quickly into TraversalMask... Is my hunch correct when I say that: - I make all four subgraphs (under Switch) active - I set their masks to 1, 2, 4, and 8 respectively - I take cameras of each of the four views in CompositeViewer, and set their masks to 1, 2, 4 and 8 respectively - now the CULL traversals for all four views will cull respective subgraphs: - CULL for view 1 culls subgraphs 2, 3, and 4 - CULL for view 2 culls subgraphs 1, 3, and 4 - CULL for view 3 culls subgraphs 1, 2, and 4 - CULL for view 4 culls subgraphs 1, 2, and 3 Am I on the right track? Thanks! Yes, except instead of a Switch you would probably just use a Group for this, unless you want to disable/switch the subgraphs as well. Cheers, /ulrich ___ 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] I made the libRocket GUI library usable with OSG
Hi Martin, This sounds very interesting! I've always wanted to be able to create interfaces for my application using HTML/CSS. I'm definitely going to have a look at this. Thanks, Farshid On Thu, Aug 25, 2011 at 9:38 PM, Martin Scheffler osgfo...@tevs.eu wrote: Hi all, On a long train ride yesterday I had the chance to work on my osg implementation of a libRocket interface. You can download the code from the attachment. libRocket is a nice little GUI library that seems to be well thought through and cleanly coded. There is an html-like format for writing GUIs. I have not yet fully explored the library, but now that I can use it in OSG I surely will. What it can do at this point: * Create fullscreen GUIs * Create in-scene GUIs * Mouse and keyboard events are transformed to GUI coordinates and forwarded to libRocket system That's all, and I think that is all that is needed. I don't think I will wrap any other libRocket functionality as it is all accessible. The included example shows two GUIs. One is full screen, the other is in-scene and can be rotated with the default osgViewer mouse manipulator. If anyone is interested in this I can put it on source control somewhere. Please give me feedback on what is missing or what can be improved! Cheers, Martin [/img] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=42250#42250 ___ 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] OSGExp, movie textures and OSG file formats
Hi Alessandro, to Farshid: when I exported to .ive or .osgb I checked 'Embed image data'...but the ive/osgb file size doesn't looks correct (I used a 16MB video and the size of the ive/osgb was something like 300KB). As other have already mentioned, I don't think the ive/osgb formats support embedding video data. If you uncheck the Embed image data option, are the ive/osgb files able to load the video externally? I don't think the osg serializers support selectively referencing some images externally while embedding other images, although this would be a nice feature. Still, I think the exporter needs to be modified to detect movie textures and set the data variance to dynamic. Is it just the osg::Image object that needs to be dynamic, or does the corresponding osg::Texture object also need to be set to dynamic? Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Flat Shading
Hi Robert, I've been trying to figure out how to switch to flat shading but I can't quite figure out how. Could someone help me out? You can use the osg::ShadeModel state attribute to enable flat shading. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Flat Shading
Hi Robert, Yes, but how do I use osg::ShadeModel? Do I get it from a viewer or camra? Do I make it my self and then pass it off to something? You will need to create an instance of the osg::ShadeModel class and apply it to the stateset of the subgraph you want to enable flat shading on. For example: osg::ref_ptrosg::ShadeModel shadeModel = new osg::ShadeModel(osg::ShadeModel::FLAT); root-getOrCreateStateSet()-setAttributeAndModes(shadeModel.get(),osg::StateAttribute::ON); where root is the root node of the subgraph. Once you've applied the shade model attribute, you can switch back and forth between smooth and flat shading by using the shadeModel-setMode(..) method. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp specular
Hi, I just spent some time looking into this and I have to agree with Baker about removing the divide by 9.99. I created a simple model and exported to some popular formats (3DS, collada, vrml) and the specular color in those models is a factor of 10 greater than the value in the osg file. Regarding the shininess setting, I'm not sure what the right thing to do is. I looked at the value exported by the various formats, and they are all over the place. It does match the value in the 3DS format though, so I'm thinking we should stick to the current behavior. If nobody has any strong objections, I will go ahead and remove the divide by 9.99. Cheers, Farshid On Tue, Jun 28, 2011 at 3:16 PM, Bradley Baker Searles bsear...@carsim.comwrote: Hi Guys, We're running into this issue as well, and I'd agree that to synchronize what the artist sees in MAX with what is rendered in OSG, the scale by 9.99 should not happen. Currently the MAX specular level of 999 is required to get an OSG specular material value of 1.0, which means the object is glowing hot in MAX, and normal looking in our OSG app. This change would also allow the artist the range of 0.0 to 9.99 in the OSG material, so they could oversaturate it if desired. I'm also of the opinion that the exponent shouldn't be scaled from the MAX (0-100) to OSG (0-128). It's just the exponent for the specular contribution. I'd personally trade consistency between the authoring environment and our OSG app for losing out on the exponent values of 101+ (which we aren't using anyway). So I'd propose that this code in MtlKeeper::createMaterial(...) remove the divide by 9.99 from the setSpecular() call, and the setShininess() call multiply by 100.0 instead of 128.0. Thanks- Baker Searles -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=41001#41001 ___ 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] OSGExp, movie textures and OSG file formats
Hi Alessandro, When exporting to ive/osgb, did you uncheck the Embed image data option? I've never actually tried exporting a model with movie textures before, so there could very well be bugs with this workflow. I'll look into this soon and let you know if I find any issues. Cheers, Farshid On Fri, Jun 24, 2011 at 12:06 PM, Alessandro Terenzi a.tere...@gmail.comwrote: I wonder if anybody else experienced my same problem: I wrote a visitor that looks for movie textures in order to play them, the input files come from 3dsMax via OSGExp v1.0.0, but I made it work only if I export to .osg, if I export to either .ive or .osgb the visitor fails to dynamic_cast any found Image to ImageStream so I cannot play those movie textures. I also noticed that if I export to .osgt then the Image's DataVariance is set to STATIC, even though the texture file type is avi, mov or others (so I have to change it to DYNAMIC otherwise they won't play) Does anyone have the same issues (especially those with the binary formats)? Is all this related to OSGExp only or am I supposed to look for movie texture in a different way than the way I use with .osg files? Thanks. Alessandro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40884#40884 ___ 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] OSGExp specular
Hi Jean-Sébastien, Sorry, I've been busy lately. Should I still look into this or does the existing behavior make sense now? Cheers, Farshid On Tue, Jun 21, 2011 at 7:31 AM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Sergey, osgExp expects specular in range 0...1000, that is range you can set in 3ds max for specular intensity. It's looks different in 3ds max then in osg though. OK, that explains it, I thought the max was 100. I'll adjust my shaders so the result looks the same in Max and in OSG. Thanks, J-S -- __** Jean-Sebastien Guay jean-sebastien.guay@cm-labs.**comjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.**com/http://whitestar02.dyndns-web.com/ __**_ osg-users mailing list osg-users@lists.**openscenegraph.org osg-users@lists.openscenegraph.org http://lists.openscenegraph.**org/listinfo.cgi/osg-users-** openscenegraph.orghttp://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] OSGExp specular
Hi Jean-Sebastien, Looking at the code, I think the mistake is that the OSG material's specular color gets set to the Max material's specular color multiplied by shinstr / 9.99f. shinstr seems to be Specular Level, which will be between 0 and 1 (mapping to 0 - 100 in Max). So my value of 64 is 0.64, and the specular color gets multiplied by about 0.064, which leaves almost nothing. What is that division by almost 10? If I remove this I get something closer to what I expect... Much closer to what is visible in Max anyways. I'm not sure who the original author of that code is, so I don't know the reason for that division. You're probably correct about removing it. I'll take a closer look at it and get back to you. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp custom preview
Hi Jean-Sebastien, I would like to be able to use a custom command to preview what is being / has been exported by OSGExp. The toolbar contains an Export and Preview button, but would it be possible to specify a custom command in the options? That way I could preview objects in a lite version of our engine and show artists exactly how it will look once in the actual simulator. I'm pretty sure MAXScript supports automating the export process and executing arbitrary shell commands. You could write a script that exports the model to the temp folder and then passes the model to your application. I've never actually done this myself, but I'd be interested to see this working. Our artist here has dabbled with MAXScript before, so I can ask him for help if you run into any problems. This is probably the best way to go, since it does not require any custom modifications to the actual plugin. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] NVidia 275-series Driver Bug
It's not just you. I tested on a Quadro 4000, driver 275.36, Windows 7 64-bit and it does not work for me either. I also tried on a GeForce 8800, driver 270.61, Windows XP and it worked correctly. Cheers, Farshid On Thu, Jun 16, 2011 at 11:08 AM, Jeremy Moles jer...@emperorlinux.comwrote: Hello folks! Anyone here using the 275 series of NVidia drivers? (Doesn't matter what OS, the bug is on Linux and Windows for me...) It appears that this driver doesn't understand GLSL arrays anymore. At least, not like it used to. Crazy, huh? Yeah, I thought so too. I've attached a __VERY__ simple application demonstrating this. If anyone has a sec (particularly Mike Wieblen), I'd be interested to see if they could compile it and perhaps shed some light on this mystery. :) I've been googling and checking the NVidia forums, but so far nothing. ___ 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] NVidia 275-series Driver Bug
On Thu, Jun 16, 2011 at 11:26 AM, Tomlinson, Gordon gtomlin...@overwatch.textron.com wrote: A mentioned before the 275 official releases are very broken and should be avoided at all costs Not quite sure why NVIDIA released them , as they should have failed the QA process easily Thanks, good to know! ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp custom preview
Hi Jean-Sébastien Guay, On Thu, Jun 16, 2011 at 11:29 AM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Agreed, though I was hoping to do it in the plugin mainly because I'm infinitely more familiar with C++ than with MaxScript (anything divided by 0 gives infinity right?) :-) But I guess that has to change someday, as I've been learning MEL (Maya's scripting language) lately too, so MaxScript is next I guess. I'll have a look at how I could get this done. With help from my artist I was able to come up with a MAXScript that automatically exports the scene and opens the model with a custom application. Follow these steps: - Download the attached MAXScript file and open in a text editor - Change the value of the filename and application variables to the file you want to export to and the application you want to open with - In Max select MAXScript - Run Script... from the menu - Select the download script file in the file explorer - Right-click on the empty toolbar area and select Customize - In the Category drop-down menu select Scripts - There should be an action item called Export to OpenSceneGraph format and preview - Click and drag the item onto the toolbar - Now you can click the button to automatically export and preview the current scene Let me know if you have any problems or improvements. I think this is a useful script and will probably include it with the next release. Cheers, Farshid OSGExportPreview.ms Description: Troff MS-macros document ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Meta-data in core OSG - project started
Hi Robert, This is great! Being able to store meta-data in any osg::Object derived class has been something we've wanted for a while now. Regarding serialization, will your changes break loading of older models that contained node descriptions? This is a big concern for us because we have hundreds of models that contain description strings. Anyways, I'll begin playing around with these changes and report any issues I encounter. Cheers, Farshid On Tue, May 31, 2011 at 7:19 AM, Robert Osfield robert.osfi...@gmail.comwrote: Hi All, This morning I've been experimenting with extending the user data support in the OSG, along the lines set out by Sukender. I've tried to keep the class count down, and keep the user interface relatively straight forward. Implementation wise I have gone for an osg::Object::UserDataContainer that is used an internal implementation structure in osg::Object, and this doesn't have any public interface. This simple nested class is defined within the osg::Object protected scope and looks like: class OSG_EXPORT UserDataContainer : public osg::Referenced { public: UserDataContainer(); UserDataContainer(const UserDataContainer udc, const osg::CopyOp copyop=CopyOp::SHALLOW_COPY); virtual void setThreadSafeRefUnref(bool threadSafe); typedef std::vector osg::ref_ptrosg::Object ObjectList; ref_ptrReferenced _userData; DescriptionList _descriptionList; ObjectList _objectList; }; Access methods for the old UserData and Descriptions list are maintained, with the later moved in from osg::Node to allow all osg::Object classes access to these convinience methods. These methods automatically create the UserDataContainer when required and can be used in an identical was as before. The new element is the ObjectList vector in UserDataContainer, this can store any object subclasses from osg::Object which can be access either via index into the vector or by the name of the osg::Object (i.e. Object::setName()/getName()). I have put convience methods into osg::Object public scope to access the UserDataContainer: void addUserObject(Object* obj); void setUserObject(unsigned int i, Object* obj); void removeUserObject(unsigned int i); unsigned int getUserObjectIndex(const osg::Object* obj) const; unsigned int getUserObjectIndex(const std::string name) const; Object* getUserObject(unsigned int i); const Object* getUserObject(unsigned int i) const; Object* getUserObject(const std::string name); const Object* getUserObject(const std::string name) const; unsigned int getNumUserObjects() const; This gets us so far, but... it forces us to provide our own subclasses of osg::Object to be able to put in our own Data, to ease the burden I have introduced a templatetypename T ValueObject implementation that has a T _value member. templatetypename T class ValueObject : public osg::Object { public: ValueObject(): Object(true), _value() { } ValueObject(const std::string name, T value): Object(true), _value(value) { setName(name); } ValueObject(const ValueObject rhs, const osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY): Object(rhs,copyop), _value(rhs._value) { } META_Object(osg, ValueObject) void setValue(const T value) { _value = value; } const T getValue() const { return _value; } protected: T _value; }; And a couple of convinience methods in osg::Object to create/access these: templatetypename T bool getUserValue(const std::string name, T value) const { typedef ValueObjectT UserValueObject; UserValueObject* uvo = dynamic_castUserValueObject*(getUserObject(name)); if (uvo) { value = uvo-getValue(); return true; } else { return false; } } templatetypename T void setUserValue(const std::string name, const T value) { typedef ValueObjectT UserValueObject; unsigned int i = getUserObjectIndex(name); if (igetNumUserObjects()) setUserObject(i, new UserValueObject(name,value)); else addUserObject(new UserValueObject(name,value)); } It's these methods that I'd expect the access to go through. As a quick test I have created an osguserdata example than we can use as a test bed for this new functionality. My current rev looks like: int main(int argc, char** argv) { osg::ref_ptrosg::Group node = new osg::Group; int i = 10; node-setUserValue(Int value,i);
Re: [osg-users] OSGExp and Max 2012
Hi Jean-Sébastien, On Fri, May 27, 2011 at 6:56 AM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: and I had Max 2011 before and it was working fine, so I'm not sure where this problem comes from. Has anything changed recently that could affect this? It compiles fine for me, but I just noticed the following in the Max 2012 SDK release notes: There are some incorrect usages of the reference system that can allow plug-ins to cause instabilities in 3ds Max, and eventually leading to unexpected behavior or crashes. One such case is when plug-ins call ReferenceMaker::SetReference()http://download.autodesk.com/global/docs/3dsmaxsdk2012/en_us/cpp_ref/class_reference_maker.html#ac11372157c1539fe4beb9160e106d739 directly on other plug-ins. Doing so only partially updates the reference graph which results in system instability when the reference links are deleted. The visibilityReferenceMaker::SetReference()http://download.autodesk.com/global/docs/3dsmaxsdk2012/en_us/cpp_ref/class_reference_maker.html#ac11372157c1539fe4beb9160e106d739 has been changed from public to protected in the class ReferenceMakerhttp://download.autodesk.com/global/docs/3dsmaxsdk2012/en_us/cpp_ref/class_reference_maker.html and all of its sub-classes, to prevent plug-ins from accidentally calling this method. Plug-ins that have been calling ReferenceMaker::SetReference()http://download.autodesk.com/global/docs/3dsmaxsdk2012/en_us/cpp_ref/class_reference_maker.html#ac11372157c1539fe4beb9160e106d739 on objects of types other than themselves or their parent class, will have to change their code to call ReferenceMaker::ReplaceReference()http://download.autodesk.com/global/docs/3dsmaxsdk2012/en_us/cpp_ref/class_reference_maker.html#aa14a0521d1381a989ecd80f385bd instead. I don't understand why it compiles fine for me though. I am using a developer preview version of Max 2012. Maybe this change only appeared in the final release version, but then what was the point of the developer preview! I'll try to download the latest version and see if I can replicate this issue. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp and Max 2012
Also, as a quick fix, can you try declaring the SetReference method of OSGHelper in a protected namespace? On Fri, May 27, 2011 at 6:56 AM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: and I had Max 2011 before and it was working fine, so I'm not sure where this problem comes from. Has anything changed recently that could affect this? Thanks in advance, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ 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] OSGExp and Max 2012
Hi Jean-Sébastien, On Fri, May 27, 2011 at 9:43 AM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Actually, since it's never called by anyone, I just commented it out. It compiles and exports correctly. Just another data point for you, but is that method useful at all? It might be called internally by Max, since it is overriding the base class method. I'm not 100% sure of this, but it's probably safest to leave it there. Also, what version of Visual Studio are you compiling with? The version of the 2012 SDK I'm using does include the previously mentioned change. So I'm thinking we might have different compilers. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp and Max 2012
Hi Jean-Sébastien, I'm compiling on VC9 x64 for Max 2012 x64 running on Windows 7 x64. :-) That's also my setup. Strange. So, what do you suggest? Can you post the contents of the buildnumber.h max header file? Also, try building using the solution files in the VisualStudio folder. Maybe there is some project setting that CMake isn't setting properly. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp and Max 2012
Hi Jean-Sébastien, Yes, that helped find out what was amiss. The CMake build setup was missing a define _USRDLL. With this defined (and the SetReference() method uncommented) it builds and runs fine. The modified file is attached. I added the define before adding the src subdirectory, instead of inside each project individually, so it will get added to all projects. That is also the case in the projects under the VisualStudio folder (I checked), so I assume this is OK. Thanks, I just committed it. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Unicode text with osg
Hi Eric On Thu, May 26, 2011 at 7:07 AM, Eric Sokolowsky esok@gmail.com wrote: Is it possible to use international text (probably unicode) with osgText? I just get garbled characters when I use my application which uses osgText for the text. When using vi or other text editors I can see the international characters normally. I am using OSG 2.8.3 primarily. Are you specifying the correct encoding type when setting the string on the osgText object? I am able to display Unicode characters fine on Windows using UTF-8 encoding. I haven't tried other encodings though. I'm not sure if this is an issue on Mac, but on Windows some characters don't show up properly, even when the correct encoding is specified. This is because the selected font might not support all the Unicode characters in the string. So you might wan to make sure that the font you are using supports all the characters you are trying to display. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi Jean-Sébastien, On Thu, May 26, 2011 at 6:31 AM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: I tried this, and I notice it's an extra line in the material description string. I'm wondering why you didn't just put the extra attributes at the end of the Map ... line for the same map (after the filename)? The reason I separated the attributes is because in Max there is a difference between a map channel (diffuse, specular, bump, etc...) and a bitmap type (bitmap, normal, mix, reflection, etc..). Technically, you can have a normal bitmap on the diffuse channel, or any other channel. I might add keywords for the other supported bitmap types in the future. Also, placing the bitmap attributes on a separate line should make parsing the description more future-proof. If a new Map attribute is added in the future, that would move the bitmap attributes over one column, which could break compatibility with older parsers. Having the bitmap attributes on a separate line should avoid this issue. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Winding up to OpenSceneGraph-3.0 release
Hi Robert, On Thu, May 26, 2011 at 3:15 AM, Robert Osfield robert.osfi...@gmail.comwrote: New freatures will need to be low risk to be included, and as we move closer to the end of Phase 1 I'll steadily raise the bar for merging new features/feature refinements so that only really low risk submissions will be considered. Just curious, do you plan on including the new meta-data feature in 3.0? Either way, I'm looking forward to using 3.0. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi Luca, On Thu, May 19, 2011 at 11:59 PM, Luca Vezzadini luca.vezzad...@gmail.comwrote: That would be perfect, so go ahead with that. I just added the support for normal map details in the description string. The format is the following: Normal unit amount method flip_red flip_green swap_red_green The method field can be one of the following strings: Tangent Local XYZ Screen World Try it out and let me know if there are any issues. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp patch for texture clamp and mirror
Thanks again. On Mon, May 23, 2011 at 3:44 AM, Laurens Voerman l.voer...@rug.nl wrote: Hi Farshid, seems to me your version is working perfectly fine. I had to create a testmodel to see the sharing for different max materials, it's not something that happens in our models often. I attach a few unrelated small fixes: src\Helpers\OSGHelper.def src\OSGExp\OSGExp.def src\OSGExp\Export.cpp src\OSGExp\Util.cpp The .def files fix a (innocent) warning from visual studio: OSGExp.exp : warning LNK4070: /OUT:OSGExp.dll directive in .EXP differs from output filename 'C:\Users\laurens\osg2\osgExp\sourceforge_svn_modtrunk_2010_vc91\src\OSGExp\Release\OSGExp.dle'; ignoring directive The change in Export.cpp (tri-DeleteThis instead of delete tri 2x) is probably from a time I tested with a compliler not matching the compiler used to compile 3dstudio. The change in util avoids a double dynamic_cast and fixes a memory leak. Laurens. On 5/20/2011 7:58 PM, Farshid Lashkari wrote: Hi Laurens, I just committed your patch, but with a small change to support texture caching. The texture cache now takes the wrap mode of the texture into account, so it should be able to reuse textures that use the same wrap mode (which is the more common case). Can you please test out the changes and let me know if it work with your models? Cheers, Farshid On Fri, May 20, 2011 at 10:17 AM, Farshid Lashkari fla...@gmail.com mailto:fla...@gmail.com wrote: Thanks Laurens. I have a concern though. Your change to createTexture2D breaks the texture caching feature. I believe I understand why you made that change, since the texture wrap modes might be different per texture instance. Maybe a better approach would be to only create a new texture instance if the wrap mode is different? I wish OSG supported setting the wrap mode independently of the texture. Cheers, Farshid On Fri, May 20, 2011 at 5:46 AM, Laurens Voerman l.voer...@rug.nl mailto:l.voer...@rug.nl wrote: Hi Farshid, attached is a patch for svn revision 205 (current Fri 20 May) for setting the texture repeat/tile mirror options according to the max material settings. Regards, Laurens. ___ 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 ___ 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] OSG image representation in memory
Hi Eric, On Mon, May 23, 2011 at 11:46 AM, Eric Sokolowsky esok@gmail.comwrote: How are OSG images stored in memory, top row first or bottom row first (in memory order)? Thanks. Every image loader I have used places the bottom row first. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp patch for texture clamp and mirror
Thanks Laurens. I have a concern though. Your change to createTexture2D breaks the texture caching feature. I believe I understand why you made that change, since the texture wrap modes might be different per texture instance. Maybe a better approach would be to only create a new texture instance if the wrap mode is different? I wish OSG supported setting the wrap mode independently of the texture. Cheers, Farshid On Fri, May 20, 2011 at 5:46 AM, Laurens Voerman l.voer...@rug.nl wrote: Hi Farshid, attached is a patch for svn revision 205 (current Fri 20 May) for setting the texture repeat/tile mirror options according to the max material settings. Regards, Laurens. ___ 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] OSGExp patch for texture clamp and mirror
Hi Laurens, I just committed your patch, but with a small change to support texture caching. The texture cache now takes the wrap mode of the texture into account, so it should be able to reuse textures that use the same wrap mode (which is the more common case). Can you please test out the changes and let me know if it work with your models? Cheers, Farshid On Fri, May 20, 2011 at 10:17 AM, Farshid Lashkari fla...@gmail.com wrote: Thanks Laurens. I have a concern though. Your change to createTexture2D breaks the texture caching feature. I believe I understand why you made that change, since the texture wrap modes might be different per texture instance. Maybe a better approach would be to only create a new texture instance if the wrap mode is different? I wish OSG supported setting the wrap mode independently of the texture. Cheers, Farshid On Fri, May 20, 2011 at 5:46 AM, Laurens Voerman l.voer...@rug.nl wrote: Hi Farshid, attached is a patch for svn revision 205 (current Fri 20 May) for setting the texture repeat/tile mirror options according to the max material settings. Regards, Laurens. ___ 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] OSGExp: CMake build
Thank you Laurens. On Thu, May 19, 2011 at 7:58 AM, Laurens Voerman l.voer...@rug.nl wrote: Hi Farshid, attached are updated CMakelist.txt files for Helpers OsgExp A fix for missing header files and an update with the added files (svn rev 199) Regards, Laurens. ___ 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] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi Luca, On Thu, May 19, 2011 at 12:59 AM, Luca Vezzadini luca.vezzad...@gmail.comwrote: I gave it a try, the description lines are there. I just see a minor issue: you did not add the MaterialData.{h,cpp} to Cmake. About the results, looks like what is there is fine! I'll do more testing in the next days, trying to use the definitions in my shaders as well, and let you know. Laurens just submitted a patch that fixes the Cmake issue. The testMat2 is using the tx directly as a bitmap, while TestMap first has a NormalMap texture, then the bitmap. In the output they look totally equivalent though. Looking at the code, it seems that you treat them as separate cases: so, what about adding an extra field at the end of TestMap to indicate it's a normal map? The field could actually be even smarter and indicate the active texture space (tangent, screen, ...). My intention was to add more keywords that would describe each map in more detail, depending on the texture type. In your example, I could add the following line to provide more information regarding the bump map on unit 2: Normal unit amount method Normal 2 1.0 Tangent This let's you know that the bitmap type on unit 2 is a normal map with the specified settings. I could eventually add keywords to provide additional info for Mix maps and Reflection maps. Does this sound reasonable to you? Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp: CMake build
Thanks for pointing that out, should be fixed now. Cheers, Farshid On Thu, May 19, 2011 at 8:59 AM, Laurens Voerman l.voer...@rug.nl wrote: Hi Farshid, sorry to bother you again, I think you are not even using the cmake files. The CMakeLists I send you for osgExp is not correct, the line ${HEADER_PATH}/MaterialData.cpp is wrong, should refer to the .h Regards, Laurens. On 5/19/2011 5:44 PM, Farshid Lashkari wrote: Thank you Laurens. On Thu, May 19, 2011 at 7:58 AM, Laurens Voerman l.voer...@rug.nl mailto:l.voer...@rug.nl wrote: Hi Farshid, attached are updated CMakelist.txt files for Helpers OsgExp A fix for missing header files and an update with the added files (svn rev 199) Regards, Laurens. ___ 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 ___ 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] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi Luca, On Wed, May 18, 2011 at 3:24 AM, Luca Vezzadini luca.vezzad...@gmail.comwrote: About where to place the descriptions and the syntax for them, let's keep in mind that each description is treated as a separate string, so I'd say each one must bring all the info it needs. Which now seems to include also the material ID. So each line should probably be something like (still using bars for now): Material_32|Diffuse|Unit_0|myFile.jpg|80 It's true we could have quite a bunch of these depending on how many materials are in your exported file. But if we can't have them on the single stateset, then to me it would much better to see them all in a single place rather them spread on various geodes. This could mean we will see a long section in the beginning of the file that contains ALL the material definitions for the whole file. The code on our side would just have to get the root node of the imported file, get all these description and process them in a single shot. And even for debugging purposes, being able to open the file and check all the materials at one is easier. Bottom line for me is: everything at the root node is better... I agree. Since the information is going to be decoupled from the stateset anyway, might as well have it all in once place. Regarding the format, are you suggesting that there should be a single description string that contains information for all the materials? Or each material should still be a separate description, but include the material name on each map entry line? Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi Luca, On Wed, May 18, 2011 at 8:02 AM, Luca Vezzadini luca.vezzad...@gmail.comwrote: I'm suggesting that we have one line per each map; so if you have 5 materials each with 3 maps you'll see 15 description lines in total. And each line should include the material ID it refers to so it's straightforward to parse (each line carries all the info you need, regardless of other strings). Then, as each node (so, in our case, the root node) can have multiple description strings (it's a vector), we can choose if we pack all the lines as a single string, if we group them by materials or if we have one string per line. Maybe we can make a few tests and see what is easier to read; but they are functionally equivalent anyway. I'm going to start playing around with this today. I'm leaning towards each material having its own description string. I'll let you know when I get something working. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi Luca, I've just committed support for the material description strings. Each material will have its own description string added to the root node. Here is a sample description: # osgmaxexp material data Name Basketball Map Diffuse 0 1 images\bball_diffuse.jpg Map Bump 1 0.3 images\bball_normal.jpg Try it out and let me know if you encounter any issues. Cheers, Farshid On Wed, May 18, 2011 at 8:15 AM, Farshid Lashkari fla...@gmail.com wrote: Hi Luca, On Wed, May 18, 2011 at 8:02 AM, Luca Vezzadini luca.vezzad...@gmail.comwrote: I'm suggesting that we have one line per each map; so if you have 5 materials each with 3 maps you'll see 15 description lines in total. And each line should include the material ID it refers to so it's straightforward to parse (each line carries all the info you need, regardless of other strings). Then, as each node (so, in our case, the root node) can have multiple description strings (it's a vector), we can choose if we pack all the lines as a single string, if we group them by materials or if we have one string per line. Maybe we can make a few tests and see what is easier to read; but they are functionally equivalent anyway. I'm going to start playing around with this today. I'm leaning towards each material having its own description string. I'll let you know when I get something working. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
On Wed, May 18, 2011 at 1:06 PM, Luca Vezzadini luca.vezzad...@gmail.comwrote: Cool! I'll give it a try tomorrow (I'm in Europe, different time...). Just to be sure I've got it right, the fields after the keyword Map are, in order: map name, tx unit, blend amount (in [0,1] range), file name. Is that right? That's right. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi Luca, On Tue, May 17, 2011 at 4:29 AM, Luca Vezzadini luca.vezzad...@gmail.comwrote: I've made a few tests with the current (trunk) version of the exporter and I'd say it doesn't handle the normal maps for now. In Max, to use a normal map you don't assign directly a bitmap to the bump channel, you first create the map of type normal, then assign the bit map to it. So there is an extra texture node to go through. I guess the exporter could be extended to check if the bump texture is not a bitmap in which case it could try to interpret is as a normal map. No idea how to do it though as I don't know the max SDK ... :( It should export if you enable unknown maps in the export options. However, this seems to force the normal map to 256x256. I'll see about adding direct support for normal maps. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi Luca, On Tue, May 17, 2011 at 6:12 AM, Luca Vezzadini luca.vezzad...@gmail.comwrote: Mmm... StateSet does not derive from osg::Node so it does not have the DescriptionList member... So are you planning to extend the StateSet class, its serializer and so on? Or did I miss something?... You are absolutely right! I had mistakenly assumed that the description list was supported by all osg::Object derived classes. Well, that puts a big dent in our plans :( Does anybody know if the new meta-data system will support all osg::Object derived classes? One option would be to put the description string in the name of the stateset object. Another option would be to use the user data field, but that would require a custom serializer. Let me know if you have another idea. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org