|
@@ -29391,7 +29391,8 @@
|
|
|
*
|
|
|
* bevelEnabled: <bool>, // turn on bevel
|
|
|
* bevelThickness: <float>, // how deep into the original shape bevel goes
|
|
|
- * bevelSize: <float>, // how far from shape outline is bevel
|
|
|
+ * bevelSize: <float>, // how far from shape outline (including bevelOffset) is bevel
|
|
|
+ * bevelOffset: <float>, // how far from shape outline does bevel start
|
|
|
* bevelSegments: <int>, // number of bevel layers
|
|
|
*
|
|
|
* extrudePath: <THREE.Curve> // curve to extrude shape along
|
|
@@ -29482,6 +29483,7 @@
|
|
|
var bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true;
|
|
|
var bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 6;
|
|
|
var bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 2;
|
|
|
+ var bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0;
|
|
|
var bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3;
|
|
|
|
|
|
var extrudePath = options.extrudePath;
|
|
@@ -29530,6 +29532,7 @@
|
|
|
bevelSegments = 0;
|
|
|
bevelThickness = 0;
|
|
|
bevelSize = 0;
|
|
|
+ bevelOffset = 0;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -29766,7 +29769,7 @@
|
|
|
|
|
|
t = b / bevelSegments;
|
|
|
z = bevelThickness * Math.cos( t * Math.PI / 2 );
|
|
|
- bs = bevelSize * Math.sin( t * Math.PI / 2 );
|
|
|
+ bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset;
|
|
|
|
|
|
// contract shape
|
|
|
|
|
@@ -29797,7 +29800,7 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
- bs = bevelSize;
|
|
|
+ bs = bevelSize + bevelOffset;
|
|
|
|
|
|
// Back facing vertices
|
|
|
|
|
@@ -29864,7 +29867,7 @@
|
|
|
|
|
|
t = b / bevelSegments;
|
|
|
z = bevelThickness * Math.cos( t * Math.PI / 2 );
|
|
|
- bs = bevelSize * Math.sin( t * Math.PI / 2 );
|
|
|
+ bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset;
|
|
|
|
|
|
// contract shape
|
|
|
|
|
@@ -30216,7 +30219,8 @@
|
|
|
*
|
|
|
* bevelEnabled: <bool>, // turn on bevel
|
|
|
* bevelThickness: <float>, // how deep into text bevel goes
|
|
|
- * bevelSize: <float> // how far from text outline is bevel
|
|
|
+ * bevelSize: <float>, // how far from text outline (including bevelOffset) is bevel
|
|
|
+ * bevelOffset: <float> // how far from text outline does bevel start
|
|
|
* }
|
|
|
*/
|
|
|
|
|
@@ -40414,6 +40418,96 @@
|
|
|
|
|
|
} );
|
|
|
|
|
|
+ /**
|
|
|
+ * @author WestLangley / http://github.com/WestLangley
|
|
|
+ */
|
|
|
+
|
|
|
+ function HemisphereLightProbe( skyColor, groundColor, intensity ) {
|
|
|
+
|
|
|
+ LightProbe.call( this, undefined, intensity );
|
|
|
+
|
|
|
+ var color1 = new Color().set( skyColor );
|
|
|
+ var color2 = new Color().set( groundColor );
|
|
|
+
|
|
|
+ var sky = new Vector3( color1.r, color1.g, color1.b );
|
|
|
+ var ground = new Vector3( color2.r, color2.g, color2.b );
|
|
|
+
|
|
|
+ // without extra factor of PI in the shader, should = 1 / Math.sqrt( Math.PI );
|
|
|
+ var c0 = Math.sqrt( Math.PI );
|
|
|
+ var c1 = c0 * Math.sqrt( 0.75 );
|
|
|
+
|
|
|
+ this.sh.coefficients[ 0 ].copy( sky ).add( ground ).multiplyScalar( c0 );
|
|
|
+ this.sh.coefficients[ 1 ].copy( sky ).sub( ground ).multiplyScalar( c1 );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ HemisphereLightProbe.prototype = Object.assign( Object.create( LightProbe.prototype ), {
|
|
|
+
|
|
|
+ constructor: HemisphereLightProbe,
|
|
|
+
|
|
|
+ isHemisphereLightProbe: true,
|
|
|
+
|
|
|
+ copy: function ( source ) { // modifying colors not currently supported
|
|
|
+
|
|
|
+ LightProbe.prototype.copy.call( this, source );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ toJSON: function ( meta ) {
|
|
|
+
|
|
|
+ var data = LightProbe.prototype.toJSON.call( this, meta );
|
|
|
+
|
|
|
+ // data.sh = this.sh.toArray(); // todo
|
|
|
+
|
|
|
+ return data;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ } );
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @author WestLangley / http://github.com/WestLangley
|
|
|
+ */
|
|
|
+
|
|
|
+ function AmbientLightProbe( color, intensity ) {
|
|
|
+
|
|
|
+ LightProbe.call( this, undefined, intensity );
|
|
|
+
|
|
|
+ var color1 = new Color().set( color );
|
|
|
+
|
|
|
+ // without extra factor of PI in the shader, would be 2 / Math.sqrt( Math.PI );
|
|
|
+ this.sh.coefficients[ 0 ].set( color1.r, color1.g, color1.b ).multiplyScalar( 2 * Math.sqrt( Math.PI ) );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ AmbientLightProbe.prototype = Object.assign( Object.create( LightProbe.prototype ), {
|
|
|
+
|
|
|
+ constructor: AmbientLightProbe,
|
|
|
+
|
|
|
+ isAmbientLightProbe: true,
|
|
|
+
|
|
|
+ copy: function ( source ) { // modifying color not currently supported
|
|
|
+
|
|
|
+ LightProbe.prototype.copy.call( this, source );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ toJSON: function ( meta ) {
|
|
|
+
|
|
|
+ var data = LightProbe.prototype.toJSON.call( this, meta );
|
|
|
+
|
|
|
+ // data.sh = this.sh.toArray(); // todo
|
|
|
+
|
|
|
+ return data;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ } );
|
|
|
+
|
|
|
/**
|
|
|
* @author mrdoob / http://mrdoob.com/
|
|
|
*/
|
|
@@ -45519,7 +45613,7 @@
|
|
|
|
|
|
'}',
|
|
|
|
|
|
- ].join( '\n' ),
|
|
|
+ ].join( '\n' ),
|
|
|
|
|
|
fragmentShader: [
|
|
|
|
|
@@ -45595,7 +45689,7 @@
|
|
|
|
|
|
'}'
|
|
|
|
|
|
- ].join( '\n' )
|
|
|
+ ].join( '\n' )
|
|
|
|
|
|
} );
|
|
|
|
|
@@ -48592,9 +48686,11 @@
|
|
|
exports.PointLight = PointLight;
|
|
|
exports.RectAreaLight = RectAreaLight;
|
|
|
exports.HemisphereLight = HemisphereLight;
|
|
|
+ exports.HemisphereLightProbe = HemisphereLightProbe;
|
|
|
exports.DirectionalLightShadow = DirectionalLightShadow;
|
|
|
exports.DirectionalLight = DirectionalLight;
|
|
|
exports.AmbientLight = AmbientLight;
|
|
|
+ exports.AmbientLightProbe = AmbientLightProbe;
|
|
|
exports.LightShadow = LightShadow;
|
|
|
exports.Light = Light;
|
|
|
exports.LightProbe = LightProbe;
|