diff --git a/src/materials/Material.ts b/src/materials/Material.ts index 32e72ae..91a87bb 100644 --- a/src/materials/Material.ts +++ b/src/materials/Material.ts @@ -1,5 +1,5 @@ import { ComponentPropsOptions, ComponentPublicInstance, defineComponent, InjectionKey, PropType, watch } from 'vue' -import { Color, Material, MeshBasicMaterial, MeshLambertMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, PointsMaterial as TPointsMaterial, Texture } from 'three' +import { Color, Material, MeshBasicMaterial, MeshLambertMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, PointsMaterial as TPointsMaterial, Texture, ShadowMaterial as TShadowMaterial } from 'three' import { MeshInjectionKey, MeshInterface } from '../meshes/Mesh' import { bindObjectProp, propsValues } from '../tools' import { BasicMaterialPropsInterface, LambertMaterialPropsInterface, MaterialPropsInterface, PhongMaterialPropsInterface, PhysicalMaterialPropsInterface, PointsMaterialPropsInterface, StandardMaterialPropsInterface, ToonMaterialPropsInterface } from './types' @@ -99,5 +99,6 @@ export const LambertMaterial = materialComponent('LambertMaterial', { props: { t export const PhongMaterial = materialComponent('PhongMaterial', { props: { type: Object as PropType, default: () => ({}) } }, (opts) => new MeshPhongMaterial(opts)) export const PhysicalMaterial = materialComponent('PhysicalMaterial', { props: { type: Object as PropType, default: () => ({}) } }, (opts) => new MeshPhysicalMaterial(opts)) export const PointsMaterial = materialComponent('PointsMaterial', { props: { type: Object as PropType, default: () => ({}) } }, (opts) => new TPointsMaterial(opts)) +export const ShadowMaterial = materialComponent('ShadowMaterial', { color: { type: String, default: '#000000' }, props: { type: Object as PropType, default: () => ({}) } }, (opts) => new TShadowMaterial(opts)) export const StandardMaterial = materialComponent('StandardMaterial', { props: { type: Object as PropType, default: () => ({}) } }, (opts) => new MeshStandardMaterial(opts)) export const ToonMaterial = materialComponent('ToonMaterial', { props: { type: Object as PropType, default: () => ({}) } }, (opts) => new MeshToonMaterial(opts)) diff --git a/src/materials/index.ts b/src/materials/index.ts index 7051713..7c116f3 100644 --- a/src/materials/index.ts +++ b/src/materials/index.ts @@ -1,4 +1,4 @@ -export { default as Material, BasicMaterial, LambertMaterial, PhongMaterial, PhysicalMaterial, PointsMaterial, StandardMaterial, ToonMaterial, MaterialInjectionKey } from './Material' +export { default as Material, BasicMaterial, LambertMaterial, PhongMaterial, PhysicalMaterial, PointsMaterial, ShadowMaterial, StandardMaterial, ToonMaterial, MaterialInjectionKey } from './Material' export { default as MatcapMaterial } from './MatcapMaterial' export { default as ShaderMaterial } from './ShaderMaterial' export { default as SubSurfaceMaterial } from './SubSurfaceMaterial'