|
@@ -1,17 +1,28 @@
|
|
|
vec3 viewDir = normalize( vViewPosition );
|
|
|
|
|
|
-ReflectedLight directReflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ) );
|
|
|
-ReflectedLight indirectReflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ) );
|
|
|
-
|
|
|
vec3 diffuse = diffuseColor.rgb;
|
|
|
|
|
|
#ifdef METAL
|
|
|
|
|
|
- diffuse *= specular;
|
|
|
+ diffuse = vec3( 0.0 );
|
|
|
+
|
|
|
+#endif
|
|
|
+
|
|
|
+#define ENERGY_PRESERVING_MONOCHROME
|
|
|
+
|
|
|
+#ifdef ENERGY_PRESERVING_RGB
|
|
|
+
|
|
|
+ diffuse *= whiteCompliment( specular );
|
|
|
+
|
|
|
+#elif defined( ENERGY_PRESERVING_MONOCHROME )
|
|
|
+
|
|
|
+ diffuse *= whiteCompliment( luminance( specular ) );
|
|
|
|
|
|
#endif
|
|
|
|
|
|
IncidentLight incidentLight;
|
|
|
+ReflectedLight directReflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ) );
|
|
|
+ReflectedLight indirectReflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ) );
|
|
|
|
|
|
#if MAX_POINT_LIGHTS > 0
|
|
|
|
|
@@ -20,10 +31,10 @@ IncidentLight incidentLight;
|
|
|
getPointIncidentLight( pointLights[ i ], -vViewPosition, incidentLight );
|
|
|
|
|
|
BRDF_Lambert( incidentLight, normal, diffuse, directReflectedLight );
|
|
|
+ //BRDF_OrenNayar( incidentLight, normal, viewDir, diffuse, 0.5, directReflectedLight );
|
|
|
|
|
|
BRDF_BlinnPhong( incidentLight, normal, viewDir, specular, shininess, directReflectedLight );
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
#endif
|
|
@@ -32,9 +43,10 @@ IncidentLight incidentLight;
|
|
|
|
|
|
for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {
|
|
|
|
|
|
- getSpotLightDirect( spotLights[ i ], -vViewPosition, incidentLight );
|
|
|
+ getSpotIncidentLight( spotLights[ i ], -vViewPosition, incidentLight );
|
|
|
|
|
|
BRDF_Lambert( incidentLight, normal, diffuse, directReflectedLight );
|
|
|
+ //BRDF_OrenNayar( incidentLight, normal, viewDir, diffuse, 0.5, directReflectedLight );
|
|
|
|
|
|
BRDF_BlinnPhong( incidentLight, normal, viewDir, specular, shininess, directReflectedLight );
|
|
|
|
|
@@ -49,6 +61,7 @@ IncidentLight incidentLight;
|
|
|
getDirIncidentLight( directionalLights[ i ], incidentLight );
|
|
|
|
|
|
BRDF_Lambert( incidentLight, normal, diffuse, directReflectedLight );
|
|
|
+ //BRDF_OrenNayar( incidentLight, normal, viewDir, diffuse, 0.5, directReflectedLight );
|
|
|
|
|
|
BRDF_BlinnPhong( incidentLight, normal, viewDir, specular, shininess, directReflectedLight );
|
|
|
|
|
@@ -63,6 +76,7 @@ IncidentLight incidentLight;
|
|
|
getHemisphereIncidentLight( hemisphereLights[ i ], normal, incidentLight );
|
|
|
|
|
|
BRDF_Lambert( incidentLight, normal, diffuse, indirectReflectedLight );
|
|
|
+ //BRDF_OrenNayar( incidentLight, normal, viewDir, diffuse, 0.5, indirectReflectedLight );
|
|
|
|
|
|
}
|
|
|
|