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

23 lines
414 B
JavaScript
Raw Normal View History

2020-09-17 16:16:02 +08:00
import { ShaderMaterial } from 'three';
export default {
inject: ['three'],
props: {
id: String,
uniforms: Object,
vertexShader: String,
fragmentShader: String,
},
mounted() {
this.three.materials[this.id] = this.material;
},
unmounted() {
this.material.dispose();
2020-10-02 00:22:01 +08:00
delete this.three.materials[this.id];
2020-09-17 16:16:02 +08:00
},
render() {
return [];
},
2020-09-19 23:00:29 +08:00
__hmrId: 'ShaderMaterial',
2020-09-17 16:16:02 +08:00
};