From 0cf45b80fb867b1a150ae38b3d10024392f10a9f Mon Sep 17 00:00:00 2001 From: Ben Houston Date: Wed, 21 Oct 2015 20:00:13 -0400 Subject: [PATCH] better description of lights_template. remove double normalize. --- src/renderers/shaders/ShaderChunk/lights_pars.glsl | 2 +- .../shaders/ShaderChunk/lights_template.glsl | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/renderers/shaders/ShaderChunk/lights_pars.glsl b/src/renderers/shaders/ShaderChunk/lights_pars.glsl index f3873a882f..50fe62c515 100644 --- a/src/renderers/shaders/ShaderChunk/lights_pars.glsl +++ b/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 diff --git a/src/renderers/shaders/ShaderChunk/lights_template.glsl b/src/renderers/shaders/ShaderChunk/lights_template.glsl index 5bdb862916..168fb6192e 100644 --- a/src/renderers/shaders/ShaderChunk/lights_template.glsl +++ b/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 ) ); -- GitLab