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 noticed the image definition has grown an
unRefImageDataAfterApply TRUE

I get the same texture problem when I load cow2.osg, and it behaves normally 
again when I set the 'unRefImageDataAfterApply' flag to false.

So my guess is that the image data may getting released before the other viewer 
instance has finished with it?


Yes, I think so.

See here for changing the unref setting after load:
http://article.gmane.org/gmane.comp.graphics.openscenegraph.user/52034
http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/71893

rgds
jp




Chris Denham

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44816#44816





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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 consider the potential  problems 
sharing of opengl objectids between contexts that Robert suggested might have 
been the problem. i.e. is sharing scene graph data between viewers running on 
different threads intrinsically safe? It seems stable for me, but I'm wondering 
if it would be better to implement my own per viewer object cache instead of 
using the shared one that results from using the cache provided by osg registry 
singleton.

Regards.
Chris. 

 

J.P. Delport wrote:
 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 noticed the image definition has grown an
  unRefImageDataAfterApply TRUE
  
  I get the same texture problem when I load cow2.osg, and it behaves 
  normally again when I set the 'unRefImageDataAfterApply' flag to false.
  
  So my guess is that the image data may getting released before the other 
  viewer instance has finished with it?
  
 
 Yes, I think so.
 
 See here for changing the unref setting after load:
 http://article.gmane.org/gmane.comp.graphics.openscenegraph.user/52034
 http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/71893
 
 rgds
 jp
 
 
 
  
  Chris Denham
  
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=44816#44816
  
  
  
  
  
  ___
  osg-users mailing list
  
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
 
 -- 
 This message is subject to the CSIR's copyright terms and conditions, e-mail 
 legal notice, and implemented Open Document Format (ODF) standard. 
 The full disclaimer details can be found at 
 http://www.csir.co.za/disclaimer.html.
 
 This message has been scanned for viruses and dangerous content by 
 MailScanner, 
 and is believed to be clean.
 
 ___
 osg-users mailing list
 
 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=44828#44828





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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);

 
Regards,
Chris Denham.


robertosfield wrote:
 Hi Chris,
 
 Um... in this type of usage it may well be the easier to have multiple
 viewers.
 
 When you are doing your browser plugin how to you manage the graphics 
 contexts?
 
 I suspect the problem may well be down to the OpenGL object ID's for
 the texture objects being shared inappropriately in your application.
 The is designed to use a different osg::State::ContextID value for
 each context, if different contexts use the same value for ContextID
 then they will share the same OpenGL object ID's which will introduce
 errors like you've seen.  It's not the only way to create the errors,
 so it's only a hunch on my part.
 
 Anyway I don't think there is anything particularly wrong with .ive
 plugin or the models, all they will be doing is providing us with
 hints as to what is wrong at a higher level.
 
 Robert.
 ___
 osg-users mailing list
 
 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=44829#44829





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Very odd behavior starting OSG app

2012-01-14 Thread Robert Osfield
Hi Joel,

This is perfectly normal, it's just a global object initialising of
your wrapped class associated with the REGISTER_OBJECT_WRAPPER.  It'll
get cleaned up automatically on exit.

Robert.

