improved shinyness rending

minor fixes
This commit is contained in:
devZoGok
2021-10-19 19:06:41 +03:00
parent 43ef4c518d
commit d364dd23aa
5 changed files with 67 additions and 50 deletions
+13 -3
View File
@@ -37,12 +37,22 @@ int main(){
mat->setTexturingEnabled(true);
mat->setLightingEnabled(true);
mat->setNormalMapEnabled(true);
mat->setSpecularMapEnabled(true);
string im0[] = {TEX_PATH + "bricks.jpg"};
string im1[] = {TEX_PATH + "bricksNormal.jpg"};
Texture *diffuseTex = new Texture(im0, 1);
mat->addDiffuseMap(diffuseTex);
string im1[] = {TEX_PATH + "bricksNormal.jpg"};
Texture *normalTex = new Texture(im1, 1, Texture::NORMAL);
mat->addNormalMap(normalTex);
string im2[] = {TEX_PATH + "bricksSpecular.jpg"};
Texture *specularTex = new Texture(im2, 1, Texture::SPECULAR);
mat->addSpecularMap(specularTex);
mat->setSpecularStrength(1);
mat->setShinyness(2);
box->setMaterial(mat);
rootNode->attachChild(box);
@@ -52,8 +62,8 @@ int main(){
Node *lightNode = new Node(Vector3::VEC_ZERO, Quaternion::QUAT_W, Vector3::VEC_IJK, "", new AnimationController());
lightNode->addLight(light);
rootNode->attachChild(lightNode);
lightNode->setOrientation(Quaternion(1.2, Vector3(1, 0, 0)));
lightNode->setPosition(Vector3(0, 5, 0));
lightNode->setOrientation(Quaternion(.7, Vector3(1, 0, 0)));
lightNode->setPosition(Vector3(0, 5, -5));
KeyframeChannel kcA;
kcA.animatable = light;