debugging the new global light pass

This commit is contained in:
Sam Gateau 2015-02-06 16:30:07 -08:00
parent 1b22a3ef36
commit bdf9164c7b
3 changed files with 9 additions and 6 deletions

View file

@ -2809,7 +2809,7 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs
{
DependencyManager::get<DeferredLightingEffect>()->setAmbientLightMode(getRenderAmbientLight());
DependencyManager::get<DeferredLightingEffect>()->setGlobalLight(getSunDirection(), GLOBAL_LIGHT_COLOR, GLOBAL_LIGHT_INTENSITY);
DependencyManager::get<DeferredLightingEffect>()->setGlobalLight(-getSunDirection(), GLOBAL_LIGHT_COLOR, GLOBAL_LIGHT_INTENSITY);
PROFILE_RANGE("DeferredLighting");
PerformanceTimer perfTimer("lighting");
DependencyManager::get<DeferredLightingEffect>()->render();

View file

@ -76,8 +76,11 @@ bool Texture::Storage::allocateMip(uint16 level) {
bool Texture::Storage::assignMipData(uint16 level, const Element& format, Size size, const Byte* bytes) {
// Ok we should be able to do that...
allocateMip(level);
_mips[level]->_format = format;
Size allocated = _mips[level]->_sysmem.setData(size, bytes);
auto mip = _mips[level];
mip->_format = format;
Size allocated = mip->_sysmem.setData(size, bytes);
mip->_isGPULoaded = false;
return allocated == size;
}

View file

@ -63,9 +63,9 @@ vec3 evalAmbienGlobalColor(float shadowAttenuation, vec3 position, vec3 normal,
vec4 fragEyeVector = invViewMat * vec4(-position, 0.0);
vec3 fragEyeDir = normalize(fragEyeVector.xyz);
vec3 color = diffuse.rgb * getLightColor(light) * getLightIntensity(light);
vec3 color = diffuse.rgb * getLightColor(light) * 0.5;
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);
@ -81,7 +81,7 @@ vec3 evalAmbienSphereGlobalColor(float shadowAttenuation, vec3 position, vec3 no
vec3 color = diffuse.rgb * 0.5 * evalSphericalLight(ambientSphere, fragNormal).xyz;
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);