Hi Gerrit,

Gerrit Voß wrote:
> On Wed, 2009-06-17 at 19:52 -0500, Carsten Neumann wrote:
>> I think I've figured out why sometimes procedural variables on shaders 
>> are not updated correctly (at least for 2; reports about the same 
>> problem in 1.x are still unsolved unfortunately): In 
>> DrawEnv::activateState() line ~340 there is this test:
>>
>> if(pNewState         != _pActiveState        ||
>>     pNewStateOverride != _pActiveStateOverride  )
>> {
>>     changeTo(...);
>> }
>>
>> If only have example scenes that use OSG_ENABLE_NEW_SHADER=OFF and use 
>> SHLChunk, but I don't see anything that would make it better for the new 
>> shader infrastructure as that also relies an changeFrom being called 
>> regardless of a change being necessary.
> 
> hmm, might be, let me check it for the new infrastructure, just so I'm
> sure, we are looking at identical states with proc var that should
> change the values,

yes, basically two geometries that share the same material, so you get 
the same state.

> e.g. containing something like OSGViewMatrix and
> the objects having difference transformations. 

yes, or OSGWorldMatrix - not sure of OSGViewMatrix changes between 
objects, I always think of the view matrix as the inverse camera beacon 
transform, but I might be mixing up the definitions here.

> Hmm, started but it looks like something else is not quite
> right. Let me dig around a little.

The reason I think this also affects the new stuff is because it is 
before that actually gets a chance, i.e. the DrawEnv::activateState 
short circuits the state change before it gets to any infrastructure 
specific code. There is also a bug in SHLChunk::changeFrom, see the 
"Graph operators & OSG shader variables" thread on the users list for a 
patch.

        Cheers,
                Carsten

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core

Reply via email to