KEep exploring the ambient lighting

This commit is contained in:
Sam Cake 2017-03-19 17:00:42 -07:00
parent 8b8f9d7b1a
commit 8584d80bb8
2 changed files with 5 additions and 10 deletions

View file

@ -77,18 +77,13 @@ void evalLightingAmbient(out vec3 diffuse, out vec3 specular, LightAmbient ambie
// Diffuse from ambient // Diffuse from ambient
diffuse = (1.0 - metallic) * sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), normal).xyz; diffuse = (1.0 - metallic) * sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), normal).xyz;
if (gl_FragCoord.x > 1000) { if (gl_FragCoord.x > 300) {
vec3 ambientFresnel = vec3 (1.0) - fresnelSchlickAmbient(fresnel, eyeDir, normal, 1.0 - roughness); vec3 ambientFresnelDiffuse = vec3 (1.0) - fresnelSchlickAmbient(fresnel, eyeDir, normal, 1.0 - roughness);
diffuse *= ambientFresnel * (1.0 / 3.14); diffuse *= ambientFresnelDiffuse;
if (gl_FragCoord.x > 2000) {
diffuse *= obscurance;
}
} }
// Specular highlight from ambient // Specular highlight from ambient
specular = evalAmbientSpecularIrradiance(ambient, eyeDir, normal, roughness, fresnel) * obscurance * getLightAmbientIntensity(ambient); specular = evalAmbientSpecularIrradiance(ambient, eyeDir, normal, roughness, fresnel);
<@if supportScattering@> <@if supportScattering@>

View file

@ -307,7 +307,7 @@ void initForwardPipelines(render::ShapePlumber& plumber) {
void addPlumberPipeline(ShapePlumber& plumber, void addPlumberPipeline(ShapePlumber& plumber,
const ShapeKey& key, const gpu::ShaderPointer& vertex, const gpu::ShaderPointer& pixel) { const ShapeKey& key, const gpu::ShaderPointer& vertex, const gpu::ShaderPointer& pixel) {
// These key-values' pipelines are added by this functor in addition to the key passed // These key-values' pipelines are added by this functor in addition to the key passed
assert(!key.isWireFrame()); assert(!key.isWireframe());
assert(!key.isDepthBiased()); assert(!key.isDepthBiased());
assert(key.isCullFace()); assert(key.isCullFace());