Skip to content

Commit

Permalink
Merge branch 'dev-es6-materials' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
linbingquan committed Feb 12, 2021
2 parents 8000053 + 6268611 commit 0159c04
Show file tree
Hide file tree
Showing 24 changed files with 1,074 additions and 1,072 deletions.
169 changes: 85 additions & 84 deletions examples/jsm/lines/LineMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,178 +247,179 @@ ShaderLib[ 'line' ] = {
`
};

var LineMaterial = function ( parameters ) {
class LineMaterial extends ShaderMaterial {

ShaderMaterial.call( this, {
constructor( parameters ) {

type: 'LineMaterial',
super( {

uniforms: UniformsUtils.clone( ShaderLib[ 'line' ].uniforms ),
type: 'LineMaterial',

vertexShader: ShaderLib[ 'line' ].vertexShader,
fragmentShader: ShaderLib[ 'line' ].fragmentShader,
uniforms: UniformsUtils.clone( ShaderLib[ 'line' ].uniforms ),

clipping: true // required for clipping support
vertexShader: ShaderLib[ 'line' ].vertexShader,
fragmentShader: ShaderLib[ 'line' ].fragmentShader,

} );
clipping: true // required for clipping support

this.dashed = false;
} );

Object.defineProperties( this, {
this.dashed = false;

color: {
Object.defineProperty( this, 'isLineMaterial', { value: true } );

enumerable: true,
Object.defineProperties( this, {

get: function () {
color: {

return this.uniforms.diffuse.value;
enumerable: true,

},

set: function ( value ) {
get: function () {

this.uniforms.diffuse.value = value;

}
return this.uniforms.diffuse.value;

},
},

linewidth: {
set: function ( value ) {

enumerable: true,
this.uniforms.diffuse.value = value;

get: function () {

return this.uniforms.linewidth.value;
}

},

set: function ( value ) {
linewidth: {

this.uniforms.linewidth.value = value;
enumerable: true,

}
get: function () {

},
return this.uniforms.linewidth.value;

dashScale: {
},

enumerable: true,
set: function ( value ) {

get: function () {
this.uniforms.linewidth.value = value;

return this.uniforms.dashScale.value;
}

},

set: function ( value ) {
dashScale: {

this.uniforms.dashScale.value = value;
enumerable: true,

}
get: function () {

},
return this.uniforms.dashScale.value;

dashSize: {
},

enumerable: true,
set: function ( value ) {

get: function () {
this.uniforms.dashScale.value = value;

return this.uniforms.dashSize.value;
}

},

set: function ( value ) {
dashSize: {

this.uniforms.dashSize.value = value;
enumerable: true,

}
get: function () {

},
return this.uniforms.dashSize.value;

dashOffset: {
},

enumerable: true,
set: function ( value ) {

get: function () {
this.uniforms.dashSize.value = value;

return this.uniforms.dashOffset.value;
}

},

set: function ( value ) {
dashOffset: {

this.uniforms.dashOffset.value = value;
enumerable: true,

}
get: function () {

},
return this.uniforms.dashOffset.value;

gapSize: {
},

enumerable: true,
set: function ( value ) {

get: function () {
this.uniforms.dashOffset.value = value;

return this.uniforms.gapSize.value;
}

},

set: function ( value ) {
gapSize: {

this.uniforms.gapSize.value = value;
enumerable: true,

}
get: function () {

},
return this.uniforms.gapSize.value;

opacity: {
},

enumerable: true,
set: function ( value ) {

get: function () {
this.uniforms.gapSize.value = value;

return this.uniforms.opacity.value;
}

},

set: function ( value ) {
opacity: {

this.uniforms.opacity.value = value;
enumerable: true,

}
get: function () {

},
return this.uniforms.opacity.value;

resolution: {
},

enumerable: true,
set: function ( value ) {

get: function () {
this.uniforms.opacity.value = value;

return this.uniforms.resolution.value;
}

},

set: function ( value ) {
resolution: {

this.uniforms.resolution.value.copy( value );
enumerable: true,

}
get: function () {

}
return this.uniforms.resolution.value;

} );
},

this.setValues( parameters );
set: function ( value ) {

};
this.uniforms.resolution.value.copy( value );

}

}

} );

this.setValues( parameters );

LineMaterial.prototype = Object.create( ShaderMaterial.prototype );
LineMaterial.prototype.constructor = LineMaterial;
}

LineMaterial.prototype.isLineMaterial = true;
}

export { LineMaterial };
15 changes: 8 additions & 7 deletions examples/jsm/nodes/materials/MeshStandardNodeMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ import { MeshStandardNode } from './nodes/MeshStandardNode.js';
import { NodeMaterial } from './NodeMaterial.js';
import { NodeUtils } from '../core/NodeUtils.js';

function MeshStandardNodeMaterial() {
class MeshStandardNodeMaterial extends NodeMaterial {

var node = new MeshStandardNode();
constructor() {

NodeMaterial.call( this, node, node );
var node = new MeshStandardNode();

this.type = 'MeshStandardNodeMaterial';
super( node, node );

}
this.type = 'MeshStandardNodeMaterial';

}

MeshStandardNodeMaterial.prototype = Object.create( NodeMaterial.prototype );
MeshStandardNodeMaterial.prototype.constructor = MeshStandardNodeMaterial;
}

NodeUtils.addShortcuts( MeshStandardNodeMaterial.prototype, 'properties', [
'color',
Expand Down
Loading

0 comments on commit 0159c04

Please sign in to comment.