123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- /**
- * @author mr.doob / http://mrdoob.com/
- * @author alteredq / http://alteredqualia.com/
- */
- THREE.Material = function () {
- this.id = THREE.MaterialCount ++;
- this.name = '';
- this.side = THREE.FrontSide;
- this.opacity = 1;
- this.transparent = false;
- this.blending = THREE.NormalBlending;
- this.blendSrc = THREE.SrcAlphaFactor;
- this.blendDst = THREE.OneMinusSrcAlphaFactor;
- this.blendEquation = THREE.AddEquation;
- this.depthTest = true;
- this.depthWrite = true;
- this.polygonOffset = false;
- this.polygonOffsetFactor = 0;
- this.polygonOffsetUnits = 0;
- this.alphaTest = 0;
- this.overdraw = false; // Boolean for fixing antialiasing gaps in CanvasRenderer
- this.visible = true;
- this.needsUpdate = true;
- };
- THREE.Material.prototype.setValues = function ( values ) {
- if ( values === undefined ) return;
- for ( var key in values ) {
- if ( this[ key ] !== undefined ) {
- this[ key ] = values[ key ];
- }
- }
- };
- THREE.Material.prototype.clone = function ( material ) {
- if ( material === undefined ) material = new THREE.material()
- material.name = this.name;
- material.side = this.side;
- material.opacity = this.opacity;
- material.transparent = this.transparent;
- material.blending = this.blending;
- material.blendSrc = this.blendSrc;
- material.blendDst = this.blendDst;
- material.blendEquation = this.blendEquation;
- material.depthTest = this.depthTest;
- material.depthWrite = this.depthWrite;
- material.polygonOffset = this.polygonOffset;
- material.polygonOffsetFactor = this.polygonOffsetFactor;
- material.polygonOffsetUnits = this.polygonOffsetUnits;
- material.alphaTest = this.alphaTest;
- material.overdraw = this.overdraw;
- material.visible = this.visible;
- return material;
- };
- THREE.MaterialCount = 0;
|