Re: [osg-users] Problems using setResizeNonPowerOfTwoHint(false);
Robert, Gordon, This issue looks like it might be the same one I experienced back in February (http://forum.openscenegraph.org/viewtopic.php?t=1656) I never took it further as my need soon became OBE, but at least it's another potential data point. -- Dan -Original Message- From: Tomlinson, Gordon [mailto:gtomlin...@overwatch.textron.com] Sent: Monday, June 01, 2009 11:22 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Problems using setResizeNonPowerOfTwoHint(false); Hi Robert Ok we will give it a go and get back to you Gordon Product Manager 3d __ Gordon Tomlinson Email : gtomlinson @ overwatch.textron.com __ -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users- boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: Monday, June 01, 2009 12:50 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Problems using setResizeNonPowerOfTwoHint(false); Hi Gordon, I've just tracked down the original posts from Mark and have looked at his sample and suggested fix. The fix hasn't been merged, nor a variation on it. I vaguely remember the thread, but not any resolution, it might be that I was swept away by other work so didn't chase it up. I've just tried to reproduce the problem using the Sample.cpp but unfortunately I can't reproduce the problem on my ATI based system as it does have full support for non power of two with mipmapping. I've followed the logic of the related generate mipmap code and can see how it would fail, and why Mark's suggest should address this failure. The failure looks to have been due to introduction of more advanced mipmap generation support, which probably worked in some usage combinations but not all. I have taken the essence of Mark's fixed and applied to Texture2D.cpp, could you test this as I can't reproduce the problem to know whether it's been fixed or not. Robert. On Mon, Jun 1, 2009 at 2:39 PM, Tomlinson, Gordon gtomlin...@overwatch.textron.com wrote: Hi Were having problems with textures that are non power of 2 or power 2 if we use m_texture-setResizeNonPowerOfTwoHint(false); we get no texture The engineer who spotted this says this post http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg1520 6.html had a fix but looks like it never made it submission or was maybe rejects , does any one elsehave this issue, was this fix ever applied ? Fails in 2.8 Works in 2.3/4 Gordon Product Manager 3d __ Gordon Tomlinson Email : gtomlinso...@ overwatch.textron.com __ (C): (+1) 571-265-2612 (W): (+1) 703-437-7651 Self defence is not a function of learning tricks but is a function of how quickly and intensely one can arouse one's instinct for survival - Master Tambo Tetsura ___ 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] Problems with non-resized NPOT textures andtrilinear min filter
Robert, Thanks for confirming that it isn't just me. Well, at least on machines with an Nvidia card. Does anyone with an ATI card experience this same issue with the samples I posted? I'll try digging deeper as you suggest, though like I mentioned in my original post I was able to make it work simply by reverting the location of the _textureObjectBuffer assignment in Texture2D.cpp back to where it was before r8606. -- Dan -Original Message- From: Robert Osfield [mailto:robert.osfi...@gmail.com] Sent: Thursday, February 26, 2009 12:58 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Problems with non-resized NPOT textures andtrilinear min filter Hi Dan, On Wed, Feb 25, 2009 at 10:02 PM, Gilbert, Daniel R. daniel.r.gilb...@saic.com wrote: Are others able to reproduce this same behavior using my attached sample? Just tried the test models on my Kubuntu 8.10/Gefore8800GTS cards and I get: npot_skydome_linear_noresize.osg works. npot_skydome_trilinear_noresize.osg fails. npot_skydome_trilinear_resize.osg works. I also don't get any OpenGL errors when npot_skydome_trilinear_noresize.osg fails. Any thoughts on how to attempt a fix? It could well be a driver issue, but also might be an OSG issue... When you have a model without mipmaps you have to generate them, either by using gluScaleImage or using the one of the two hardware mipmap extension. It'd be worth digging into osg::Texture/Texture2D to see what code paths it's taking to ask for the mipmap generation. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Flicker in osgviewer, multiple channels
Hi Per, This might be too simple a solution, but have you tried assigning nodemasks to the objects in question along with the appropriate nodemask for the various cameras? The osgstereoimage example shows how this works. Hope this helps, -- Dan -Original Message- From: Jean-Sébastien Guay [mailto:jean-sebastien.g...@cm-labs.com] Sent: Thursday, February 26, 2009 7:13 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Flicker in osgviewer, multiple channels Hello Per, Now I am trying to hide an object (using a osg::Switch) in one channel and show it in the others. What I normally do to get this effect is add the object directly as a child of the camera(s) where you want to see the object, but not as child of the others. This doesn't solve your problem, but gives you another way of getting the effect you want. I think you were on a bad track trying to change an osg::Switch in a camera's pre-draw callback. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problems with non-resized NPOT texturesandtrilinear min filter
Robert, I tracked the problem down to where it is failing down in Texture::mipmapAfterTexImage(), which ultimately gets called from the call to applyTexImage2D_load() in Texure2D::apply(). void Texture::mipmapAfterTexImage(State state, GenerateMipmapMode beforeResult) const { switch (beforeResult) { case GENERATE_MIPMAP: { unsigned int contextID = state.getContextID(); TextureObject* textureObject = getTextureObject(contextID); if (textureObject) === IS NULL { osg::FBOExtensions* fbo_ext = osg::FBOExtensions::instance(contextID, true); fbo_ext-glGenerateMipmapEXT(textureObject-_target); } } break; o o o } The passed in value of beforeResult is GENERATE_MIPMAP. The call to getTextureObject(contextID) simply returns: /** Returns a pointer to the texture object for the current context. */ inline TextureObject* getTextureObject(unsigned int contextID) const { return _textureObjectBuffer[contextID].get(); } Since r8606 moved the assignment of _textureObjectBuffer[contextID] to *after* the call to applyTexImage2D_load() it's returning a NULL pointer so the call to glGenerateMipmapEXT never occurs. No error message is displayed so we're none the wiser. Considering that the assignment to _textureObjectBuffer[contextID] was moved in order to avoid a crash, where should the assignment occur in order to avoid crashes while still properly generating MipMaps? -- Dan -Original Message- From: Gilbert, Daniel R. Sent: Thursday, February 26, 2009 7:17 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Problems with non-resized NPOT texturesandtrilinear min filter Robert, Thanks for confirming that it isn't just me. Well, at least on machines with an Nvidia card. Does anyone with an ATI card experience this same issue with the samples I posted? I'll try digging deeper as you suggest, though like I mentioned in my original post I was able to make it work simply by reverting the location of the _textureObjectBuffer assignment in Texture2D.cpp back to where it was before r8606. -- Dan -Original Message- From: Robert Osfield [mailto:robert.osfi...@gmail.com] Sent: Thursday, February 26, 2009 12:58 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Problems with non-resized NPOT textures andtrilinear min filter Hi Dan, On Wed, Feb 25, 2009 at 10:02 PM, Gilbert, Daniel R. daniel.r.gilb...@saic.com wrote: Are others able to reproduce this same behavior using my attached sample? Just tried the test models on my Kubuntu 8.10/Gefore8800GTS cards and I get: npot_skydome_linear_noresize.osg works. npot_skydome_trilinear_noresize.osg fails. npot_skydome_trilinear_resize.osg works. I also don't get any OpenGL errors when npot_skydome_trilinear_noresize.osg fails. Any thoughts on how to attempt a fix? It could well be a driver issue, but also might be an OSG issue... When you have a model without mipmaps you have to generate them, either by using gluScaleImage or using the one of the two hardware mipmap extension. It'd be worth digging into osg::Texture/Texture2D to see what code paths it's taking to ask for the mipmap generation. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problems with non-resized NPOT texturesandtrilinearmin filter
Robert, Sounds good. Thanks for taking the time to verify that you were able to reproduce the problem on your end. -- Dan -Original Message- From: Robert Osfield [mailto:robert.osfi...@gmail.com] Sent: Thursday, February 26, 2009 10:47 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Problems with non-resized NPOT texturesandtrilinearmin filter HI Dan, I don't know the answer to this off the top of my head. These changes are party of a 3rd party submission that I reviewed but now can't remember the details. I'm afraid I'm juggling a couple of tasks right now so can't dive into look into debugging this issue right away. Perhaps others who've tinkered with this code will be able to spot the problem/and a solution, if not then I'll come back to this once I've cleared my intray a bit more. Robert. On Thu, Feb 26, 2009 at 5:45 PM, Gilbert, Daniel R. daniel.r.gilb...@saic.com wrote: Robert, I tracked the problem down to where it is failing down in Texture::mipmapAfterTexImage(), which ultimately gets called from the call to applyTexImage2D_load() in Texure2D::apply(). void Texture::mipmapAfterTexImage(State state, GenerateMipmapMode beforeResult) const { switch (beforeResult) { case GENERATE_MIPMAP: { unsigned int contextID = state.getContextID(); TextureObject* textureObject = getTextureObject(contextID); if (textureObject) === IS NULL { osg::FBOExtensions* fbo_ext = osg::FBOExtensions::instance(contextID, true); fbo_ext-glGenerateMipmapEXT(textureObject-_target); } } break; o o o } The passed in value of beforeResult is GENERATE_MIPMAP. The call to getTextureObject(contextID) simply returns: /** Returns a pointer to the texture object for the current context. */ inline TextureObject* getTextureObject(unsigned int contextID) const { return _textureObjectBuffer[contextID].get(); } Since r8606 moved the assignment of _textureObjectBuffer[contextID] to *after* the call to applyTexImage2D_load() it's returning a NULL pointer so the call to glGenerateMipmapEXT never occurs. No error message is displayed so we're none the wiser. Considering that the assignment to _textureObjectBuffer[contextID] was moved in order to avoid a crash, where should the assignment occur in order to avoid crashes while still properly generating MipMaps? -- Dan -Original Message- From: Gilbert, Daniel R. Sent: Thursday, February 26, 2009 7:17 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Problems with non-resized NPOT texturesandtrilinear min filter Robert, Thanks for confirming that it isn't just me. Well, at least on machines with an Nvidia card. Does anyone with an ATI card experience this same issue with the samples I posted? I'll try digging deeper as you suggest, though like I mentioned in my original post I was able to make it work simply by reverting the location of the _textureObjectBuffer assignment in Texture2D.cpp back to where it was before r8606. -- Dan -Original Message- From: Robert Osfield [mailto:robert.osfi...@gmail.com] Sent: Thursday, February 26, 2009 12:58 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Problems with non-resized NPOT textures andtrilinear min filter Hi Dan, On Wed, Feb 25, 2009 at 10:02 PM, Gilbert, Daniel R. daniel.r.gilb...@saic.com wrote: Are others able to reproduce this same behavior using my attached sample? Just tried the test models on my Kubuntu 8.10/Gefore8800GTS cards and I get: npot_skydome_linear_noresize.osg works. npot_skydome_trilinear_noresize.osg fails. npot_skydome_trilinear_resize.osg works. I also don't get any OpenGL errors when npot_skydome_trilinear_noresize.osg fails. Any thoughts on how to attempt a fix? It could well be a driver issue, but also might be an OSG issue... When you have a model without mipmaps you have to generate them, either by using gluScaleImage or using the one of the two hardware mipmap extension. It'd be worth digging into osg::Texture/Texture2D to see what code paths it's taking to ask for the mipmap generation. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce negraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Potential problem with PagedLOD and GeometryTechnique
Hi Rafa, Ah. ATI cards. Gotta love 'em! Anyways, we encountered a very similar problem with VBOs and ATI cards -- well, at least with Radeon cards -- so we added an extra startup step to disable VBOs if the renderer string contains Radeon. Not the most elegant solution, but it allowed us to run on various machines without crashing. Here's the code: void CardCapabilities::DisableExtensions() { // Disable extensions which have been shown to cause problems // for certain renderers const GLubyte* renderer = glGetString(GL_RENDERER); if (renderer) { // Convert renderer to lowercase for easier comparison std::string strRenderer = (const char*)renderer; std::transform(strRenderer.begin(), strRenderer.end(), strRenderer.begin(), tolower); // Turn off VBOs for ATI Radeon cards if (strRenderer.find(radeon) != std::string::npos) { printf(Disabling 'GL_ARB_vertex_buffer_object' extension for Radeon card\n); osg::setGLExtensionDisableString(GL_ARB_vertex_buffer_object); } } } BTW, this technique was inspired by some renderer-specific code I noticed in Texture::Extensions::setupGLExtensions(). Hope this helps. -- Dan -Original Message- From: Robert Osfield [mailto:[EMAIL PROTECTED] Sent: Friday, September 28, 2007 3:55 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Potential problem with PagedLOD and GeometryTechnique Hi Rafa, This crash very much sounds like a bug in the ATI driver. Robert. On 9/28/07, Rafa Gaitan [EMAIL PROTECTED] wrote: Hi Robert, We have been using some classes of osgTerrain combined with PagedLOD. On Nvidia cards.. all works well but on ATI cards we have found a a crash!. We are using yesterday svn version. And María in a previous mail reported a similar problem, and we have tried to reproduce it using only C++. The problem is when the DatabasePager tries to compile the GeometryTechnique and passes through the traverse call. The call to init(), inside the traverse, the one outside the Update phase, is called. The problem remains in the geometry created inside GeometryTechnique because it use the hint setUseVertexBuffers(true), and I don't know really why, but it makes a crash. On Nvidia cards and MacOSX there is no problem, but on Windows and linux with ATI.. doesn't work at all. Changing the hint to setUseDisplayLists(true), and disabling the use of vertexBufferObjects works without problems. Rafa. -- Rafael Gaitán Linares Instituto de Automática e Informática Industrial http://www.ai2.upv.es Ciudad Politécnica de la Innovación Universidad Politécnica de Valencia ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce negraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org