Re: [osg-users] Help on multitexturing..

2018-04-20 Thread Sebastian Messerschmidt
Hi Marlin, Re-phrasing Roberts advice: osg::Uniform* sampler = new osg::Uniform(osg::Uniform::SAMPLER_2D, "NameOfTheSamplerInGLSL"); sampler->set(0); //assign unit ss->addUniform(sampler); ss->setTextureAttribute(0/*unit*/, texture0 ,osg::StateAttribute:ON ); osg::Uniform* sampler_1 = new

Re: [osg-users] Help on multitexturing..

2018-04-19 Thread Robert Osfield
Hi Marlin, The sampler value should be an int, so you shouldn't pass a texture pointer to your setting of the TexLayerSampler0 second sampler. Perhaps this was just a copy and paste error. As a general note, normally one would assign a base texture on texture unit 0 rather than 1. Robert.

[osg-users] Help on multitexturing..

2018-04-19 Thread Rowley, Marlin R
Hello, I've been wracking my brain all day on trying to figure out how to do this with no clear examples found online. I have this set of calls in my C++: mGroupState = mBoundGeometry->getOrCreateStateSet(); mGroupState->getOrCreateUniform("BaseTexSampler",