diff --git a/libraries/render-utils/src/DeferredBufferWrite.slh b/libraries/render-utils/src/DeferredBufferWrite.slh index 0538b01fac..ea14830de2 100755 --- a/libraries/render-utils/src/DeferredBufferWrite.slh +++ b/libraries/render-utils/src/DeferredBufferWrite.slh @@ -43,8 +43,12 @@ void packDeferredFragment(vec3 normal, float alpha, vec3 diffuse, vec3 specular, discard; } gl_FragData[0] = vec4(diffuse.rgb, alpha); - gl_FragData[1] = vec4(bestFitNormal(normal), 1.0); - gl_FragData[2] = vec4(specular, shininess / 128.0); + if ( gl_FragCoord.x > 1024) { + gl_FragData[1] = vec4(normal * 0.5 + vec3(0.5), 1.0); + } else { + gl_FragData[1] = vec4(bestFitNormal(normal), 1.0); + } + gl_FragData[2] = vec4(specular, shininess / 100.0); } void packDeferredFragmentLightmap(vec3 normal, float alpha, vec3 diffuse, vec3 specular, float shininess, vec3 emissive) { diff --git a/libraries/render-utils/src/DeferredGlobalLight.slh b/libraries/render-utils/src/DeferredGlobalLight.slh index debad16e9b..ab423bc449 100755 --- a/libraries/render-utils/src/DeferredGlobalLight.slh +++ b/libraries/render-utils/src/DeferredGlobalLight.slh @@ -118,7 +118,10 @@ vec3 evalSkyboxGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 reflectedDir = reflect(-fragEyeDir, fragNormal); vec3 skyTexel = evalSkyboxLight(reflectedDir, 1 - gloss).xyz; - vec3 color = ambient + vec3(diffuse + shading.rgb) * shading.w * shadowAttenuation * skyTexel * getLightColor(light) * getLightIntensity(light); + // vec3 lightIrradiance = (skyTexel * (gloss) + (1 - gloss) * getLightColor(light)) * getLightIntensity(light); + vec3 lightIrradiance = (getLightColor(light)) * getLightIntensity(light); + + vec3 color = ambient + vec3(diffuse + shading.rgb * skyTexel) * shading.w * shadowAttenuation * lightIrradiance; return color; }