From d52616f4b019614ce13dac1aa220fc2e3f3ec5f9 Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Sat, 3 Oct 2020 22:32:27 +0200 Subject: [PATCH] add toon material --- src/materials/ToonMaterial.js | 13 +++++++++++++ src/materials/index.js | 1 + src/plugin.js | 1 + 3 files changed, 15 insertions(+) create mode 100644 src/materials/ToonMaterial.js diff --git a/src/materials/ToonMaterial.js b/src/materials/ToonMaterial.js new file mode 100644 index 0000000..cadce9f --- /dev/null +++ b/src/materials/ToonMaterial.js @@ -0,0 +1,13 @@ +import { MeshToonMaterial } from 'three'; +import { propsValues } from '../tools.js'; +import Material from './Material'; + +export default { + extends: Material, + methods: { + createMaterial() { + this.material = new MeshToonMaterial(propsValues(this.$props, ['id'])); + }, + }, + __hmrId: 'ToonMaterial', +}; diff --git a/src/materials/index.js b/src/materials/index.js index 4c4a3be..82c40b7 100644 --- a/src/materials/index.js +++ b/src/materials/index.js @@ -4,3 +4,4 @@ export { default as PhongMaterial } from './PhongMaterial.js'; export { default as PhysicalMaterial } from './PhysicalMaterial.js'; export { default as StandardMaterial } from './StandardMaterial.js'; export { default as SubSurfaceMaterial } from './SubSurfaceMaterial.js'; +export { default as ToonMaterial } from './ToonMaterial.js'; diff --git a/src/plugin.js b/src/plugin.js index f4605f4..a63bb3d 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -36,6 +36,7 @@ export const TroisJSVuePlugin = { 'ShaderMaterial', 'StandardMaterial', 'SubSurfaceMaterial', + 'ToonMaterial', 'Box', 'Circle',