Added TextureUnit entry to osg::TransferFunction and osgTerrain::Layer

This commit is contained in:
Robert Osfield
2008-02-20 12:34:13 +00:00
parent c1a1f742c3
commit 6516bf4910
10 changed files with 136 additions and 63 deletions

View File

@@ -31,6 +31,13 @@ class OSG_EXPORT TransferFunction : public osg::Referenced
TransferFunction();
/** Set the texture unit to assign layer to if required.
* Negative values signifies that no texture unit has been assigned. */
void setTextureUnit(int textureUnit) { _textureUnit = textureUnit; }
/** Get the texture unit to assign layer to if required.*/
int getTextureUnit() const { return _textureUnit; }
osg::Image* getImage() { return _image.get(); }
const osg::Image* getImage() const { return _image.get(); }
@@ -45,7 +52,9 @@ class OSG_EXPORT TransferFunction : public osg::Referenced
virtual ~TransferFunction();
typedef std::vector<osg::Vec4> Colors;
Colors _colors;
int _textureUnit;
Colors _colors;
osg::ref_ptr<osg::Image> _image;
osg::ref_ptr<osg::Texture> _texture;
osg::ref_ptr<osg::Shader> _shader;