diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ecce508acf..52704bc5b0 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2658,7 +2658,8 @@ void Application::updateShadowMap() { glViewport(0, 0, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight()); } -const GLfloat WORLD_AMBIENT_COLOR[] = { 0.525f, 0.525f, 0.6f }; +//const GLfloat WORLD_AMBIENT_COLOR[] = { 0.525f, 0.525f, 0.6f }; +const GLfloat WORLD_AMBIENT_COLOR[] = { 0.2f, 0.2f, 0.3f }; const GLfloat WORLD_DIFFUSE_COLOR[] = { 0.6f, 0.525f, 0.525f }; const GLfloat WORLD_SPECULAR_COLOR[] = { 0.94f, 0.94f, 0.737f, 1.0f }; diff --git a/libraries/fbx/src/FBXReader.cpp b/libraries/fbx/src/FBXReader.cpp index 9532f44acf..d2bda2d747 100644 --- a/libraries/fbx/src/FBXReader.cpp +++ b/libraries/fbx/src/FBXReader.cpp @@ -753,6 +753,7 @@ public: float shininess; float opacity; QString id; + model::MaterialPointer _material; }; class Cluster { @@ -1715,6 +1716,14 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping, #endif } material.id = getID(object.properties); + + material._material = model::MaterialPointer(new model::Material()); + material._material->setEmissive(material.emissive); + material._material->setDiffuse(material.diffuse); + material._material->setSpecular(material.specular); + material._material->setShininess(material.shininess); + material._material->setOpacity(material.opacity); + materials.insert(material.id, material); } else if (object.name == "NodeAttribute") { @@ -2138,6 +2147,8 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping, for (int j = 0; j < extracted.partMaterialTextures.size(); j++) { if (extracted.partMaterialTextures.at(j).first == materialIndex) { FBXMeshPart& part = extracted.mesh.parts[j]; + + part._material = material._material; part.diffuseColor = material.diffuse; part.specularColor = material.specular; part.emissiveColor = material.emissive; diff --git a/libraries/render-utils/src/directional_light_cascaded_shadow_map.slf b/libraries/render-utils/src/directional_light_cascaded_shadow_map.slf index e2a58de14b..08fdc3a908 100644 --- a/libraries/render-utils/src/directional_light_cascaded_shadow_map.slf +++ b/libraries/render-utils/src/directional_light_cascaded_shadow_map.slf @@ -83,7 +83,7 @@ void main(void) { float facingLight = step(0.0, diffuse) * shadowAttenuation; // compute the base color based on OpenGL lighting model - vec3 baseColor = diffuseVal.rgb * (gl_FrontLightModelProduct.sceneColor.rgb + + vec3 baseColor = diffuseVal.rgb * (/*gl_FrontLightModelProduct.sceneColor.rgb + */ gl_FrontLightProduct[0].ambient.rgb + gl_FrontLightProduct[0].diffuse.rgb * (diffuse * facingLight)); // compute the specular multiplier (sans exponent) @@ -93,5 +93,9 @@ void main(void) { // add specular contribution vec4 specularColor = specularVal; gl_FragColor = vec4(baseColor.rgb + pow(specular, specularColor.a * 128.0) * specularColor.rgb, normalVal.a); + + if (gl_FragCoord.x > 1024) { + gl_FragColor = vec4( (gl_FrontLightProduct[0].ambient.rgb + gl_FrontLightProduct[0].diffuse.rgb * (diffuse * facingLight)), normalVal.a); + } } }