mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
clean up for pr
This commit is contained in:
parent
45e70c98f8
commit
f2c4e04a5a
2 changed files with 10 additions and 7 deletions
|
@ -3330,7 +3330,7 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs
|
|||
auto skyStage = DependencyManager::get<SceneScriptingInterface>()->getSkyStage();
|
||||
DependencyManager::get<DeferredLightingEffect>()->setGlobalLight(skyStage->getSunLight()->getDirection(), skyStage->getSunLight()->getColor(), skyStage->getSunLight()->getIntensity(), skyStage->getSunLight()->getAmbientIntensity());
|
||||
DependencyManager::get<DeferredLightingEffect>()->setGlobalAtmosphere(skyStage->getAtmosphere());
|
||||
DependencyManager::get<DeferredLightingEffect>()->setGlobalSkybox(skybox);
|
||||
// NOt yet DependencyManager::get<DeferredLightingEffect>()->setGlobalSkybox(skybox);
|
||||
|
||||
PROFILE_RANGE("DeferredLighting");
|
||||
PerformanceTimer perfTimer("lighting");
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue