diff --git a/src/app/qtkscene.cpp b/src/app/qtkscene.cpp index 54b4809..c93ab78 100644 --- a/src/app/qtkscene.cpp +++ b/src/app/qtkscene.cpp @@ -114,7 +114,7 @@ void QtkScene::init() // Simple cube lighting examples. /* Phong lighting example on a basic cube. */ - mTestPhong = new Qtk::MeshRenderer("phong", Qtk::Cube()); + mTestPhong = addObject(new Qtk::MeshRenderer("phongCube", Qtk::Cube())); mTestPhong->getTransform().setTranslation(3.0f, 0.0f, -2.0f); // NOTE: You no longer need to manually bind shader program to set uniforms. // + You can still bind it if you want to for performance reasons. @@ -152,7 +152,7 @@ void QtkScene::init() // No light source needed for this lighting technique /* Initialize Ambient example cube */ - mTestAmbient = new Qtk::MeshRenderer("ambient", Cube()); + mTestAmbient = addObject(new Qtk::MeshRenderer("ambientCube", Cube())); mTestAmbient->getTransform().setTranslation(7.0f, 0.0f, -2.0f); mTestAmbient->setShaders(":/shaders/solid-ambient.vert", ":/shaders/solid-ambient.frag"); @@ -164,7 +164,7 @@ void QtkScene::init() // No light source needed for this lighting technique /* Initialize Diffuse example cube */ - mTestDiffuse = new Qtk::MeshRenderer("diffuse", Cube()); + mTestDiffuse = addObject(new Qtk::MeshRenderer("diffuseCube", Cube())); mTestDiffuse->getTransform().setTranslation(9.0f, 0.0f, -2.0f); mTestDiffuse->setShaders(":/shaders/solid-diffuse.vert", ":/shaders/solid-diffuse.frag"); @@ -180,7 +180,7 @@ void QtkScene::init() mesh->getTransform().scale(0.25f); /* Initialize Specular example cube */ - mTestSpecular = new Qtk::MeshRenderer("specular", Cube()); + mTestSpecular = addObject(new Qtk::MeshRenderer("specularCube", Cube())); mTestSpecular->getTransform().setTranslation(11.0f, 0.0f, -2.0f); mTestSpecular->setShaders(":/shaders/solid-specular.vert", ":/shaders/solid-specular.frag"); @@ -233,8 +233,8 @@ void QtkScene::init() /* Test alien Model with phong lighting and specular mapping. */ model = addObject(new Qtk::Model("alienTest", ":/models/models/alien-hominid/alien.obj", - ":/shaders/model-specular.vert", - ":/shaders/model-specular.frag")); + ":/shaders/model-phong.vert", + ":/shaders/model-phong.frag")); model->getTransform().setTranslation(3.0f, -1.0f, 10.0f); model->getTransform().scale(0.15f); model->setUniform("uMaterial.ambient", QVector3D(1.0f, 1.0f, 1.0f)); @@ -242,7 +242,7 @@ void QtkScene::init() model->setUniform("uMaterial.specular", QVector3D(1.0f, 1.0f, 1.0f)); model->setUniform("uMaterial.ambientStrength", 0.8f); model->setUniform("uMaterial.diffuseStrength", 0.8f); - model->setUniform("uMaterial.specularStrength", 1.0f); + model->setUniform("uMaterial.specularStrength", 0.5f); model->setUniform("uMaterial.shine", 32.0f); model->setUniform("uLight.ambient", QVector3D(1.0f, 1.0f, 1.0f));