From 4f52098da1c4707d420881e2c18046465ca9e8a3 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Tue, 22 Jul 2014 20:23:23 -0400 Subject: [PATCH] tuning tweaks to world and avatar lights --- examples/avatarLocalLight.js | 2 +- interface/src/Application.cpp | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/examples/avatarLocalLight.js b/examples/avatarLocalLight.js index 040289af1f..b1f31888d8 100644 --- a/examples/avatarLocalLight.js +++ b/examples/avatarLocalLight.js @@ -11,7 +11,7 @@ // var localLightDirections = [ {x: 1.0, y:0.0, z: 0.0}, {x: 0.0, y:0.0, z: 1.0} ]; -var localLightColors = [ {x: 1.0, y:1.0, z: 1.0}, {x: 1.0, y:1.0, z: 1.0} ]; +var localLightColors = [ {x: 0.4, y:0.335, z: 0.266}, {x: 0.4, y:0.335, z: 0.266} ]; var currentSelection = 0; var currentNumLights = 2; diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 1d0bf8d6a3..8b00bface7 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2600,7 +2600,9 @@ void Application::updateShadowMap() { glViewport(0, 0, _glWidget->width(), _glWidget->height()); } -const GLfloat WHITE_SPECULAR_COLOR[] = { 1.0f, 1.0f, 1.0f, 1.0f }; +const GLfloat WORLD_AMBIENT_COLOR[] = { 0.525f, 0.525f, 0.6f }; +const GLfloat WORLD_DIFFUSE_COLOR[] = { 0.6f, 0.525f, 0.525f }; +const GLfloat WORLD_SPECULAR_COLOR[] = { 0.94f, 0.94f, 0.737f, 1.0f }; const GLfloat NO_SPECULAR_COLOR[] = { 0.0f, 0.0f, 0.0f, 1.0f }; void Application::setupWorldLight() { @@ -2612,13 +2614,10 @@ void Application::setupWorldLight() { glm::vec3 sunDirection = getSunDirection(); GLfloat light_position0[] = { sunDirection.x, sunDirection.y, sunDirection.z, 0.0 }; glLightfv(GL_LIGHT0, GL_POSITION, light_position0); - GLfloat ambient_color[] = { 0.7f, 0.7f, 0.8f }; - glLightfv(GL_LIGHT0, GL_AMBIENT, ambient_color); - GLfloat diffuse_color[] = { 0.8f, 0.7f, 0.7f }; - glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse_color); - - glLightfv(GL_LIGHT0, GL_SPECULAR, WHITE_SPECULAR_COLOR); - glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR); + glLightfv(GL_LIGHT0, GL_AMBIENT, WORLD_AMBIENT_COLOR); + glLightfv(GL_LIGHT0, GL_DIFFUSE, WORLD_DIFFUSE_COLOR); + glLightfv(GL_LIGHT0, GL_SPECULAR, WORLD_SPECULAR_COLOR); + glMaterialfv(GL_FRONT, GL_SPECULAR, WORLD_SPECULAR_COLOR); glMateriali(GL_FRONT, GL_SHININESS, 96); } @@ -2796,7 +2795,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { } // restore default, white specular - glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR); + glMaterialfv(GL_FRONT, GL_SPECULAR, WORLD_SPECULAR_COLOR); _nodeBoundsDisplay.draw();