Skip to content

Commit 866c03f

Browse files
authored
Revert "updated to three.js r151 (#4186)" (#4191)
This reverts commit 640b554.
1 parent 640b554 commit 866c03f

File tree

89 files changed

+716
-828
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+716
-828
lines changed

package-lock.json

Lines changed: 212 additions & 225 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/model-viewer/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module.exports = function(config) {
7373
customLaunchers: {
7474
ChromeHeadlessNoSandbox: {
7575
base: 'ChromeHeadless',
76-
flags: ['--no-sandbox', '--use-angle=metal'],
76+
flags: ['--no-sandbox'],
7777
}
7878
},
7979
});

packages/model-viewer/package-lock.json

Lines changed: 170 additions & 227 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/model-viewer/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"lit": "^2.2.3"
7777
},
7878
"peerDependencies": {
79-
"three": "^0.151.2"
79+
"three": "^0.150.0"
8080
},
8181
"devDependencies": {
8282
"@open-wc/karma-esm": "^4.0.0",
@@ -86,7 +86,7 @@
8686
"@types/chai": "^4.3.1",
8787
"@types/mocha": "^9.1.1",
8888
"@types/pngjs": "^6.0.1",
89-
"@types/three": "^0.150.0",
89+
"@types/three": "^0.149.0",
9090
"@ungap/event-target": "^0.2.3",
9191
"chai": "^4.3.6",
9292
"focus-visible": "^5.2.0",
@@ -106,7 +106,7 @@
106106
"rollup-plugin-polyfill": "^3.0.0",
107107
"rollup-plugin-terser": "^7.0.2",
108108
"typescript": "4.8.4",
109-
"three": "^0.151.2"
109+
"three": "^0.150.0"
110110
},
111111
"publishConfig": {
112112
"access": "public"

packages/model-viewer/src/features/scene-graph/material.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* limitations under the License.
1414
*/
1515

16-
import {Color, ColorRepresentation, DoubleSide, FrontSide, MeshStandardMaterial} from 'three';
16+
import {Color, DoubleSide, FrontSide, MeshStandardMaterial} from 'three';
1717

1818
import {AlphaMode, GLTF, Material as GLTFMaterial, RGB} from '../../three-components/gltf-instance/gltf-2.0.js';
1919
import {Material as DefaultedMaterial} from '../../three-components/gltf-instance/gltf-defaulted.js';
@@ -258,7 +258,7 @@ export class Material extends ThreeDOMElement implements MaterialInterface {
258258
if (rgb instanceof Array) {
259259
color.fromArray(rgb);
260260
} else {
261-
color.set(rgb as ColorRepresentation).convertSRGBToLinear();
261+
color.set(rgb).convertSRGBToLinear();
262262
}
263263
for (const material of this[$correlatedObjects] as
264264
Set<MeshStandardMaterial>) {

packages/model-viewer/src/features/scene-graph/pbr-metallic-roughness.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* limitations under the License.
1414
*/
1515

16-
import {Color, ColorRepresentation, MeshStandardMaterial} from 'three';
16+
import {Color, MeshStandardMaterial} from 'three';
1717

1818
import {GLTF, PBRMetallicRoughness as GLTFPBRMetallicRoughness} from '../../three-components/gltf-instance/gltf-2.0.js';
1919
import {PBRMetallicRoughness as DefaultedPBRMetallicRoughness} from '../../three-components/gltf-instance/gltf-defaulted.js';
@@ -110,7 +110,7 @@ export class PBRMetallicRoughness extends ThreeDOMElement implements
110110
if (rgba instanceof Array) {
111111
color.fromArray(rgba);
112112
} else {
113-
color.set(rgba as ColorRepresentation).convertSRGBToLinear();
113+
color.set(rgba).convertSRGBToLinear();
114114
}
115115
for (const material of this[$threeMaterials]) {
116116
material.color.set(color);

packages/model-viewer/src/three-components/ModelScene.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* limitations under the License.
1414
*/
1515

16-
import {AnimationAction, AnimationActionLoopStyles, AnimationClip, AnimationMixer, Box3, Camera, Euler, Event as ThreeEvent, LoopPingPong, LoopRepeat, Material, Matrix3, Mesh, Object3D, PerspectiveCamera, Raycaster, Scene, Sphere, Texture, Triangle, Vector2, Vector3, WebGLRenderer} from 'three';
16+
import {AnimationAction, AnimationClip, AnimationMixer, Box3, Camera, Euler, Event as ThreeEvent, LoopPingPong, LoopRepeat, Material, Matrix3, Mesh, Object3D, PerspectiveCamera, Raycaster, Scene, Sphere, Texture, Triangle, Vector2, Vector3, WebGLRenderer} from 'three';
1717
import {CSS2DRenderer} from 'three/examples/jsm/renderers/CSS2DRenderer.js';
1818
// @ts-ignore
1919
import {reduceVertices} from 'three/examples/jsm/utils/SceneUtils.js';
@@ -663,8 +663,7 @@ export class ModelScene extends Scene {
663663
*/
664664
playAnimation(
665665
name: string|null = null, crossfadeTime: number = 0,
666-
loopMode: AnimationActionLoopStyles = LoopRepeat,
667-
repetitionCount: number = Infinity) {
666+
loopMode: number = LoopRepeat, repetitionCount: number = Infinity) {
668667
if (this._currentGLTF == null) {
669668
return;
670669
}

packages/model-viewer/src/three-components/Renderer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export class Renderer extends EventDispatcher {
147147
});
148148
this.threeRenderer.autoClear = true;
149149
this.threeRenderer.outputEncoding = sRGBEncoding;
150+
this.threeRenderer.physicallyCorrectLights = true;
150151
this.threeRenderer.setPixelRatio(1); // handle pixel ratio externally
151152

152153
this.debugger = !!options.debug ? new Debugger(this) : null;

packages/modelviewer.dev/package-lock.json

Lines changed: 24 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)