Skip to content

Commit 1d3b7f2

Browse files
committed
Updated builds.
1 parent 449d18a commit 1d3b7f2

File tree

2 files changed

+615
-604
lines changed

2 files changed

+615
-604
lines changed

build/three.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4962,7 +4962,7 @@
49624962

49634963
var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n";
49644964

4965-
var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n#endif\n";
4965+
var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n";
49664966

49674967
var clipping_planes_pars_fragment = "#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n";
49684968

@@ -7200,6 +7200,7 @@
72007200
this.depthWrite = true;
72017201

72027202
this.clippingPlanes = null;
7203+
this.clipIntersection = false;
72037204
this.clipShadows = false;
72047205

72057206
this.colorWrite = true;
@@ -7463,6 +7464,7 @@
74637464

74647465
this.visible = source.visible;
74657466
this.clipShadows = source.clipShadows;
7467+
this.clipIntersection = source.clipIntersection;
74667468

74677469
var srcPlanes = source.clippingPlanes,
74687470
dstPlanes = null;
@@ -16406,6 +16408,7 @@
1640616408
parameters.flipSided ? '#define FLIP_SIDED' : '',
1640716409

1640816410
'#define NUM_CLIPPING_PLANES ' + parameters.numClippingPlanes,
16411+
'#define UNION_CLIPPING_PLANES ' + (parameters.numClippingPlanes - parameters.numClipIntersection),
1640916412

1641016413
parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
1641116414
parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '',
@@ -16645,7 +16648,7 @@
1664516648
"maxMorphTargets", "maxMorphNormals", "premultipliedAlpha",
1664616649
"numDirLights", "numPointLights", "numSpotLights", "numHemiLights",
1664716650
"shadowMapEnabled", "shadowMapType", "toneMapping", 'physicallyCorrectLights',
16648-
"alphaTest", "doubleSided", "flipSided", "numClippingPlanes", "depthPacking"
16651+
"alphaTest", "doubleSided", "flipSided", "numClippingPlanes", "numClipIntersection", "depthPacking"
1664916652
];
1665016653

1665116654

@@ -16717,7 +16720,7 @@
1671716720

1671816721
}
1671916722

16720-
this.getParameters = function ( material, lights, fog, nClipPlanes, object ) {
16723+
this.getParameters = function ( material, lights, fog, nClipPlanes, nClipIntersection, object ) {
1672116724

1672216725
var shaderID = shaderIDs[ material.type ];
1672316726

@@ -16794,6 +16797,7 @@
1679416797
numHemiLights: lights.hemi.length,
1679516798

1679616799
numClippingPlanes: nClipPlanes,
16800+
numClipIntersection: nClipIntersection,
1679716801

1679816802
shadowMapEnabled: renderer.shadowMap.enabled && object.receiveShadow && lights.shadows.length > 0,
1679916803
shadowMapType: renderer.shadowMap.type,
@@ -19205,6 +19209,7 @@
1920519209

1920619210
this.uniform = uniform;
1920719211
this.numPlanes = 0;
19212+
this.numIntersection = 0;
1920819213

1920919214
this.init = function( planes, enableLocalClipping, camera ) {
1921019215

@@ -19239,7 +19244,7 @@
1923919244

1924019245
};
1924119246

19242-
this.setState = function( planes, clipShadows, camera, cache, fromCache ) {
19247+
this.setState = function( planes, clipIntersection, clipShadows, camera, cache, fromCache ) {
1924319248

1924419249
if ( ! localClippingEnabled ||
1924519250
planes === null || planes.length === 0 ||
@@ -19274,6 +19279,7 @@
1927419279
}
1927519280

1927619281
cache.clippingState = dstArray;
19282+
this.numIntersection = clipIntersection ? this.numPlanes : 0;
1927719283
this.numPlanes += nGlobal;
1927819284

1927919285
}
@@ -19291,6 +19297,7 @@
1929119297
}
1929219298

1929319299
scope.numPlanes = numGlobalPlanes;
19300+
scope.numIntersection = 0;
1929419301

1929519302
}
1929619303

@@ -19335,6 +19342,7 @@
1933519342
}
1933619343

1933719344
scope.numPlanes = nPlanes;
19345+
1933819346
return dstArray;
1933919347

1934019348
}
@@ -20851,7 +20859,7 @@
2085120859
var materialProperties = properties.get( material );
2085220860

2085320861
var parameters = programCache.getParameters(
20854-
material, _lights, fog, _clipping.numPlanes, object );
20862+
material, _lights, fog, _clipping.numPlanes, _clipping.numIntersection, object );
2085520863

2085620864
var code = programCache.getProgramCode( material, parameters );
2085720865

@@ -20954,6 +20962,7 @@
2095420962
material.clipping === true ) {
2095520963

2095620964
materialProperties.numClippingPlanes = _clipping.numPlanes;
20965+
materialProperties.numIntersection = _clipping.numIntersection;
2095720966
uniforms.clippingPlanes = _clipping.uniform;
2095820967

2095920968
}
@@ -21029,7 +21038,7 @@
2102921038
// object instead of the material, once it becomes feasible
2103021039
// (#8465, #8379)
2103121040
_clipping.setState(
21032-
material.clippingPlanes, material.clipShadows,
21041+
material.clippingPlanes, material.clipIntersection, material.clipShadows,
2103321042
camera, materialProperties, useCache );
2103421043

2103521044
}
@@ -21051,7 +21060,8 @@
2105121060
material.needsUpdate = true;
2105221061

2105321062
} else if ( materialProperties.numClippingPlanes !== undefined &&
21054-
materialProperties.numClippingPlanes !== _clipping.numPlanes ) {
21063+
( materialProperties.numClippingPlanes !== _clipping.numPlanes ||
21064+
materialProperties.numIntersection !== _clipping.numIntersection ) ) {
2105521065

2105621066
material.needsUpdate = true;
2105721067

0 commit comments

Comments
 (0)