mirror of
https://github.com/ApfelTeeSaft/vb01.git
synced 2026-08-26 19:33:45 +00:00
improved shader uniform assignment
This commit is contained in:
@@ -41,11 +41,11 @@ int main(){
|
||||
|
||||
Model *model = new Model(MODEL_PATH + "kek.vb");
|
||||
Material *mat = new Material(PATH + "texture");
|
||||
mat->addVariable("lightingEnabled", false);
|
||||
mat->addVariable("texturingEnabled", true);
|
||||
mat->addBoolUniform("lightingEnabled", false);
|
||||
mat->addBoolUniform("texturingEnabled", true);
|
||||
string images[] = {TEX_PATH + "defaultTexture.jpg"};
|
||||
Texture *texture = new Texture(images, 1);
|
||||
mat->addVariable("textures[0]", texture, true);
|
||||
mat->addTexUniform("textures[0]", texture, true);
|
||||
model->setMaterial(mat);
|
||||
rootNode->attachChild(model);
|
||||
|
||||
@@ -70,8 +70,8 @@ int main(){
|
||||
*/
|
||||
Box *box = new Box(Vector3(1, 1, 1) * .25);
|
||||
Material *boxMat = new Material(PATH + "texture");
|
||||
boxMat->addVariable("texturingEnabled", false);
|
||||
boxMat->addVariable("diffuseColor", Vector4(1, 0, 0, 1));
|
||||
boxMat->addBoolUniform("texturingEnabled", false);
|
||||
boxMat->addVec4Uniform("diffuseColor", Vector4(1, 0, 0, 1));
|
||||
box->setMaterial(boxMat);
|
||||
skeleton->getBone("bone")->attachMesh(box);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user