Hi,

i thought i could use the buildin variabled to save some uniforms. But i did'nt 
realize that they were limited. 

Well..

i tried to use uniform arrays but with very little sucess:

I create my Uniform:

ref_ptr<Uniform> matrixArrayUniform = new 
Uniform(Uniform::FLOAT_MAT4,"matrices",10);
        stateSet->addUniform(matrixArrayUniform.get());

later i add 10 matrices:

for (int i = 0; i < 10; i++) {
        matrixArrayUniform->setElement(i, texMat->getMatrix());
}

i defined the uniform within my fragment shader:
"uniform mat4 matrices[10];"

and tried to access a matrix via matrices[2] for example but with no luck. 

If i use no arrays and limit the size of the uniform to one element everything 
works just as expected.

Must i use something other than osg::Uniform::FLOAT_MAT4?

Greetings,

Johannes

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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to