mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 09:33:45 +02:00
debugging the new global light pass
This commit is contained in:
parent
1b22a3ef36
commit
bdf9164c7b
3 changed files with 9 additions and 6 deletions
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue