Added TextureWeights uniform support and controls to osgFX::MultiTextureControl to support usage with shaders.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14668 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
@@ -32,20 +32,33 @@ namespace osgFX
|
||||
|
||||
META_Node(osgFX, MultiTextureControl);
|
||||
|
||||
typedef std::vector<float> TextureWeightList;
|
||||
|
||||
void setTextureWeights(const TextureWeightList& twl) { _textureWeightList = twl; }
|
||||
TextureWeightList& getTextureWeights() { return _textureWeightList; }
|
||||
const TextureWeightList& getTextureWeights() const { return _textureWeightList; }
|
||||
|
||||
void setTextureWeight(unsigned int unit, float weight);
|
||||
|
||||
float getTextureWeight(unsigned int unit) const { return (unit<_textureWeightList.size()) ? _textureWeightList[unit] : 0.0f; }
|
||||
|
||||
unsigned int getNumTextureWeights() const { return _textureWeightList.size(); }
|
||||
|
||||
void setUseTexEnvCombine(bool flag) { _useTexEnvCombine = flag; }
|
||||
bool getUseTexEnvCombine() const { return _useTexEnvCombine; }
|
||||
|
||||
void setUseTextureWeightsUniform(bool flag) { _useTextureWeightsUniform = flag; }
|
||||
bool getUseTextureWeightsUniform() const { return _useTextureWeightsUniform; }
|
||||
|
||||
protected:
|
||||
virtual ~MultiTextureControl() {}
|
||||
MultiTextureControl& operator = (const MultiTextureControl&) { return *this; }
|
||||
|
||||
void updateStateSet();
|
||||
|
||||
typedef std::vector<float> TextureWeightList;
|
||||
TextureWeightList _textureWeightList;
|
||||
|
||||
bool _useTexEnvCombine;
|
||||
bool _useTextureWeightsUniform;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user