@types/three 0.177.0 → 0.178.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- three/README.md +1 -1
- three/examples/jsm/capabilities/WebGL.d.ts +0 -11
- three/examples/jsm/controls/TransformControls.d.ts +16 -1
- three/examples/jsm/helpers/TextureHelper.d.ts +2 -2
- three/examples/jsm/helpers/TextureHelperGPU.d.ts +2 -2
- three/examples/jsm/loaders/SVGLoader.d.ts +1 -1
- three/examples/jsm/physics/RapierPhysics.d.ts +1 -0
- three/examples/jsm/transpiler/AST.d.ts +77 -26
- three/examples/jsm/transpiler/TSLEncoder.d.ts +9 -3
- three/examples/jsm/tsl/display/AnamorphicNode.d.ts +4 -4
- three/examples/jsm/tsl/display/BleachBypass.d.ts +2 -2
- three/examples/jsm/tsl/display/BloomNode.d.ts +2 -2
- three/examples/jsm/tsl/display/ChromaticAberrationNode.d.ts +20 -0
- three/examples/jsm/tsl/display/DenoiseNode.d.ts +4 -4
- three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts +6 -6
- three/examples/jsm/tsl/display/DotScreenNode.d.ts +2 -2
- three/examples/jsm/tsl/display/FXAANode.d.ts +3 -3
- three/examples/jsm/tsl/display/FilmNode.d.ts +4 -4
- three/examples/jsm/tsl/display/GTAONode.d.ts +3 -3
- three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +5 -5
- three/examples/jsm/tsl/display/LensflareNode.d.ts +8 -8
- three/examples/jsm/tsl/display/Lut3DNode.d.ts +4 -4
- three/examples/jsm/tsl/display/MotionBlur.d.ts +4 -4
- three/examples/jsm/tsl/display/OutlineNode.d.ts +3 -3
- three/examples/jsm/tsl/display/RGBShiftNode.d.ts +3 -3
- three/examples/jsm/tsl/display/SMAANode.d.ts +3 -3
- three/examples/jsm/tsl/display/SSRNode.d.ts +5 -5
- three/examples/jsm/tsl/display/Sepia.d.ts +2 -2
- three/examples/jsm/tsl/display/SobelOperatorNode.d.ts +3 -3
- three/examples/jsm/tsl/display/TransitionNode.d.ts +4 -4
- three/examples/jsm/tsl/display/hashBlur.d.ts +5 -5
- three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +5 -5
- three/package.json +2 -2
- three/src/Three.TSL.d.ts +9 -16
- three/src/Three.WebGPU.d.ts +2 -0
- three/src/constants.d.ts +13 -5
- three/src/core/BufferGeometry.d.ts +6 -1
- three/src/core/GLBufferAttribute.d.ts +18 -1
- three/src/helpers/AxesHelper.d.ts +3 -1
- three/src/materials/LineBasicMaterial.d.ts +66 -34
- three/src/materials/LineDashedMaterial.d.ts +41 -21
- three/src/materials/Material.d.ts +408 -398
- three/src/materials/MeshBasicMaterial.d.ts +101 -62
- three/src/materials/MeshDepthMaterial.d.ts +71 -32
- three/src/materials/MeshDistanceMaterial.d.ts +65 -29
- three/src/materials/MeshLambertMaterial.d.ts +179 -103
- three/src/materials/MeshMatcapMaterial.d.ts +97 -55
- three/src/materials/MeshNormalMaterial.d.ts +76 -41
- three/src/materials/MeshPhongMaterial.d.ts +164 -100
- three/src/materials/MeshPhysicalMaterial.d.ts +171 -111
- three/src/materials/MeshStandardMaterial.d.ts +178 -91
- three/src/materials/MeshToonMaterial.d.ts +130 -81
- three/src/materials/PointsMaterial.d.ts +77 -30
- three/src/materials/RawShaderMaterial.d.ts +12 -7
- three/src/materials/ShaderMaterial.d.ts +186 -98
- three/src/materials/ShadowMaterial.d.ts +49 -23
- three/src/materials/SpriteMaterial.d.ts +62 -33
- three/src/materials/nodes/Line2NodeMaterial.d.ts +87 -40
- three/src/materials/nodes/LineBasicNodeMaterial.d.ts +35 -16
- three/src/materials/nodes/LineDashedNodeMaterial.d.ts +75 -20
- three/src/materials/nodes/MeshBasicNodeMaterial.d.ts +49 -30
- three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +49 -42
- three/src/materials/nodes/MeshMatcapNodeMaterial.d.ts +38 -26
- three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +36 -22
- three/src/materials/nodes/MeshPhongNodeMaterial.d.ts +68 -48
- three/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts +240 -65
- three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +99 -3
- three/src/materials/nodes/MeshStandardNodeMaterial.d.ts +83 -47
- three/src/materials/nodes/MeshToonNodeMaterial.d.ts +42 -36
- three/src/materials/nodes/NodeMaterial.d.ts +417 -56
- three/src/materials/nodes/NodeMaterials.d.ts +3 -2
- three/src/materials/nodes/PointsNodeMaterial.d.ts +31 -7
- three/src/materials/nodes/ShadowNodeMaterial.d.ts +38 -11
- three/src/materials/nodes/SpriteNodeMaterial.d.ts +68 -20
- three/src/materials/nodes/VolumeNodeMaterial.d.ts +50 -14
- three/src/math/Color.d.ts +1 -1
- three/src/nodes/Nodes.d.ts +1 -3
- three/src/nodes/TSL.d.ts +4 -3
- three/src/nodes/accessors/AccessorsUtils.d.ts +3 -3
- three/src/nodes/accessors/Bitangent.d.ts +0 -2
- three/src/nodes/accessors/CubeTextureNode.d.ts +7 -7
- three/src/nodes/accessors/Normal.d.ts +19 -5
- three/src/nodes/accessors/ReferenceBaseNode.d.ts +1 -1
- three/src/nodes/accessors/StorageBufferNode.d.ts +3 -2
- three/src/nodes/accessors/StorageTextureNode.d.ts +5 -5
- three/src/nodes/accessors/Tangent.d.ts +0 -2
- three/src/nodes/accessors/TangentUtils.d.ts +22 -0
- three/src/nodes/accessors/Texture3DNode.d.ts +5 -4
- three/src/nodes/accessors/TextureBicubic.d.ts +4 -2
- three/src/nodes/accessors/TextureNode.d.ts +16 -16
- three/src/nodes/accessors/TextureSizeNode.d.ts +3 -3
- three/src/nodes/accessors/UniformArrayNode.d.ts +2 -7
- three/src/nodes/code/FunctionCallNode.d.ts +3 -1
- three/src/nodes/code/FunctionNode.d.ts +2 -2
- three/src/nodes/code/ScriptableNode.d.ts +2 -2
- three/src/nodes/core/AssignNode.d.ts +2 -2
- three/src/nodes/core/AttributeNode.d.ts +1 -1
- three/src/nodes/core/BypassNode.d.ts +2 -2
- three/src/nodes/core/CacheNode.d.ts +0 -2
- three/src/nodes/core/ContextNode.d.ts +3 -3
- three/src/nodes/core/StackNode.d.ts +3 -13
- three/src/nodes/core/SubBuildNode.d.ts +15 -0
- three/src/nodes/core/VarNode.d.ts +4 -4
- three/src/nodes/core/VaryingNode.d.ts +3 -3
- three/src/nodes/display/BlendModes.d.ts +12 -12
- three/src/nodes/display/BumpMapNode.d.ts +4 -3
- three/src/nodes/display/ColorAdjustment.d.ts +17 -17
- three/src/nodes/display/ColorSpaceFunctions.d.ts +3 -3
- three/src/nodes/display/ColorSpaceNode.d.ts +4 -4
- three/src/nodes/display/FrontFacingNode.d.ts +1 -0
- three/src/nodes/display/PosterizeNode.d.ts +3 -3
- three/src/nodes/display/RenderOutputNode.d.ts +2 -2
- three/src/nodes/display/ScreenNode.d.ts +0 -10
- three/src/nodes/display/ToneMappingFunctions.d.ts +7 -7
- three/src/nodes/display/ToneMappingNode.d.ts +6 -6
- three/src/nodes/display/ViewportDepthTextureNode.d.ts +3 -3
- three/src/nodes/fog/Fog.d.ts +10 -10
- three/src/nodes/functions/BSDF/Schlick_to_F0.d.ts +4 -4
- three/src/nodes/functions/material/getAlphaHashThreshold.d.ts +2 -2
- three/src/nodes/functions/material/getParallaxCorrectNormal.d.ts +4 -4
- three/src/nodes/geometry/RangeNode.d.ts +9 -2
- three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +20 -20
- three/src/nodes/gpgpu/ComputeNode.d.ts +2 -2
- three/src/nodes/lighting/PointShadowNode.d.ts +11 -11
- three/src/nodes/lighting/ShadowFilterNode.d.ts +11 -11
- three/src/nodes/materialx/MaterialXNodes.d.ts +59 -59
- three/src/nodes/materialx/lib/mx_hsv.d.ts +3 -3
- three/src/nodes/materialx/lib/mx_noise.d.ts +206 -206
- three/src/nodes/materialx/lib/mx_transform_color.d.ts +2 -2
- three/src/nodes/math/ConditionalNode.d.ts +4 -19
- three/src/nodes/math/Hash.d.ts +2 -2
- three/src/nodes/math/MathNode.d.ts +21 -17
- three/src/nodes/math/OperatorNode.d.ts +41 -52
- three/src/nodes/math/TriNoise3D.d.ts +6 -6
- three/src/nodes/pmrem/PMREMNode.d.ts +3 -3
- three/src/nodes/pmrem/PMREMUtils.d.ts +20 -20
- three/src/nodes/procedural/Checker.d.ts +2 -2
- three/src/nodes/shapes/Shapes.d.ts +2 -2
- three/src/nodes/tsl/TSLBase.d.ts +1 -0
- three/src/nodes/tsl/TSLCore.d.ts +176 -76
- three/src/nodes/utils/CubeMapNode.d.ts +2 -2
- three/src/nodes/utils/DebugNode.d.ts +2 -2
- three/src/nodes/utils/Discard.d.ts +2 -2
- three/src/nodes/utils/EquirectUV.d.ts +4 -0
- three/src/nodes/utils/LoopNode.d.ts +2 -7
- three/src/nodes/utils/MatcapUV.d.ts +4 -0
- three/src/nodes/utils/Oscillators.d.ts +5 -5
- three/src/nodes/utils/Packing.d.ts +3 -3
- three/src/nodes/utils/PostProcessingUtils.d.ts +9 -9
- three/src/nodes/utils/RTTNode.d.ts +3 -3
- three/src/nodes/utils/RemapNode.d.ts +9 -9
- three/src/nodes/utils/RotateNode.d.ts +3 -3
- three/src/nodes/utils/SampleNode.d.ts +16 -0
- three/src/nodes/utils/SpriteSheetUVNode.d.ts +4 -4
- three/src/nodes/utils/SpriteUtils.d.ts +2 -2
- three/src/nodes/utils/StorageArrayElementNode.d.ts +4 -3
- three/src/nodes/utils/TriplanarTextures.d.ts +20 -0
- three/src/nodes/utils/UVUtils.d.ts +8 -7
- three/src/nodes/utils/ViewportUtils.d.ts +2 -2
- three/src/objects/LOD.d.ts +1 -1
- three/src/renderers/WebGLRenderer.d.ts +1 -1
- three/src/renderers/common/Backend.d.ts +3 -3
- three/src/renderers/common/RenderObject.d.ts +10 -2
- three/src/renderers/common/Renderer.d.ts +5 -5
- three/src/renderers/common/Storage3DTexture.d.ts +40 -0
- three/src/renderers/common/StorageArrayTexture.d.ts +29 -0
- three/src/renderers/common/Textures.d.ts +2 -2
- three/src/renderers/common/XRRenderTarget.d.ts +3 -2
- three/src/renderers/common/nodes/NodeLibrary.d.ts +4 -9
- three/src/renderers/common/nodes/NodeSampledTexture.d.ts +1 -1
- three/src/renderers/common/nodes/Nodes.d.ts +1 -1
- three/src/renderers/webgpu/WebGPURenderer.d.ts +3 -0
- three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +65 -0
- three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +9 -0
- three/src/nodes/utils/EquirectUVNode.d.ts +0 -8
- three/src/nodes/utils/MatcapUVNode.d.ts +0 -8
- three/src/nodes/utils/TriplanarTexturesNode.d.ts +0 -36
- three/src/renderers/common/nodes/StandardNodeLibrary.d.ts +0 -5
|
@@ -1,199 +1,275 @@
|
|
|
1
1
|
import { Combine, NormalMapTypes } from "../constants.js";
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from "../math/Color.js";
|
|
3
3
|
import { Euler } from "../math/Euler.js";
|
|
4
4
|
import { Vector2 } from "../math/Vector2.js";
|
|
5
5
|
import { Texture } from "../textures/Texture.js";
|
|
6
|
-
import { Material,
|
|
7
|
-
|
|
8
|
-
export interface MeshLambertMaterialParameters extends MaterialParameters {
|
|
9
|
-
bumpMap?: Texture | undefined;
|
|
10
|
-
bumpScale?: number | undefined;
|
|
11
|
-
color?: ColorRepresentation | undefined;
|
|
12
|
-
displacementMap?: Texture | undefined;
|
|
13
|
-
displacementScale?: number | undefined;
|
|
14
|
-
displacementBias?: number | undefined;
|
|
15
|
-
emissive?: ColorRepresentation | undefined;
|
|
16
|
-
emissiveIntensity?: number | undefined;
|
|
17
|
-
emissiveMap?: Texture | null | undefined;
|
|
18
|
-
flatShading?: boolean | undefined;
|
|
19
|
-
map?: Texture | null | undefined;
|
|
20
|
-
lightMap?: Texture | null | undefined;
|
|
21
|
-
lightMapIntensity?: number | undefined;
|
|
22
|
-
normalMap?: Texture | undefined;
|
|
23
|
-
normalScale?: Vector2 | undefined;
|
|
24
|
-
aoMap?: Texture | null | undefined;
|
|
25
|
-
aoMapIntensity?: number | undefined;
|
|
26
|
-
specularMap?: Texture | null | undefined;
|
|
27
|
-
alphaMap?: Texture | null | undefined;
|
|
28
|
-
envMap?: Texture | null | undefined;
|
|
29
|
-
envMapRotation?: Euler | undefined;
|
|
30
|
-
combine?: Combine | undefined;
|
|
31
|
-
reflectivity?: number | undefined;
|
|
32
|
-
refractionRatio?: number | undefined;
|
|
33
|
-
wireframe?: boolean | undefined;
|
|
34
|
-
wireframeLinewidth?: number | undefined;
|
|
35
|
-
wireframeLinecap?: string | undefined;
|
|
36
|
-
wireframeLinejoin?: string | undefined;
|
|
37
|
-
fog?: boolean | undefined;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export class MeshLambertMaterial extends Material {
|
|
41
|
-
constructor(parameters?: MeshLambertMaterialParameters);
|
|
6
|
+
import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js";
|
|
42
7
|
|
|
8
|
+
export interface MeshLambertMaterialProperties extends MaterialProperties {
|
|
43
9
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* @
|
|
10
|
+
* Color of the material.
|
|
11
|
+
*
|
|
12
|
+
* @default (1,1,1)
|
|
47
13
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
14
|
+
color: Color;
|
|
50
15
|
/**
|
|
51
|
-
*
|
|
16
|
+
* The color map. May optionally include an alpha channel, typically combined
|
|
17
|
+
* with {@link Material#transparent} or {@link Material#alphaTest}. The texture map
|
|
18
|
+
* color is modulated by the diffuse `color`.
|
|
19
|
+
*
|
|
20
|
+
* @default null
|
|
52
21
|
*/
|
|
53
|
-
|
|
54
|
-
|
|
22
|
+
map: Texture | null;
|
|
55
23
|
/**
|
|
24
|
+
* The light map. Requires a second set of UVs.
|
|
25
|
+
*
|
|
56
26
|
* @default null
|
|
57
27
|
*/
|
|
58
|
-
|
|
59
|
-
|
|
28
|
+
lightMap: Texture | null;
|
|
60
29
|
/**
|
|
30
|
+
* Intensity of the baked light.
|
|
31
|
+
*
|
|
61
32
|
* @default 1
|
|
62
33
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
34
|
+
lightMapIntensity: number;
|
|
65
35
|
/**
|
|
36
|
+
* The red channel of this texture is used as the ambient occlusion map.
|
|
37
|
+
* Requires a second set of UVs.
|
|
38
|
+
*
|
|
66
39
|
* @default null
|
|
67
40
|
*/
|
|
68
|
-
|
|
69
|
-
|
|
41
|
+
aoMap: Texture | null;
|
|
70
42
|
/**
|
|
43
|
+
* Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`
|
|
44
|
+
* disables ambient occlusion. Where intensity is `1` and the AO map's
|
|
45
|
+
* red channel is also `1`, ambient light is fully occluded on a surface.
|
|
46
|
+
*
|
|
71
47
|
* @default 1
|
|
72
48
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @default 0
|
|
77
|
-
*/
|
|
78
|
-
displacementBias: number;
|
|
79
|
-
|
|
49
|
+
aoMapIntensity: number;
|
|
80
50
|
/**
|
|
81
|
-
*
|
|
51
|
+
* Emissive (light) color of the material, essentially a solid color
|
|
52
|
+
* unaffected by other lighting.
|
|
53
|
+
*
|
|
54
|
+
* @default (0,0,0)
|
|
82
55
|
*/
|
|
83
56
|
emissive: Color;
|
|
84
|
-
|
|
85
57
|
/**
|
|
58
|
+
* Intensity of the emissive light. Modulates the emissive color.
|
|
59
|
+
*
|
|
86
60
|
* @default 1
|
|
87
61
|
*/
|
|
88
62
|
emissiveIntensity: number;
|
|
89
|
-
|
|
90
63
|
/**
|
|
64
|
+
* Set emissive (glow) map. The emissive map color is modulated by the
|
|
65
|
+
* emissive color and the emissive intensity. If you have an emissive map,
|
|
66
|
+
* be sure to set the emissive color to something other than black.
|
|
67
|
+
*
|
|
91
68
|
* @default null
|
|
92
69
|
*/
|
|
93
70
|
emissiveMap: Texture | null;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* @default false
|
|
97
|
-
*/
|
|
98
|
-
flatShading: boolean;
|
|
99
|
-
|
|
100
71
|
/**
|
|
72
|
+
* The texture to create a bump map. The black and white values map to the
|
|
73
|
+
* perceived depth in relation to the lights. Bump doesn't actually affect
|
|
74
|
+
* the geometry of the object, only the lighting. If a normal map is defined
|
|
75
|
+
* this will be ignored.
|
|
76
|
+
*
|
|
101
77
|
* @default null
|
|
102
78
|
*/
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* @default null
|
|
107
|
-
*/
|
|
108
|
-
lightMap: Texture | null;
|
|
109
|
-
|
|
79
|
+
bumpMap: Texture | null;
|
|
110
80
|
/**
|
|
81
|
+
* How much the bump map affects the material. Typical range is `[0,1]`.
|
|
82
|
+
*
|
|
111
83
|
* @default 1
|
|
112
84
|
*/
|
|
113
|
-
|
|
114
|
-
|
|
85
|
+
bumpScale: number;
|
|
115
86
|
/**
|
|
87
|
+
* The texture to create a normal map. The RGB values affect the surface
|
|
88
|
+
* normal for each pixel fragment and change the way the color is lit. Normal
|
|
89
|
+
* maps do not change the actual shape of the surface, only the lighting. In
|
|
90
|
+
* case the material has a normal map authored using the left handed
|
|
91
|
+
* convention, the `y` component of `normalScale` should be negated to compensate
|
|
92
|
+
* for the different handedness.
|
|
93
|
+
*
|
|
116
94
|
* @default null
|
|
117
95
|
*/
|
|
118
96
|
normalMap: Texture | null;
|
|
119
|
-
|
|
97
|
+
/**
|
|
98
|
+
* The type of normal map.
|
|
99
|
+
*
|
|
100
|
+
* @default TangentSpaceNormalMap
|
|
101
|
+
*/
|
|
120
102
|
normalMapType: NormalMapTypes;
|
|
121
|
-
|
|
122
103
|
/**
|
|
123
|
-
*
|
|
104
|
+
* How much the normal map affects the material. Typical value range is `[0,1]`.
|
|
105
|
+
*
|
|
106
|
+
* @default (1,1)
|
|
124
107
|
*/
|
|
125
108
|
normalScale: Vector2;
|
|
126
|
-
|
|
127
109
|
/**
|
|
110
|
+
* The displacement map affects the position of the mesh's vertices. Unlike
|
|
111
|
+
* other maps which only affect the light and shade of the material the
|
|
112
|
+
* displaced vertices can cast shadows, block other objects, and otherwise
|
|
113
|
+
* act as real geometry. The displacement texture is an image where the value
|
|
114
|
+
* of each pixel (white being the highest) is mapped against, and
|
|
115
|
+
* repositions, the vertices of the mesh.
|
|
116
|
+
*
|
|
128
117
|
* @default null
|
|
129
118
|
*/
|
|
130
|
-
|
|
131
|
-
|
|
119
|
+
displacementMap: Texture | null;
|
|
132
120
|
/**
|
|
133
|
-
*
|
|
121
|
+
* How much the displacement map affects the mesh (where black is no
|
|
122
|
+
* displacement, and white is maximum displacement). Without a displacement
|
|
123
|
+
* map set, this value is not applied.
|
|
124
|
+
*
|
|
125
|
+
* @default 0
|
|
134
126
|
*/
|
|
135
|
-
|
|
136
|
-
|
|
127
|
+
displacementScale: number;
|
|
137
128
|
/**
|
|
129
|
+
* The offset of the displacement map's values on the mesh's vertices.
|
|
130
|
+
* The bias is added to the scaled sample of the displacement map.
|
|
131
|
+
* Without a displacement map set, this value is not applied.
|
|
132
|
+
*
|
|
133
|
+
* @default 0
|
|
134
|
+
*/
|
|
135
|
+
displacementBias: number;
|
|
136
|
+
/**
|
|
137
|
+
* Specular map used by the material.
|
|
138
|
+
*
|
|
138
139
|
* @default null
|
|
139
140
|
*/
|
|
140
141
|
specularMap: Texture | null;
|
|
141
|
-
|
|
142
142
|
/**
|
|
143
|
+
* The alpha map is a grayscale texture that controls the opacity across the
|
|
144
|
+
* surface (black: fully transparent; white: fully opaque).
|
|
145
|
+
*
|
|
146
|
+
* Only the color of the texture is used, ignoring the alpha channel if one
|
|
147
|
+
* exists. For RGB and RGBA textures, the renderer will use the green channel
|
|
148
|
+
* when sampling this texture due to the extra bit of precision provided for
|
|
149
|
+
* green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
|
|
150
|
+
* luminance/alpha textures will also still work as expected.
|
|
151
|
+
*
|
|
143
152
|
* @default null
|
|
144
153
|
*/
|
|
145
154
|
alphaMap: Texture | null;
|
|
146
|
-
|
|
147
155
|
/**
|
|
156
|
+
* The environment map.
|
|
157
|
+
*
|
|
148
158
|
* @default null
|
|
149
159
|
*/
|
|
150
160
|
envMap: Texture | null;
|
|
151
|
-
|
|
152
161
|
/**
|
|
153
|
-
* The rotation of the environment map in radians.
|
|
162
|
+
* The rotation of the environment map in radians.
|
|
163
|
+
*
|
|
164
|
+
* @default (0,0,0)
|
|
154
165
|
*/
|
|
155
166
|
envMapRotation: Euler;
|
|
156
|
-
|
|
157
167
|
/**
|
|
158
|
-
*
|
|
168
|
+
* How to combine the result of the surface's color with the environment map, if any.
|
|
169
|
+
*
|
|
170
|
+
* When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to
|
|
171
|
+
* blend between the two colors.
|
|
172
|
+
*
|
|
173
|
+
* @default MultiplyOperation
|
|
159
174
|
*/
|
|
160
175
|
combine: Combine;
|
|
161
|
-
|
|
162
176
|
/**
|
|
177
|
+
* How much the environment map affects the surface.
|
|
178
|
+
* The valid range is between `0` (no reflections) and `1` (full reflections).
|
|
179
|
+
*
|
|
163
180
|
* @default 1
|
|
164
181
|
*/
|
|
165
182
|
reflectivity: number;
|
|
166
|
-
|
|
167
183
|
/**
|
|
184
|
+
* The index of refraction (IOR) of air (approximately 1) divided by the
|
|
185
|
+
* index of refraction of the material. It is used with environment mapping
|
|
186
|
+
* modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}.
|
|
187
|
+
* The refraction ratio should not exceed `1`.
|
|
188
|
+
*
|
|
168
189
|
* @default 0.98
|
|
169
190
|
*/
|
|
170
191
|
refractionRatio: number;
|
|
171
|
-
|
|
172
192
|
/**
|
|
193
|
+
* Renders the geometry as a wireframe.
|
|
194
|
+
*
|
|
173
195
|
* @default false
|
|
174
196
|
*/
|
|
175
197
|
wireframe: boolean;
|
|
176
|
-
|
|
177
198
|
/**
|
|
199
|
+
* Controls the thickness of the wireframe.
|
|
200
|
+
*
|
|
201
|
+
* Can only be used with {@link SVGRenderer}.
|
|
202
|
+
*
|
|
178
203
|
* @default 1
|
|
179
204
|
*/
|
|
180
205
|
wireframeLinewidth: number;
|
|
181
|
-
|
|
182
206
|
/**
|
|
207
|
+
* Defines appearance of wireframe ends.
|
|
208
|
+
*
|
|
209
|
+
* Can only be used with {@link SVGRenderer}.
|
|
210
|
+
*
|
|
183
211
|
* @default 'round'
|
|
184
212
|
*/
|
|
185
|
-
wireframeLinecap:
|
|
186
|
-
|
|
213
|
+
wireframeLinecap: "round" | "bevel" | "miter";
|
|
187
214
|
/**
|
|
215
|
+
* Defines appearance of wireframe joints.
|
|
216
|
+
*
|
|
217
|
+
* Can only be used with {@link SVGRenderer}.
|
|
218
|
+
*
|
|
188
219
|
* @default 'round'
|
|
189
220
|
*/
|
|
190
|
-
wireframeLinejoin:
|
|
191
|
-
|
|
221
|
+
wireframeLinejoin: "round" | "bevel" | "miter";
|
|
192
222
|
/**
|
|
193
|
-
* Whether the material is
|
|
194
|
-
*
|
|
223
|
+
* Whether the material is rendered with flat shading or not.
|
|
224
|
+
*
|
|
225
|
+
* @default false
|
|
226
|
+
*/
|
|
227
|
+
flatShading: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Whether the material is affected by fog or not.
|
|
230
|
+
*
|
|
231
|
+
* @default true
|
|
195
232
|
*/
|
|
196
233
|
fog: boolean;
|
|
234
|
+
}
|
|
197
235
|
|
|
198
|
-
|
|
236
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
237
|
+
export interface MeshLambertMaterialParameters
|
|
238
|
+
extends Partial<MapColorPropertiesToColorRepresentations<MeshLambertMaterialProperties>>
|
|
239
|
+
{}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* A material for non-shiny surfaces, without specular highlights.
|
|
243
|
+
*
|
|
244
|
+
* The material uses a non-physically based [Lambertian]{@link https://en.wikipedia.org/wiki/Lambertian_reflectance}
|
|
245
|
+
* model for calculating reflectance. This can simulate some surfaces (such
|
|
246
|
+
* as untreated wood or stone) well, but cannot simulate shiny surfaces with
|
|
247
|
+
* specular highlights (such as varnished wood). `MeshLambertMaterial` uses per-fragment
|
|
248
|
+
* shading.
|
|
249
|
+
*
|
|
250
|
+
* Due to the simplicity of the reflectance and illumination models,
|
|
251
|
+
* performance will be greater when using this material over the
|
|
252
|
+
* {@link MeshPhongMaterial}, {@link MeshStandardMaterial} or
|
|
253
|
+
* {@link MeshPhysicalMaterial}, at the cost of some graphical accuracy.
|
|
254
|
+
*/
|
|
255
|
+
export class MeshLambertMaterial extends Material {
|
|
256
|
+
/**
|
|
257
|
+
* Constructs a new mesh lambert material.
|
|
258
|
+
*
|
|
259
|
+
* @param {Object} [parameters] - An object with one or more properties
|
|
260
|
+
* defining the material's appearance. Any property of the material
|
|
261
|
+
* (including any property from inherited materials) can be passed
|
|
262
|
+
* in here. Color values can be passed any type of value accepted
|
|
263
|
+
* by {@link Color#set}.
|
|
264
|
+
*/
|
|
265
|
+
constructor(parameters?: MeshLambertMaterialParameters);
|
|
266
|
+
/**
|
|
267
|
+
* This flag can be used for type testing.
|
|
268
|
+
*
|
|
269
|
+
* @default true
|
|
270
|
+
*/
|
|
271
|
+
readonly isMeshLambertMaterial: boolean;
|
|
199
272
|
}
|
|
273
|
+
|
|
274
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
275
|
+
export interface MeshLambertMaterial extends MeshLambertMaterialProperties {}
|
|
@@ -1,112 +1,154 @@
|
|
|
1
1
|
import { NormalMapTypes } from "../constants.js";
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from "../math/Color.js";
|
|
3
3
|
import { Vector2 } from "../math/Vector2.js";
|
|
4
4
|
import { Texture } from "../textures/Texture.js";
|
|
5
|
-
import { Material,
|
|
6
|
-
|
|
7
|
-
export 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
|
-
|
|
24
|
-
export class MeshMatcapMaterial extends Material {
|
|
25
|
-
constructor(parameters?: MeshMatcapMaterialParameters);
|
|
5
|
+
import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js";
|
|
26
6
|
|
|
7
|
+
export interface MeshMatcapMaterialProperties extends MaterialProperties {
|
|
27
8
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* @
|
|
31
|
-
*/
|
|
32
|
-
readonly isMeshMatcapMaterial: true;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @default { 'MATCAP': '' }
|
|
36
|
-
*/
|
|
37
|
-
defines: { [key: string]: any };
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @default new THREE.Color( 0xffffff )
|
|
9
|
+
* Color of the material.
|
|
10
|
+
*
|
|
11
|
+
* @default (1,1,1)
|
|
41
12
|
*/
|
|
42
13
|
color: Color;
|
|
43
|
-
|
|
44
14
|
/**
|
|
15
|
+
* The matcap map.
|
|
16
|
+
*
|
|
45
17
|
* @default null
|
|
46
18
|
*/
|
|
47
19
|
matcap: Texture | null;
|
|
48
|
-
|
|
49
20
|
/**
|
|
21
|
+
* The color map. May optionally include an alpha channel, typically combined
|
|
22
|
+
* with {@link Material#transparent} or {@link Material#alphaTest}. The texture map
|
|
23
|
+
* color is modulated by the diffuse `color`.
|
|
24
|
+
*
|
|
50
25
|
* @default null
|
|
51
26
|
*/
|
|
52
27
|
map: Texture | null;
|
|
53
|
-
|
|
54
28
|
/**
|
|
29
|
+
* The texture to create a bump map. The black and white values map to the
|
|
30
|
+
* perceived depth in relation to the lights. Bump doesn't actually affect
|
|
31
|
+
* the geometry of the object, only the lighting. If a normal map is defined
|
|
32
|
+
* this will be ignored.
|
|
33
|
+
*
|
|
55
34
|
* @default null
|
|
56
35
|
*/
|
|
57
36
|
bumpMap: Texture | null;
|
|
58
|
-
|
|
59
37
|
/**
|
|
38
|
+
* How much the bump map affects the material. Typical range is `[0,1]`.
|
|
39
|
+
*
|
|
60
40
|
* @default 1
|
|
61
41
|
*/
|
|
62
42
|
bumpScale: number;
|
|
63
|
-
|
|
64
43
|
/**
|
|
44
|
+
* The texture to create a normal map. The RGB values affect the surface
|
|
45
|
+
* normal for each pixel fragment and change the way the color is lit. Normal
|
|
46
|
+
* maps do not change the actual shape of the surface, only the lighting. In
|
|
47
|
+
* case the material has a normal map authored using the left handed
|
|
48
|
+
* convention, the `y` component of `normalScale` should be negated to compensate
|
|
49
|
+
* for the different handedness.
|
|
50
|
+
*
|
|
65
51
|
* @default null
|
|
66
52
|
*/
|
|
67
53
|
normalMap: Texture | null;
|
|
68
|
-
|
|
69
54
|
/**
|
|
70
|
-
*
|
|
55
|
+
* The type of normal map.
|
|
56
|
+
*
|
|
57
|
+
* @default TangentSpaceNormalMap
|
|
71
58
|
*/
|
|
72
59
|
normalMapType: NormalMapTypes;
|
|
73
|
-
|
|
74
60
|
/**
|
|
75
|
-
*
|
|
61
|
+
* How much the normal map affects the material. Typical value range is `[0,1]`.
|
|
62
|
+
*
|
|
63
|
+
* @default (1,1)
|
|
76
64
|
*/
|
|
77
65
|
normalScale: Vector2;
|
|
78
|
-
|
|
79
66
|
/**
|
|
67
|
+
* The displacement map affects the position of the mesh's vertices. Unlike
|
|
68
|
+
* other maps which only affect the light and shade of the material the
|
|
69
|
+
* displaced vertices can cast shadows, block other objects, and otherwise
|
|
70
|
+
* act as real geometry. The displacement texture is an image where the value
|
|
71
|
+
* of each pixel (white being the highest) is mapped against, and
|
|
72
|
+
* repositions, the vertices of the mesh.
|
|
73
|
+
*
|
|
80
74
|
* @default null
|
|
81
75
|
*/
|
|
82
76
|
displacementMap: Texture | null;
|
|
83
|
-
|
|
84
77
|
/**
|
|
85
|
-
*
|
|
78
|
+
* How much the displacement map affects the mesh (where black is no
|
|
79
|
+
* displacement, and white is maximum displacement). Without a displacement
|
|
80
|
+
* map set, this value is not applied.
|
|
81
|
+
*
|
|
82
|
+
* @default 0
|
|
86
83
|
*/
|
|
87
84
|
displacementScale: number;
|
|
88
|
-
|
|
89
85
|
/**
|
|
86
|
+
* The offset of the displacement map's values on the mesh's vertices.
|
|
87
|
+
* The bias is added to the scaled sample of the displacement map.
|
|
88
|
+
* Without a displacement map set, this value is not applied.
|
|
89
|
+
*
|
|
90
90
|
* @default 0
|
|
91
91
|
*/
|
|
92
92
|
displacementBias: number;
|
|
93
|
-
|
|
94
93
|
/**
|
|
94
|
+
* The alpha map is a grayscale texture that controls the opacity across the
|
|
95
|
+
* surface (black: fully transparent; white: fully opaque).
|
|
96
|
+
*
|
|
97
|
+
* Only the color of the texture is used, ignoring the alpha channel if one
|
|
98
|
+
* exists. For RGB and RGBA textures, the renderer will use the green channel
|
|
99
|
+
* when sampling this texture due to the extra bit of precision provided for
|
|
100
|
+
* green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
|
|
101
|
+
* luminance/alpha textures will also still work as expected.
|
|
102
|
+
*
|
|
95
103
|
* @default null
|
|
96
104
|
*/
|
|
97
105
|
alphaMap: Texture | null;
|
|
98
|
-
|
|
99
106
|
/**
|
|
100
|
-
*
|
|
107
|
+
* Whether the material is rendered with flat shading or not.
|
|
108
|
+
*
|
|
101
109
|
* @default false
|
|
102
110
|
*/
|
|
103
111
|
flatShading: boolean;
|
|
104
|
-
|
|
105
112
|
/**
|
|
106
|
-
* Whether the material is affected by fog
|
|
107
|
-
*
|
|
113
|
+
* Whether the material is affected by fog or not.
|
|
114
|
+
*
|
|
115
|
+
* @default true
|
|
108
116
|
*/
|
|
109
117
|
fog: boolean;
|
|
118
|
+
}
|
|
110
119
|
|
|
111
|
-
|
|
120
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
121
|
+
export interface MeshMatcapMaterialParameters
|
|
122
|
+
extends Partial<MapColorPropertiesToColorRepresentations<MeshMatcapMaterialProperties>>
|
|
123
|
+
{}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* This material is defined by a MatCap (or Lit Sphere) texture, which encodes the
|
|
127
|
+
* material color and shading.
|
|
128
|
+
*
|
|
129
|
+
* `MeshMatcapMaterial` does not respond to lights since the matcap image file encodes
|
|
130
|
+
* baked lighting. It will cast a shadow onto an object that receives shadows
|
|
131
|
+
* (and shadow clipping works), but it will not self-shadow or receive
|
|
132
|
+
* shadows.
|
|
133
|
+
*/
|
|
134
|
+
export class MeshMatcapMaterial extends Material {
|
|
135
|
+
/**
|
|
136
|
+
* Constructs a new mesh matcap material.
|
|
137
|
+
*
|
|
138
|
+
* @param {Object} [parameters] - An object with one or more properties
|
|
139
|
+
* defining the material's appearance. Any property of the material
|
|
140
|
+
* (including any property from inherited materials) can be passed
|
|
141
|
+
* in here. Color values can be passed any type of value accepted
|
|
142
|
+
* by {@link Color#set}.
|
|
143
|
+
*/
|
|
144
|
+
constructor(parameters?: MeshMatcapMaterialParameters);
|
|
145
|
+
/**
|
|
146
|
+
* This flag can be used for type testing.
|
|
147
|
+
*
|
|
148
|
+
* @default true
|
|
149
|
+
*/
|
|
150
|
+
readonly isMeshMatcapMaterial: boolean;
|
|
112
151
|
}
|
|
152
|
+
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
154
|
+
export interface MeshMatcapMaterial extends MeshMatcapMaterialProperties {}
|