[osg-users] transfer data to shader with osg::texture

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Tue Oct 4 23:27:08 PDT 2016



Am 10/5/2016 um 3:37 AM schrieb liu ming:
> Hi Wojtek ,Thank you for your reply,I have  tried GL_RGBA16F_ARB instead like that "texture0->setInternalFormat(GL_RGBA16F_ARB);",but  it seemed like not valid.The value still is 0..1 range.Are there other solutions? Thank you.
So they are now _between_ 0 and , instead of 0 _or_ 1? Then, at least, 
you're on the right track.
What  seems wrong however is your sampler setup. Try this instead:

osg::Uniform* sampler = new osg::Uniform(osg::Uniform::SAMPLER_1D, "data");
sampler->set(0); //assign unit

ss->addUniform(sampler);

ss->setTextureAttribute(0/*unit*/, texture0 ,osg::StateAttribute::ON );

Cheers
Sebastian



>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68852#68852
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




More information about the osg-users mailing list