@yschindel/ara3d-webgl 1.3.1 → 1.3.3
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.
- package/dist/ara3d-webgl.mjs +6348 -6296
- package/dist/ara3d-webgl.mjs.map +1 -1
- package/dist/ara3d-webgl.umd.js +172 -172
- package/dist/ara3d-webgl.umd.js.map +1 -1
- package/dist/types/viewer/environment.d.ts +3 -1
- package/dist/types/viewer/rendering/renderer.d.ts +1 -0
- package/dist/types/viewer/viewerSettings.d.ts +44 -0
- package/package.json +1 -1
|
@@ -16,13 +16,14 @@ export declare class GroundPlane {
|
|
|
16
16
|
}
|
|
17
17
|
export declare class Environment {
|
|
18
18
|
skyLight: THREE.HemisphereLight;
|
|
19
|
+
ambientLight: THREE.AmbientLight;
|
|
19
20
|
sunLights: THREE.DirectionalLight[];
|
|
20
21
|
private _groundPlane;
|
|
21
22
|
get groundPlane(): THREE.Mesh;
|
|
22
23
|
constructor(settings: Settings);
|
|
23
24
|
loadGroundTexture(encoding: TextureEncoding, url: string): void;
|
|
24
25
|
/**
|
|
25
|
-
* Returns all
|
|
26
|
+
* Returns all objects composing the environment
|
|
26
27
|
*/
|
|
27
28
|
getObjects(): THREE.Object3D[];
|
|
28
29
|
applySettings(settings: Settings): void;
|
|
@@ -34,6 +35,7 @@ export declare class Environment {
|
|
|
34
35
|
}
|
|
35
36
|
export interface IEnvironment {
|
|
36
37
|
skyLight: THREE.HemisphereLight;
|
|
38
|
+
ambientLight: THREE.AmbientLight;
|
|
37
39
|
sunLights: THREE.DirectionalLight[];
|
|
38
40
|
groundPlane: THREE.Mesh;
|
|
39
41
|
}
|
|
@@ -10,6 +10,7 @@ export declare class Renderer {
|
|
|
10
10
|
camera: Camera;
|
|
11
11
|
needsUpdate: boolean;
|
|
12
12
|
constructor(scene: THREE.Scene, viewport: Viewport, camera: Camera, settings: Settings);
|
|
13
|
+
applyRenderingSettings(settings: Settings): void;
|
|
13
14
|
dispose(): void;
|
|
14
15
|
get background(): THREE.Color | THREE.Texture;
|
|
15
16
|
set background(color: THREE.Color | THREE.Texture);
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
export type TextureEncoding = 'url' | 'base64' | undefined;
|
|
3
3
|
export { GizmoOptions } from './gizmos/gizmoAxes';
|
|
4
|
+
/**
|
|
5
|
+
* Example: Neutral lighting setup for color calibration or asset review
|
|
6
|
+
*
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const neutralSettings = {
|
|
9
|
+
* skylight: {
|
|
10
|
+
* intensity: 0 // Disable hemisphere light for neutral lighting
|
|
11
|
+
* },
|
|
12
|
+
* ambientLight: {
|
|
13
|
+
* color: new THREE.Color(0xffffff),
|
|
14
|
+
* intensity: 0.5 // Base level of even illumination
|
|
15
|
+
* },
|
|
16
|
+
* sunLights: [
|
|
17
|
+
* {
|
|
18
|
+
* position: new THREE.Vector3(5, 10, 7.5),
|
|
19
|
+
* color: new THREE.Color(0xffffff),
|
|
20
|
+
* intensity: 1 // Primary directional light
|
|
21
|
+
* }
|
|
22
|
+
* ],
|
|
23
|
+
* rendering: {
|
|
24
|
+
* toneMapping: THREE.ACESFilmicToneMapping,
|
|
25
|
+
* toneMappingExposure: 1.0
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
4
30
|
/**
|
|
5
31
|
* Makes all field optional recursively
|
|
6
32
|
* https://stackoverflow.com/questions/41980195/recursive-partialt-in-typescript
|
|
@@ -87,12 +113,21 @@ export type Settings = {
|
|
|
87
113
|
};
|
|
88
114
|
/**
|
|
89
115
|
* Skylight (hemisphere light) options
|
|
116
|
+
* Used for natural lighting with sky/ground color variation
|
|
90
117
|
*/
|
|
91
118
|
skylight: {
|
|
92
119
|
skyColor: THREE.Color;
|
|
93
120
|
groundColor: THREE.Color;
|
|
94
121
|
intensity: number;
|
|
95
122
|
};
|
|
123
|
+
/**
|
|
124
|
+
* Ambient light options
|
|
125
|
+
* Used for neutral lighting setup (even illumination without color casts)
|
|
126
|
+
*/
|
|
127
|
+
ambientLight: {
|
|
128
|
+
color: THREE.Color;
|
|
129
|
+
intensity: number;
|
|
130
|
+
};
|
|
96
131
|
/**
|
|
97
132
|
* Sunlight (directional light) options
|
|
98
133
|
*/
|
|
@@ -103,6 +138,15 @@ export type Settings = {
|
|
|
103
138
|
}[];
|
|
104
139
|
rendering: {
|
|
105
140
|
onDemand: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Tone mapping mode for the renderer
|
|
143
|
+
* ACESFilmicToneMapping is recommended for realistic results and wider dynamic range
|
|
144
|
+
*/
|
|
145
|
+
toneMapping: THREE.ToneMapping;
|
|
146
|
+
/**
|
|
147
|
+
* Tone mapping exposure value
|
|
148
|
+
*/
|
|
149
|
+
toneMappingExposure: number;
|
|
106
150
|
};
|
|
107
151
|
};
|
|
108
152
|
export type PartialSettings = RecursivePartial<Settings>;
|