Browse Source

better description of lights_template. remove double normalize.

Ben Houston 9 years ago
parent
commit
0cf45b80fb

+ 1 - 1
src/renderers/shaders/ShaderChunk/lights_pars.glsl

@@ -146,7 +146,7 @@ uniform vec3 ambientLightColor;
 
 		#endif
 
-		reflectVec = normalize( inverseTransformDirection( reflectVec, viewMatrix ) );
+		reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
 
 		#ifdef ENVMAP_TYPE_CUBE
 

+ 12 - 1
src/renderers/shaders/ShaderChunk/lights_template.glsl

@@ -1,6 +1,17 @@
+//
+// This is a template that can be used to light a material, it uses pluggable RenderEquations (RE)
+//   for specific lighting scenarios.
+//
 // Instructions for use:
-//  - Ensure that both BRDF_Material_DirectLight and BRDF_Material_Indirect light are defined
+//  - Ensure that both Material_RE_DirectLight, Material_RE_IndirectDiffuseLight and Material_RE_IndirectSpecularLight are defined
+//  - If you have defined a Material_RE_IndirectSpecularLight, you need to also provide a Material_LightProbeLOD.
 //  - Create a material parameter that is to be passed as the third parameter to your lighting functions.
+//
+// TODO:
+//  - Add area light support.
+//  - Add sphere light support.
+//  - Add diffuse light probe (irradiance cubemap) support.
+//
 
 GeometricContext geometry = GeometricContext( -vViewPosition, normalize( normal ), normalize(vViewPosition ) );