提交 2f1c268c 编写于 作者: M Mr.doob

Updated builds

上级 35eaf190
......@@ -1904,6 +1904,9 @@
this.depth = source.depth;
this.viewport.copy(source.viewport);
this.texture = source.texture.clone();
this.texture.image = { ...this.texture.image
}; // See #20328.
this.depthBuffer = source.depthBuffer;
this.stencilBuffer = source.stencilBuffer;
this.depthTexture = source.depthTexture;
......@@ -6077,69 +6080,71 @@
let materialId = 0;
function Material() {
Object.defineProperty(this, 'id', {
value: materialId++
});
this.uuid = generateUUID();
this.name = '';
this.type = 'Material';
this.fog = true;
this.blending = NormalBlending;
this.side = FrontSide;
this.vertexColors = false;
this.opacity = 1;
this.transparent = false;
this.blendSrc = SrcAlphaFactor;
this.blendDst = OneMinusSrcAlphaFactor;
this.blendEquation = AddEquation;
this.blendSrcAlpha = null;
this.blendDstAlpha = null;
this.blendEquationAlpha = null;
this.depthFunc = LessEqualDepth;
this.depthTest = true;
this.depthWrite = true;
this.stencilWriteMask = 0xff;
this.stencilFunc = AlwaysStencilFunc;
this.stencilRef = 0;
this.stencilFuncMask = 0xff;
this.stencilFail = KeepStencilOp;
this.stencilZFail = KeepStencilOp;
this.stencilZPass = KeepStencilOp;
this.stencilWrite = false;
this.clippingPlanes = null;
this.clipIntersection = false;
this.clipShadows = false;
this.shadowSide = null;
this.colorWrite = true;
this.precision = null; // override the renderer's default precision for this material
this.polygonOffset = false;
this.polygonOffsetFactor = 0;
this.polygonOffsetUnits = 0;
this.dithering = false;
this.alphaTest = 0;
this.alphaToCoverage = false;
this.premultipliedAlpha = false;
this.visible = true;
this.toneMapped = true;
this.userData = {};
this.version = 0;
}
Material.prototype = Object.assign(Object.create(EventDispatcher.prototype), {
constructor: Material,
isMaterial: true,
onBuild: function ()
class Material extends EventDispatcher {
constructor() {
super();
Object.defineProperty(this, 'id', {
value: materialId++
});
this.uuid = generateUUID();
this.name = '';
this.type = 'Material';
this.fog = true;
this.blending = NormalBlending;
this.side = FrontSide;
this.vertexColors = false;
this.opacity = 1;
this.transparent = false;
this.blendSrc = SrcAlphaFactor;
this.blendDst = OneMinusSrcAlphaFactor;
this.blendEquation = AddEquation;
this.blendSrcAlpha = null;
this.blendDstAlpha = null;
this.blendEquationAlpha = null;
this.depthFunc = LessEqualDepth;
this.depthTest = true;
this.depthWrite = true;
this.stencilWriteMask = 0xff;
this.stencilFunc = AlwaysStencilFunc;
this.stencilRef = 0;
this.stencilFuncMask = 0xff;
this.stencilFail = KeepStencilOp;
this.stencilZFail = KeepStencilOp;
this.stencilZPass = KeepStencilOp;
this.stencilWrite = false;
this.clippingPlanes = null;
this.clipIntersection = false;
this.clipShadows = false;
this.shadowSide = null;
this.colorWrite = true;
this.precision = null; // override the renderer's default precision for this material
this.polygonOffset = false;
this.polygonOffsetFactor = 0;
this.polygonOffsetUnits = 0;
this.dithering = false;
this.alphaTest = 0;
this.alphaToCoverage = false;
this.premultipliedAlpha = false;
this.visible = true;
this.toneMapped = true;
this.userData = {};
this.version = 0;
}
onBuild()
/* shaderobject, renderer */
{},
onBeforeCompile: function ()
{}
onBeforeCompile()
/* shaderobject, renderer */
{},
customProgramCacheKey: function () {
{}
customProgramCacheKey() {
return this.onBeforeCompile.toString();
},
setValues: function (values) {
}
setValues(values) {
if (values === undefined) return;
for (const key in values) {
......@@ -6172,8 +6177,9 @@
this[key] = newValue;
}
}
},
toJSON: function (meta) {
}
toJSON(meta) {
const isRoot = meta === undefined || typeof meta === 'string';
if (isRoot) {
......@@ -6331,11 +6337,13 @@
}
return data;
},
clone: function () {
}
clone() {
return new this.constructor().copy(this);
},
copy: function (source) {
}
copy(source) {
this.name = source.name;
this.fog = source.fog;
this.blending = source.blending;
......@@ -6389,18 +6397,21 @@
this.toneMapped = source.toneMapped;
this.userData = JSON.parse(JSON.stringify(source.userData));
return this;
},
dispose: function () {
}
dispose() {
this.dispatchEvent({
type: 'dispose'
});
}
});
Object.defineProperty(Material.prototype, 'needsUpdate', {
set: function (value) {
set needsUpdate(value) {
if (value === true) this.version++;
}
});
}
Material.prototype.isMaterial = true;
const _colorKeywords = {
'aliceblue': 0xF0F8FF,
......@@ -10077,7 +10088,7 @@
const UniformsLib = {
common: {
diffuse: {
value: new Color(0xeeeeee)
value: new Color(0xffffff)
},
opacity: {
value: 1.0
......@@ -10303,7 +10314,7 @@
},
points: {
diffuse: {
value: new Color(0xeeeeee)
value: new Color(0xffffff)
},
opacity: {
value: 1.0
......@@ -10326,7 +10337,7 @@
},
sprite: {
diffuse: {
value: new Color(0xeeeeee)
value: new Color(0xffffff)
},
opacity: {
value: 1.0
此差异已折叠。
......@@ -2514,6 +2514,7 @@ class WebGLRenderTarget extends EventDispatcher {
this.viewport.copy( source.viewport );
this.texture = source.texture.clone();
this.texture.image = { ...this.texture.image }; // See #20328.
this.depthBuffer = source.depthBuffer;
this.stencilBuffer = source.stencilBuffer;
......@@ -7999,91 +8000,89 @@ class Triangle {
let materialId = 0;
function Material() {
class Material extends EventDispatcher {
Object.defineProperty( this, 'id', { value: materialId ++ } );
this.uuid = generateUUID();
constructor() {
this.name = '';
this.type = 'Material';
super();
this.fog = true;
Object.defineProperty( this, 'id', { value: materialId ++ } );
this.blending = NormalBlending;
this.side = FrontSide;
this.vertexColors = false;
this.uuid = generateUUID();
this.opacity = 1;
this.transparent = false;
this.name = '';
this.type = 'Material';
this.blendSrc = SrcAlphaFactor;
this.blendDst = OneMinusSrcAlphaFactor;
this.blendEquation = AddEquation;
this.blendSrcAlpha = null;
this.blendDstAlpha = null;
this.blendEquationAlpha = null;
this.fog = true;
this.depthFunc = LessEqualDepth;
this.depthTest = true;
this.depthWrite = true;
this.blending = NormalBlending;
this.side = FrontSide;
this.vertexColors = false;
this.stencilWriteMask = 0xff;
this.stencilFunc = AlwaysStencilFunc;
this.stencilRef = 0;
this.stencilFuncMask = 0xff;
this.stencilFail = KeepStencilOp;
this.stencilZFail = KeepStencilOp;
this.stencilZPass = KeepStencilOp;
this.stencilWrite = false;
this.opacity = 1;
this.transparent = false;
this.clippingPlanes = null;
this.clipIntersection = false;
this.clipShadows = false;
this.blendSrc = SrcAlphaFactor;
this.blendDst = OneMinusSrcAlphaFactor;
this.blendEquation = AddEquation;
this.blendSrcAlpha = null;
this.blendDstAlpha = null;
this.blendEquationAlpha = null;
this.shadowSide = null;
this.depthFunc = LessEqualDepth;
this.depthTest = true;
this.depthWrite = true;
this.colorWrite = true;
this.stencilWriteMask = 0xff;
this.stencilFunc = AlwaysStencilFunc;
this.stencilRef = 0;
this.stencilFuncMask = 0xff;
this.stencilFail = KeepStencilOp;
this.stencilZFail = KeepStencilOp;
this.stencilZPass = KeepStencilOp;
this.stencilWrite = false;
this.precision = null; // override the renderer's default precision for this material
this.clippingPlanes = null;
this.clipIntersection = false;
this.clipShadows = false;
this.polygonOffset = false;
this.polygonOffsetFactor = 0;
this.polygonOffsetUnits = 0;
this.shadowSide = null;
this.dithering = false;
this.colorWrite = true;
this.alphaTest = 0;
this.alphaToCoverage = false;
this.premultipliedAlpha = false;
this.precision = null; // override the renderer's default precision for this material
this.visible = true;
this.polygonOffset = false;
this.polygonOffsetFactor = 0;
this.polygonOffsetUnits = 0;
this.toneMapped = true;
this.dithering = false;
this.userData = {};
this.alphaTest = 0;
this.alphaToCoverage = false;
this.premultipliedAlpha = false;
this.version = 0;
this.visible = true;
}
this.toneMapped = true;
Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
this.userData = {};
constructor: Material,
this.version = 0;
isMaterial: true,
}
onBuild: function ( /* shaderobject, renderer */ ) {},
onBuild( /* shaderobject, renderer */ ) {}
onBeforeCompile: function ( /* shaderobject, renderer */ ) {},
onBeforeCompile( /* shaderobject, renderer */ ) {}
customProgramCacheKey: function () {
customProgramCacheKey() {
return this.onBeforeCompile.toString();
},
}
setValues: function ( values ) {
setValues( values ) {
if ( values === undefined ) return;
......@@ -8132,9 +8131,9 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
}
},
}
toJSON: function ( meta ) {
toJSON( meta ) {
const isRoot = ( meta === undefined || typeof meta === 'string' );
......@@ -8348,15 +8347,15 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
return data;
},
}
clone: function () {
clone() {
return new this.constructor().copy( this );
},
}
copy: function ( source ) {
copy( source ) {
this.name = source.name;
......@@ -8433,25 +8432,23 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
return this;
},
}
dispose: function () {
dispose() {
this.dispatchEvent( { type: 'dispose' } );
}
} );
Object.defineProperty( Material.prototype, 'needsUpdate', {
set: function ( value ) {
set needsUpdate( value ) {
if ( value === true ) this.version ++;
}
} );
}
Material.prototype.isMaterial = true;
const _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF,
'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2,
......@@ -13145,7 +13142,7 @@ const UniformsLib = {
common: {
diffuse: { value: new Color( 0xeeeeee ) },
diffuse: { value: new Color( 0xffffff ) },
opacity: { value: 1.0 },
map: { value: null },
......@@ -13322,7 +13319,7 @@ const UniformsLib = {
points: {
diffuse: { value: new Color( 0xeeeeee ) },
diffuse: { value: new Color( 0xffffff ) },
opacity: { value: 1.0 },
size: { value: 1.0 },
scale: { value: 1.0 },
......@@ -13334,7 +13331,7 @@ const UniformsLib = {
sprite: {
diffuse: { value: new Color( 0xeeeeee ) },
diffuse: { value: new Color( 0xffffff ) },
opacity: { value: 1.0 },
center: { value: new Vector2( 0.5, 0.5 ) },
rotation: { value: 0.0 },
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册