UNPKG

2.53 kBTypeScriptView Raw
1import { NormalMapTypes } from "../constants.js";
2import { Color, ColorRepresentation } from "../math/Color.js";
3import { Vector2 } from "../math/Vector2.js";
4import { Texture } from "../textures/Texture.js";
5import { Material, MaterialParameters } from "./Material.js";
6
7export interface MeshMatcapMaterialParameters extends MaterialParameters {
8 color?: ColorRepresentation | undefined;
9 matcap?: Texture | null | undefined;
10 map?: Texture | null | undefined;
11 bumpMap?: Texture | null | undefined;
12 bumpScale?: number | undefined;
13 normalMap?: Texture | null | undefined;
14 normalMapType?: NormalMapTypes | undefined;
15 normalScale?: Vector2 | undefined;
16 displacementMap?: Texture | null | undefined;
17 displacementScale?: number | undefined;
18 displacementBias?: number | undefined;
19 alphaMap?: Texture | null | undefined;
20 fog?: boolean | undefined;
21 flatShading?: boolean | undefined;
22}
23
24export class MeshMatcapMaterial extends Material {
25 constructor(parameters?: MeshMatcapMaterialParameters);
26
27 /**
28 * Read-only flag to check if a given object is of type {@link MeshMatcapMaterial}.
29 * @remarks This is a _constant_ value
30 * @defaultValue `true`
31 */
32 readonly isMeshMatcapMaterial: true;
33
34 /**
35 * @default { 'MATCAP': '' }
36 */
37 defines: { [key: string]: any };
38
39 /**
40 * @default new THREE.Color( 0xffffff )
41 */
42 color: Color;
43
44 /**
45 * @default null
46 */
47 matcap: Texture | null;
48
49 /**
50 * @default null
51 */
52 map: Texture | null;
53
54 /**
55 * @default null
56 */
57 bumpMap: Texture | null;
58
59 /**
60 * @default 1
61 */
62 bumpScale: number;
63
64 /**
65 * @default null
66 */
67 normalMap: Texture | null;
68
69 /**
70 * @default THREE.TangentSpaceNormalMap
71 */
72 normalMapType: NormalMapTypes;
73
74 /**
75 * @default new Vector2( 1, 1 )
76 */
77 normalScale: Vector2;
78
79 /**
80 * @default null
81 */
82 displacementMap: Texture | null;
83
84 /**
85 * @default 1
86 */
87 displacementScale: number;
88
89 /**
90 * @default 0
91 */
92 displacementBias: number;
93
94 /**
95 * @default null
96 */
97 alphaMap: Texture | null;
98
99 /**
100 * Define whether the material is rendered with flat shading. Default is false.
101 * @default false
102 */
103 flatShading: boolean;
104
105 /**
106 * Whether the material is affected by fog. Default is true.
107 * @default fog
108 */
109 fog: boolean;
110
111 setValues(parameters: MeshMatcapMaterialParameters): void;
112}