Skip to content

Commit

Permalink
moving rectarealight brdf data to an example file. rest of implementa…
Browse files Browse the repository at this point in the history
…tion left in place
  • Loading branch information
abelnation committed Jul 21, 2016
1 parent 5af26a2 commit cfd1a21
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 34 deletions.
133 changes: 133 additions & 0 deletions examples/js/lights/RectAreaLightUniformsLib.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions examples/webgl_lights_rectarealight.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
</div>

<script src="../build/three.min.js"></script>
<script src="js/lights/RectAreaLightUniformsLib.js"></script>

<script src="../examples/js/libs/dat.gui.min.js"></script>
<script src="../examples/js/controls/OrbitControls.js"></script>
<script src="js/Detector.js"></script>
Expand Down
5 changes: 5 additions & 0 deletions src/lights/RectAreaLight.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ THREE.RectAreaLight = function ( color, intensity, width, height ) {
this.width = ( width !== undefined ) ? width : 10;
this.height = ( height !== undefined ) ? height : 10;

// TODO (abelnation): remove this warning when RectAreaLight is fully included in build files
if (THREE.UniformsLib['ltc_brdf'] == undefined) {
console.warn( 'RectAreaLight will not function properly without including examples/js/lights/RectAreaLightUniformsLib.js' );
}

// TODO (abelnation): distance/decay

};
Expand Down
4 changes: 2 additions & 2 deletions src/renderers/shaders/ShaderLib.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ THREE.ShaderLib = {
THREE.UniformsLib[ 'normalmap' ],
THREE.UniformsLib[ 'displacementmap' ],
THREE.UniformsLib[ 'fog' ],
THREE.UniformsLib[ 'ltc_brdf' ],
// TODO (abelnation): include LTC brdf data
THREE.UniformsLib[ 'lights' ],

{
Expand Down Expand Up @@ -88,8 +88,8 @@ THREE.ShaderLib = {
THREE.UniformsLib[ 'roughnessmap' ],
THREE.UniformsLib[ 'metalnessmap' ],
THREE.UniformsLib[ 'fog' ],
// TODO (abelnation): include LTC brdf data
THREE.UniformsLib[ 'lights' ],
THREE.UniformsLib[ 'ltc_brdf' ],

{
"emissive" : { value: new THREE.Color( 0x000000 ) },
Expand Down
33 changes: 1 addition & 32 deletions src/renderers/shaders/UniformsLib.js

Large diffs are not rendered by default.

0 comments on commit cfd1a21

Please sign in to comment.