1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 20:32:02 +08:00
trois/src/materials/ShaderMaterial.js

21 lines
387 B
JavaScript
Raw Normal View History

2020-09-17 16:16:02 +08:00
export default {
2020-10-03 18:34:14 +08:00
inject: ['three', 'mesh'],
2020-09-17 16:16:02 +08:00
props: {
uniforms: Object,
vertexShader: String,
fragmentShader: String,
},
2021-03-07 06:14:22 +08:00
created() {
2020-10-03 18:34:14 +08:00
this.createMaterial();
this.mesh.setMaterial(this.material);
if (this.addWatchers) this.addWatchers();
2020-09-17 16:16:02 +08:00
},
unmounted() {
this.material.dispose();
},
render() {
return [];
},
2020-09-19 23:00:29 +08:00
__hmrId: 'ShaderMaterial',
2020-09-17 16:16:02 +08:00
};