Hello Michael, On 02/17/2011 10:58 AM, Michael Raab wrote: > Catching the required parameters works perfectly. After that I try to > update them each frame. What I do is to iterate over the list of > interesting ShaderParameterPtr's and call setValue(). The code for the > system time looks like this: > > if((*paramIt)->getName() == "VDTSystemTime") > { > ShaderParameterRealPtr p = > ShaderParameterRealPtr::dcast((*paramIt).get()); > if( p != osg::NullFC ) > { > beginEditCP(p, ShaderParameterReal::ValueFieldMask); > p->setValue(systemTimeVar); > endEditCP(p, ShaderParameterReal::ValueFieldMask); > } > } > > The code compiles and runs fine. But the parameter seems to be not > applied to the shader. > Do I miss something?
this looks like it should work. Can you try: SHLChunkPtr shl; // pointer to an SHLChunk with a VDTSystemTime param Real32 time; shl->getUniformParameter("VDTSystemTime", time); to verify you get the expected value? You can also try if storing the SHLChunks that have the parameter and then calling: shl->setUniformParameter("VDTSystemTime", systemTimeVar); makes a difference (i just checked that it internally does pretty much the same as you are doing above, so I'm not sure where the problem might be). Cheers, Carsetn ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users