On 14 January 2012 02:57, Joel Graff pair_o_gra...@comcast.net wrote:
 Hello,

 I recently noticed when my application starts, something triggers the 
 REGISTER_OBJECT_WRAPPER macro for my custom uniform class and constructs a 
 new object before main() is even called.

 I'm not much of a C++ guru, so at the moment, the only relevant info I know 
 to provide is the call stack which looks like:


 Code:

 SG_UNIFORM_INITIALIZER::`dynamic initializer for 
 'wrapper_proxy_sg_Uniform_Wrapper''() Line 8
 msvcr100d.dll!_initterm(void(void)* * pfbegin, void (void)* * pfend) Line 873
 __tmainCRTStartup() Line473 + 0xf bytes
 mainCRTStartup() Line 371




 The macro code:

 Code:

 namespace sg {
        namespace SG_UNIFORM_SERIALIZER {
                REGISTER_OBJECT_WRAPPER(        sg_Uniform_Wrapper,
                                                                        new 
 sg::Uniform,
                                                                        
 sg::Uniform,
                                                                        
 osg::Object osg::Uniform sg::Uniform )
                {
                        ADD_UINT_SERIALIZER( USize, 0 );
                        ADD_UINT_SERIALIZER( UType, 0 );
                        ADD_STRING_SERIALIZER( LexType,  );
                }
        };
 };




 I'd pass on the class header, but it doesn't look like it's relevant...

 In any case, it's not a critical issue - things run fine as it is.  But it's 
 creating one instance of my class via the serializer macro before it even 
 executes main().

 I'm using OSG 3.0.1, compiling under VS2010.

 Any thoughts?

 Joel

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=44824#44824





 ___
 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-users Digest, Vol 55, Issue 19

2012-01-14 Thread Robert Osfield
Hi Ebru,

Please do not do and reply to a digest to post to osg-users.

On 14 January 2012 05:57, Ebru Arslan earslan2...@gmail.com wrote:
 I need information about database paging. tutorial or some basic sample.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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 WindowData(hWnd);
 gc = osg::GraphicsContext::createGraphicsContext(traits);

After gc is assigned check the value of gc-getState()-getContextID()
for each of the contexts created.  In theory for multiple contexts
they should read 0,1,2,etc.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Help:Is there a way for a single fragment to know its index during per-fragment operation?

2012-01-14 Thread wang shuiying

Hello,

In fragment shader, I would like to chage the fragment colour according 
to the fragment's index. Here index means integer number pair(x,y), 
where 0xxRes, 0yyRes, provided that viewPort has xRes * yRes pixels.


Is there a way to achieve that?

Thank you in advance!


Shuiying
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Problem with manipulating the projection matrix

2012-01-14 Thread Sven Walther
Hi Shayne,

this sounds like a possible solution. I'll try it out and let you know if it is 
working.
Thank you!

Cheers,
Sven

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44834#44834





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Help:Is there a way for a single fragment to know its index during per-fragment operation?

2012-01-14 Thread Sebastian Messerschmidt

Hi Shuiying,

The fragments coordinates(or index as you call it) can be accessed via 
gl_FragCoord. This will give unnormalized device coordinates (i.e. 
[0,xRes] [0,yRes]) which are also called window relative coordinates
If you pass your screen resolution as uniform vec2 you can normalize 
them to device coordinates easily.


cheers
Sebastian

Hello,

In fragment shader, I would like to chage the fragment colour 
according to the fragment's index. Here index means integer number 
pair(x,y), where 0xxRes, 0yyRes, provided that viewPort has xRes * 
yRes pixels.


Is there a way to achieve that?

Thank you in advance!


Shuiying
___
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] Frame syncing over multiple contexts

2012-01-14 Thread Anna Sokol
Hi,

I am trying to figure out how to keep multiple graphics contexts in frame
sync.

My operating system is Windows XP SP3.
My graphics is NVidia Quadro NVS 290 with the latest driver 276.42.
I'm using OpenSceneGraph 3.0.1 compiled with Visual C++ 2005 for win32.

I have vsync on in the driver and in Traits, also I am using a
CullDrawThreadPerContext as the threading model.
I have 2 graphics windows with separate contexts showing the same scene
with a left and right view on one display.
I have the scene moving across both windows so that I can see if its
properly syncing.
It sometimes visibly looks to be a number of frames out of sync (i.e. one
of the rendered context is dragging behind).
What could be causing this? In the threads? Or down in the graphics card?
Is there any specific settings I should set to make the rendered contexts
stay in frame sync?


Regards,
Anna Sokol
_
Once we accept our limits, we go beyond them.  -- Albert Einstein
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Very odd behavior starting OSG app

2012-01-14 Thread Joel Graff
Robert,

Thanks for the quick reply.

After a little additional testing (knowing what you've told me), I'm starting 
to suspect I've got bigger problems than I thought.  Am I right in assuming 
that serialization for user classes doesn't support multiple inheritance?

The situation is thus:  I have two classes that inherit osg::Group.  They also 
publicly inherit an additional (unique) abstract base class.  Of course, in 
each macro, I specify the osg::Group hierarchy and do not include their 
respective interface class in the list.

Anyway, I've looked through the forums and couldn't find anything devoted to 
the topic...

- Joel

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44839#44839





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Very odd behavior starting OSG app

2012-01-14 Thread Joel Graff
As it turns out, the problem I was experiencing lay elsewhere.

Thanks again.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44840#44840





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org