three-stdlib 2.22.10 → 2.23.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
|
|
1
|
-
import { EventDispatcher, MOUSE, PerspectiveCamera, OrthographicCamera } from 'three';
|
1
|
+
import { EventDispatcher, MOUSE, Vector3, PerspectiveCamera, OrthographicCamera } from 'three';
|
2
2
|
declare class TrackballControls extends EventDispatcher {
|
3
3
|
enabled: boolean;
|
4
4
|
screen: {
|
@@ -26,7 +26,7 @@ declare class TrackballControls extends EventDispatcher {
|
|
26
26
|
object: PerspectiveCamera | OrthographicCamera;
|
27
27
|
domElement: HTMLElement | undefined;
|
28
28
|
cursorZoom: boolean;
|
29
|
-
|
29
|
+
readonly target: Vector3;
|
30
30
|
private mousePosition;
|
31
31
|
private STATE;
|
32
32
|
private EPS;
|
@@ -514,7 +514,7 @@ class GLTFWriter {
|
|
514
514
|
if (metalnessMap === roughnessMap)
|
515
515
|
return metalnessMap;
|
516
516
|
function getEncodingConversion(map) {
|
517
|
-
if (map.colorSpace ===
|
517
|
+
if ("colorSpace" in map ? map.colorSpace === "srgb" : map.encoding === 3001) {
|
518
518
|
return function SRGBToLinear(c) {
|
519
519
|
return c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);
|
520
520
|
};
|
@@ -561,7 +561,10 @@ class GLTFWriter {
|
|
561
561
|
const reference = metalnessMap || roughnessMap;
|
562
562
|
const texture = reference.clone();
|
563
563
|
texture.source = new THREE.Source(canvas);
|
564
|
-
|
564
|
+
if ("colorSpace" in texture)
|
565
|
+
texture.colorSpace = "";
|
566
|
+
else
|
567
|
+
texture.encoding = 3e3;
|
565
568
|
texture.channel = (metalnessMap || roughnessMap).channel;
|
566
569
|
if (metalnessMap && roughnessMap && metalnessMap.channel !== roughnessMap.channel) {
|
567
570
|
console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match.");
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { PlaneGeometry, ShaderMaterial, Uniform, Mesh, PerspectiveCamera, Scene, WebGLRenderer, Texture, NearestFilter, NearestMipmapNearestFilter, NearestMipmapLinearFilter, LinearFilter, LinearMipmapNearestFilter, LinearMipmapLinearFilter, ClampToEdgeWrapping, RepeatWrapping, MirroredRepeatWrapping, Color, MathUtils, Vector3,
|
1
|
+
import { PlaneGeometry, ShaderMaterial, Uniform, Mesh, PerspectiveCamera, Scene, WebGLRenderer, Texture, NearestFilter, NearestMipmapNearestFilter, NearestMipmapLinearFilter, LinearFilter, LinearMipmapNearestFilter, LinearMipmapLinearFilter, ClampToEdgeWrapping, RepeatWrapping, MirroredRepeatWrapping, Color, MathUtils, Vector3, CompressedTexture, Source, RGBAFormat, DoubleSide, REVISION, BufferAttribute, PropertyBinding, InterpolateDiscrete, Matrix4, InterpolateLinear } from "three";
|
2
2
|
let _renderer;
|
3
3
|
let fullscreenQuadGeometry;
|
4
4
|
let fullscreenQuadMaterial;
|
@@ -512,7 +512,7 @@ class GLTFWriter {
|
|
512
512
|
if (metalnessMap === roughnessMap)
|
513
513
|
return metalnessMap;
|
514
514
|
function getEncodingConversion(map) {
|
515
|
-
if (map.colorSpace ===
|
515
|
+
if ("colorSpace" in map ? map.colorSpace === "srgb" : map.encoding === 3001) {
|
516
516
|
return function SRGBToLinear(c) {
|
517
517
|
return c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);
|
518
518
|
};
|
@@ -559,7 +559,10 @@ class GLTFWriter {
|
|
559
559
|
const reference = metalnessMap || roughnessMap;
|
560
560
|
const texture = reference.clone();
|
561
561
|
texture.source = new Source(canvas);
|
562
|
-
|
562
|
+
if ("colorSpace" in texture)
|
563
|
+
texture.colorSpace = "";
|
564
|
+
else
|
565
|
+
texture.encoding = 3e3;
|
563
566
|
texture.channel = (metalnessMap || roughnessMap).channel;
|
564
567
|
if (metalnessMap && roughnessMap && metalnessMap.channel !== roughnessMap.channel) {
|
565
568
|
console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match.");
|