UNPKG

2.01 kBTypeScriptView Raw
1import { NormalMapTypes } from "../constants.js";
2import { Vector2 } from "../math/Vector2.js";
3import { Texture } from "../textures/Texture.js";
4import { Material, MaterialParameters } from "./Material.js";
5
6export interface MeshNormalMaterialParameters extends MaterialParameters {
7 bumpMap?: Texture | null | undefined;
8 bumpScale?: number | undefined;
9 normalMap?: Texture | null | undefined;
10 normalMapType?: NormalMapTypes | undefined;
11 normalScale?: Vector2 | undefined;
12 displacementMap?: Texture | null | undefined;
13 displacementScale?: number | undefined;
14 displacementBias?: number | undefined;
15 wireframe?: boolean | undefined;
16 wireframeLinewidth?: number | undefined;
17
18 flatShading?: boolean | undefined;
19}
20
21export class MeshNormalMaterial extends Material {
22 constructor(parameters?: MeshNormalMaterialParameters);
23
24 /**
25 * Read-only flag to check if a given object is of type {@link MeshNormalMaterial}.
26 * @remarks This is a _constant_ value
27 * @defaultValue `true`
28 */
29 readonly isMeshNormalMaterial: true;
30
31 /**
32 * @default null
33 */
34 bumpMap: Texture | null;
35
36 /**
37 * @default 1
38 */
39 bumpScale: number;
40
41 /**
42 * @default null
43 */
44 normalMap: Texture | null;
45
46 /**
47 * @default THREE.TangentSpaceNormalMap
48 */
49 normalMapType: NormalMapTypes;
50
51 /**
52 * @default new THREE.Vector2( 1, 1 )
53 */
54 normalScale: Vector2;
55
56 /**
57 * @default null
58 */
59 displacementMap: Texture | null;
60
61 /**
62 * @default 1
63 */
64 displacementScale: number;
65
66 /**
67 * @default 0
68 */
69 displacementBias: number;
70
71 /**
72 * @default false
73 */
74 wireframe: boolean;
75
76 /**
77 * @default 1
78 */
79 wireframeLinewidth: number;
80
81 /**
82 * Define whether the material is rendered with flat shading. Default is false.
83 * @default false
84 */
85 flatShading: boolean;
86
87 setValues(parameters: MeshNormalMaterialParameters): void;
88}