From f2c4e04a5a01eb89a166787cdada3c5ca9e65caa Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Mon, 11 May 2015 14:06:10 -0700 Subject: [PATCH] clean up for pr --- interface/src/Application.cpp | 2 +- .../render-utils/src/DeferredGlobalLight.slh | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index d010119f23..dba4bd25f5 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3330,7 +3330,7 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs auto skyStage = DependencyManager::get()->getSkyStage(); DependencyManager::get()->setGlobalLight(skyStage->getSunLight()->getDirection(), skyStage->getSunLight()->getColor(), skyStage->getSunLight()->getIntensity(), skyStage->getSunLight()->getAmbientIntensity()); DependencyManager::get()->setGlobalAtmosphere(skyStage->getAtmosphere()); - DependencyManager::get()->setGlobalSkybox(skybox); + // NOt yet DependencyManager::get()->setGlobalSkybox(skybox); PROFILE_RANGE("DeferredLighting"); PerformanceTimer perfTimer("lighting"); diff --git a/libraries/render-utils/src/DeferredGlobalLight.slh b/libraries/render-utils/src/DeferredGlobalLight.slh index c59c26894c..269827fbef 100755 --- a/libraries/render-utils/src/DeferredGlobalLight.slh +++ b/libraries/render-utils/src/DeferredGlobalLight.slh @@ -17,8 +17,12 @@ uniform samplerCube skyboxMap; vec4 evalSkyboxLight(vec3 direction, float lod) { -// vec4 skytexel = textureCube(skyboxMap, direction); +<@if GPU_TRANSFORM_PROFILE == GPU_CORE@> vec4 skytexel = textureCubeLod(skyboxMap, direction, lod * textureQueryLevels(skyboxMap)); +<@else@> + const int NUM_LEVELS = 10; + vec4 skytexel = textureCubeLod(skyboxMap, direction, lod * NUM_LEVELS); +<@endif@> return skytexel; } @@ -108,12 +112,11 @@ vec3 evalSkyboxGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec4 fragEyeVector = invViewMat * vec4(-position, 0.0); vec3 fragEyeDir = normalize(fragEyeVector.xyz); - // vec3 color = diffuse.rgb * evalSkyboxLight(fragNormal, 0.75).xyz * getLightAmbientIntensity(light); - vec3 color = /*diffuse.rgb * */evalSkyboxLight(fragNormal, getLightAmbientIntensity(light)).xyz; + vec3 color = diffuse.rgb * evalSkyboxLight(fragNormal, 0.75).xyz * getLightAmbientIntensity(light); + + vec4 shading = evalFragShading(fragNormal, -getLightDirection(light), fragEyeDir, specular, gloss); - // vec4 shading = evalFragShading(fragNormal, -getLightDirection(light), fragEyeDir, specular, gloss); - - // color += vec3(diffuse + shading.rgb) * shading.w * shadowAttenuation * getLightColor(light) * getLightIntensity(light); + color += vec3(diffuse + shading.rgb) * shading.w * shadowAttenuation * getLightColor(light) * getLightIntensity(light); return color; }