[osg-users] osgPPU v0.3 cycles problem

2008-12-16 Thread alexandre amyot murray
Hi (Art :) )

I just upgrade osgPPU to version 0.3. After I changed every osgPPU::Shader
to osgPPU::ShaderAttribute, my application still crashes in an unexpected
way.

But after a couple of hours of investigation (I almost went back to version
0.2), I finally found what was the bug. I have a lot of UnitInOut in my
application that add themself to create a specific effect.

Exemple  :

osgPPU::UnitInOut * aUnit = new osgPPU::UnitInOut();

osgPPU::ShaderAttribute* aShaderAttribute = new osgPPU::ShaderAttribute();
aShaderAttribute->addShader(someShader);

aShaderAttribute->add("tex0", osg::Uniform::SAMPLER_2D);
aShaderAttribute->set("tex0", 0);
aShaderAttribute->add("tex1", osg::Uniform::SAMPLER_2D);
aShaderAttribute->set("tex1", 1);

aUnit->getOrCreateStateSet()->setAttributeAndModes(aShaderAttribute);

previousUnit->addChild( aUnit );
aUnit->addChild( aUnit );// this
line seems to not be valid anymore

It seems like this is not a good practice anymore and I didn't find a way to
replicate it.


Hope you can help me

Thanks

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


Re: [osg-users] osgPPU v0.3 cycles problem

2008-12-17 Thread Art Tevs
Hi Alexandre,


The problem is that from somewhere in the osg there is a node visitor running 
over the osgPPU pipeline which hasn't specified type. I would expect here to 
run the update visitor first, but there is some other visitor running, and I do 
not know which one ;(, because the visitor has no specified type information 
(getVisitorType() returns just NODE_VISITOR).

I have updated the trunk version of osgPPU. It seems the problems with the 
cycles are gone now. Test it out. If you would like to stay on version 0.3 of 
osgPPU, then you have to rewrite the ::traverse method of Processor.cpp from 
the trunk in your copy of osgPPU.

Cheers,
art



--- alexandre amyot murray  schrieb am Di, 
16.12.2008:

> Von: alexandre amyot murray 
> Betreff: [osg-users] osgPPU v0.3 cycles problem
> An: osg-users@lists.openscenegraph.org
> Datum: Dienstag, 16. Dezember 2008, 22:19
> Hi (Art :) )
> 
> I just upgrade osgPPU to version 0.3. After I changed every
> osgPPU::Shader
> to osgPPU::ShaderAttribute, my application still crashes in
> an unexpected
> way.
> 
> But after a couple of hours of investigation (I almost went
> back to version
> 0.2), I finally found what was the bug. I have a lot of
> UnitInOut in my
> application that add themself to create a specific effect.
> 
> Exemple  :
> 
> osgPPU::UnitInOut * aUnit = new osgPPU::UnitInOut();
> 
> osgPPU::ShaderAttribute* aShaderAttribute = new
> osgPPU::ShaderAttribute();
> aShaderAttribute->addShader(someShader);
> 
> aShaderAttribute->add("tex0",
> osg::Uniform::SAMPLER_2D);
> aShaderAttribute->set("tex0", 0);
> aShaderAttribute->add("tex1",
> osg::Uniform::SAMPLER_2D);
> aShaderAttribute->set("tex1", 1);
> 
> aUnit->getOrCreateStateSet()->setAttributeAndModes(aShaderAttribute);
> 
> previousUnit->addChild( aUnit );
> aUnit->addChild( aUnit );   
> // this
> line seems to not be valid anymore
> 
> It seems like this is not a good practice anymore and I
> didn't find a way to
> replicate it.
> 
> 
> Hope you can help me
> 
> Thanks
> 
> Alex
> ___
> 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 v0.3 cycles problem (Art Tevs)

2008-12-17 Thread alexandre amyot murray
It does work fine.

Thanks

> Hi Alexandre,
>
>
> The problem is that from somewhere in the osg there is a node visitor
running over the osgPPU pipeline which hasn't specified type. I would expect
here to run the update visitor first, but there is some other visitor
running, and I do not know which >one ;(, because the visitor has no
specified type information (getVisitorType() returns just NODE_VISITOR).
>
> I have updated the trunk version of osgPPU. It seems the problems with the
cycles are gone now. Test it out. If you would like to stay on version 0.3
of osgPPU, then you have to rewrite the ::traverse method of Processor.cpp
from the trunk in your >copy of osgPPU.
>
> Cheers,
> art
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org