A question about custom texture unit

classic Classic list List threaded Threaded
2 messages Options
leo leo
Reply | Threaded
Open this post in threaded view
|

A question about custom texture unit

Hi gwaldron´╝î
    In old version I found

                    stateSet->setTextureAttribute(
                    binding->unit(),
                    _model->elevationModel()->getTexture() );

                    stateSet->removeUniform(binding->matrixName());

                    stateSet->addUniform( _context->getOrCreateMatrixUniform(
                        binding->matrixName(),
                        osg::Matrixf::identity() ) );    

in function of plugin rex
void
LoadTileData::invoke()

But in latest version I can't find it. Where is it?

Now I want to add a custom texture unit for per tilenode just like the oe_tile_elevationTex and so on. Can do you have any suggestions?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: A question about custom texture unit

Leo,
You can use a shared image layer for this.

  <image shared="true" ...

Setting a layer to shared="true" allocates a dedicated texture image unit to that layer's images. You can access the uniform name of the sampler and its texture matrix through

  layer->shareTexUniformName()
  layer->shareTexMatUniformName()

Hope this helps.
Glenn Waldron / Pelican Mapping