itowns 2.44.3-next.38 → 2.44.3-next.39
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/examples/3dtiles_loader.html +12 -1
- package/package.json +1 -1
|
@@ -57,8 +57,12 @@
|
|
|
57
57
|
</script>
|
|
58
58
|
|
|
59
59
|
<script type="module">
|
|
60
|
-
import {
|
|
60
|
+
import {
|
|
61
|
+
AmbientLight,
|
|
62
|
+
PMREMGenerator,
|
|
63
|
+
} from 'three';
|
|
61
64
|
import { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js';
|
|
65
|
+
import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';
|
|
62
66
|
import {
|
|
63
67
|
zoomToLayer,
|
|
64
68
|
fillHTMLWithPickingInfo,
|
|
@@ -106,6 +110,13 @@
|
|
|
106
110
|
const light = new AmbientLight(0x404040, 40);
|
|
107
111
|
view.scene.add(light);
|
|
108
112
|
|
|
113
|
+
// Set the environment map for all physical materials in the scene.
|
|
114
|
+
// Otherwise, mesh with only diffuse colors will appear black.
|
|
115
|
+
const environment = new RoomEnvironment();
|
|
116
|
+
const pmremGenerator = new PMREMGenerator(view.renderer);
|
|
117
|
+
view.scene.environment = pmremGenerator.fromScene(environment).texture;
|
|
118
|
+
pmremGenerator.dispose();
|
|
119
|
+
|
|
109
120
|
// Setup loading screen
|
|
110
121
|
setupLoadingScreen(viewerDiv, view);
|
|
111
122
|
|