mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 20:32:02 +08:00
26 lines
451 B
JavaScript
26 lines
451 B
JavaScript
|
import { ShaderMaterial } from 'three';
|
||
|
|
||
|
export default {
|
||
|
inject: ['three'],
|
||
|
props: {
|
||
|
id: String,
|
||
|
uniforms: Object,
|
||
|
vertexShader: String,
|
||
|
fragmentShader: String,
|
||
|
},
|
||
|
mounted() {
|
||
|
if (!this.material) {
|
||
|
// this.material = new ShaderMaterial(this.$props);
|
||
|
}
|
||
|
this.three.materials[this.id] = this.material;
|
||
|
},
|
||
|
unmounted() {
|
||
|
this.material.dispose();
|
||
|
},
|
||
|
methods: {
|
||
|
},
|
||
|
render() {
|
||
|
return [];
|
||
|
},
|
||
|
};
|