setting vec4 uniforms

This commit is contained in:
devZoGok
2022-03-25 20:27:13 +02:00
parent 0fa04075d1
commit ce5c24a380
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -32,6 +32,11 @@ namespace vb01{
uni->animatable = animatable;
}
void Material::setVec4Uniform(string name, Vector4 value){
Vector4Uniform *uni = (Vector4Uniform*)getUniform(name);
uni->value = value;
}
void Material::update(){
shader->use();
+1
View File
@@ -142,6 +142,7 @@ namespace vb01{
Material(std::string, bool = false);
~Material();
void update();
void setVec4Uniform(std::string, Vector4);
void setTexUniform(std::string, Texture*, bool);
Uniform* getUniform(std::string);
inline Uniform* getUniform(int i){return uniforms[i];}