Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-16 Thread Sergey Polischuk
Hi all I'm gonna add my 5 cents on this topic. I was having similar problems in app which recreates viewer in runtime (there are preview window and viewer created when widget shows up), using osg version 3.0(?). In my case problem was not only with textures - i was getting corrupted vertex

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-16 Thread Chris Denham
Hi Robert, Yep, I can confirm the return value of gc-getState()-getContextID() is increasing as you describe for each brower plugin instance created. Does that mean I should be ok sharing scengraph between viewers? It certainly seems ok now I've disabled the unref images after apply flag on the

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-16 Thread Chris Denham
Hi Hybr, Corrupted vertex arrays? Do you mean the OpenSceneGraph geometry data, or a problem with the OGL compiled display list? I've not seen that, and I hope I don't. ;-) I'll keep an eye out for trouble though. Cheers, Chris. hybr wrote: Hi all I'm gonna add my 5 cents on this topic. I

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-16 Thread Sergey Polischuk
I've destroyed complete scene with viewer and graphics context, and recreated it all with reading new models from files with disabled cache etc. On first run all was ok, and on next runs mesh would look all distorted (some vertices of mesh randomly displaced etc). Dont know if it problem with

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-16 Thread Robert Osfield
Hi Chris, On 16 January 2012 10:39, Chris Denham c.m.den...@gmail.com wrote: Yep, I can confirm the return value of  gc-getState()-getContextID() is increasing as you describe for each brower plugin instance created. Does that mean I should be ok sharing scengraph between viewers? It should

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-16 Thread Robert Osfield
Hi Sergey, 2012/1/16 Sergey Polischuk pol...@yandex.ru: I've destroyed complete scene with viewer and graphics context, and recreated it all with reading new models from files with disabled cache etc. On first run all was ok, and on next runs mesh would look all distorted (some vertices of

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-16 Thread Sergey Polischuk
Hi, Robert If it'll help to understand where problem might be - there are some details: I dont use any opengl functions directly, so i think osg management of opengl objects should be ok. Here some code i used to setup viewer on creation: On viewer init : graphicsWindow = new

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-16 Thread Chris Denham
Hi Robert, robertosfield wrote: Is it that you are creating one viewer and context then drawing frames, then later creating a new context and draw more frames. In the later case I can certainly see that if the first frames draw will release the osg::Image resources assigned to osg::Texture

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-14 Thread J.P. Delport
Hi, On 13/01/2012 18:37, Chris Denham wrote: Ah ha, Another interesting experiment doing the round trip from osg to ive and back. e.g. osgconv -O noTexturesInIVEFile cow.osg cow.ive osgconv cow.ive cow2.osg cow2.osg has the same problem and cow.ive, and on comparison on cow.osg and cow2.osg I

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-14 Thread Chris Denham
Hi Jp, Thanks for this info. I wrote a node visitor to change the texture setting after load by calling texture-setUnRefImageDataAfterApply(false); and that does indeed seem to fix the problem, so I'm pleased others have come up with the same fix. Though I'm now wondering if I still need to

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-14 Thread Chris Denham
Hi Robert, To answer your question about how I manage the graphics contexts. I just create a new one for the window handle provided by each instance of my browser plugin e.g Code: traits-inheritedWindowData = new WindowData(hWnd); gc = osg::GraphicsContext::createGraphicsContext(traits);

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-14 Thread Robert Osfield
Hi Chris, On 14 January 2012 09:30, Chris Denham c.m.den...@gmail.com wrote: Hi Robert, To answer your question about how I manage the graphics contexts. I just create a new one for the window handle provided by each instance of my browser plugin e.g Code: traits-inheritedWindowData = new

[osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-13 Thread Chris Denham
I'm having some problems connected with the use of textures embedded within IVE files. The problem arises when I use the same IVE model instance from within two instances of osgViewer::Viewer which results in unpredictable rendering of textures in one of the viewer instances, usually the

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-13 Thread Robert Osfield
Hi Chris, Using two independent viewers in an application is not normal or recommended. I would recommend that you use a single CompositeViewer with two Views. See the osgcompositeviewer example. Robert. On 13 January 2012 14:18, Chris Denham c.m.den...@gmail.com wrote: I'm having some

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-13 Thread Chris Denham
Hi Robert, My example code was only meant to show the symtoms of the problem I get it in my real world code. How can I use a composite viewer to implement views within multiple browser plugin instances, potentially on different web pages? Would I have to make the composite viewer a singleton

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-13 Thread Robert Osfield
Hi Chris, On 13 January 2012 15:45, Chris Denham c.m.den...@gmail.com wrote: Hi Robert, My example code was only meant to show the symtoms of the problem I get it in my real world code. How can I use a composite viewer to implement views within multiple browser plugin instances, potentially

Re: [osg-users] Problem with corrupted textures when sharing instances of models loaded from IVE format.

2012-01-13 Thread Chris Denham
Ah ha, Another interesting experiment doing the round trip from osg to ive and back. e.g. osgconv -O noTexturesInIVEFile cow.osg cow.ive osgconv cow.ive cow2.osg cow2.osg has the same problem and cow.ive, and on comparison on cow.osg and cow2.osg I noticed the image definition has grown an