1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

material color hmr

This commit is contained in:
Kevin Levron 2020-09-19 17:00:29 +02:00
parent f5b1bd1934
commit 2f278a912b
8 changed files with 13 additions and 1 deletions

View File

@ -8,4 +8,5 @@ export default {
color: this.color,
});
},
__hmrId: 'BasicMaterial',
};

View File

@ -8,4 +8,5 @@ export default {
color: this.color,
});
},
__hmrId: 'LambertMaterial',
};

View File

@ -1,4 +1,5 @@
import { FrontSide } from 'three';
import { watch } from 'vue';
import { Color, FrontSide } from 'three';
export default {
inject: ['three'],
@ -39,6 +40,9 @@ export default {
},
mounted() {
this.three.materials[this.id] = this.material;
watch(() => this.color, () => {
this.material.color = new Color(this.color);
});
},
unmounted() {
this.material.dispose();
@ -55,4 +59,5 @@ export default {
render() {
return [];
},
__hmrId: 'Material',
};

View File

@ -8,4 +8,5 @@ export default {
color: this.color,
});
},
__hmrId: 'PhongMaterial',
};

View File

@ -8,4 +8,5 @@ export default {
color: this.color,
});
},
__hmrId: 'PhysicalMaterial',
};

View File

@ -22,4 +22,5 @@ export default {
render() {
return [];
},
__hmrId: 'ShaderMaterial',
};

View File

@ -24,4 +24,5 @@ export default {
created() {
this.material = new MeshStandardMaterial(this.propsValues());
},
__hmrId: 'StandardMaterial',
};

View File

@ -66,4 +66,5 @@ export default {
vertexColors: this.vertexColors,
});
},
__hmrId: 'SubSurfaceMaterial',
};