Skip to content

Commit

Permalink
WebGLRenderer: MAX_SHADOWS to NUM_SHADOWS renaming.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Nov 5, 2015
1 parent 0f14e3c commit 4099b1b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/shadowmap_fragment.glsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifdef USE_SHADOWMAP

for ( int i = 0; i < MAX_SHADOWS; i ++ ) {
for ( int i = 0; i < NUM_SHADOWS; i ++ ) {

float texelSizeY = 1.0 / shadowMapSize[ i ].y;

Expand Down
10 changes: 5 additions & 5 deletions src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifdef USE_SHADOWMAP

uniform sampler2D shadowMap[ MAX_SHADOWS ];
uniform vec2 shadowMapSize[ MAX_SHADOWS ];
uniform sampler2D shadowMap[ NUM_SHADOWS ];
uniform vec2 shadowMapSize[ NUM_SHADOWS ];

uniform float shadowDarkness[ MAX_SHADOWS ];
uniform float shadowBias[ MAX_SHADOWS ];
uniform float shadowDarkness[ NUM_SHADOWS ];
uniform float shadowBias[ NUM_SHADOWS ];

varying vec4 vShadowCoord[ MAX_SHADOWS ];
varying vec4 vShadowCoord[ NUM_SHADOWS ];

float unpackDepth( const in vec4 rgba_depth ) {

Expand Down
6 changes: 3 additions & 3 deletions src/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifdef USE_SHADOWMAP

uniform float shadowDarkness[ MAX_SHADOWS ];
uniform mat4 shadowMatrix[ MAX_SHADOWS ];
varying vec4 vShadowCoord[ MAX_SHADOWS ];
uniform float shadowDarkness[ NUM_SHADOWS ];
uniform mat4 shadowMatrix[ NUM_SHADOWS ];
varying vec4 vShadowCoord[ NUM_SHADOWS ];

#endif
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifdef USE_SHADOWMAP

for ( int i = 0; i < MAX_SHADOWS; i ++ ) {
for ( int i = 0; i < NUM_SHADOWS; i ++ ) {

vShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;

Expand Down
4 changes: 2 additions & 2 deletions src/renderers/webgl/WebGLProgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ THREE.WebGLProgram = ( function () {
'#define NUM_SPOT_LIGHTS ' + parameters.numSpotLights,
'#define NUM_HEMI_LIGHTS ' + parameters.numHemiLights,

'#define MAX_SHADOWS ' + parameters.maxShadows,
'#define NUM_SHADOWS ' + parameters.numShadows,

'#define MAX_BONES ' + parameters.maxBones,

Expand Down Expand Up @@ -361,7 +361,7 @@ THREE.WebGLProgram = ( function () {
'#define NUM_SPOT_LIGHTS ' + parameters.numSpotLights,
'#define NUM_HEMI_LIGHTS ' + parameters.numHemiLights,

'#define MAX_SHADOWS ' + parameters.maxShadows,
'#define NUM_SHADOWS ' + parameters.numShadows,

parameters.alphaTest ? '#define ALPHATEST ' + parameters.alphaTest : '',

Expand Down
4 changes: 2 additions & 2 deletions src/renderers/webgl/WebGLPrograms.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
"flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning",
"maxBones", "useVertexTexture", "morphTargets", "morphNormals",
"maxMorphTargets", "maxMorphNormals", "numDirLights", "numPointLights",
"numSpotLights", "numHemiLights", "maxShadows", "shadowMapEnabled", "pointLightShadows",
"numSpotLights", "numHemiLights", "numShadows", "shadowMapEnabled", "pointLightShadows",
"shadowMapType", "shadowMapDebug", "alphaTest", "doubleSided",
"flipSided"
];
Expand Down Expand Up @@ -136,7 +136,7 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
numSpotLights: lights.spot.length,
numHemiLights: lights.hemi.length,

maxShadows: lights.shadows.length,
numShadows: lights.shadows.length,
pointLightShadows: lights.shadowsPointLight,

shadowMapEnabled: renderer.shadowMap.enabled && object.receiveShadow && lights.shadows.length > 0,
Expand Down

0 comments on commit 4099b1b

Please sign in to comment.