@galacean/engine-loader 1.4.15 → 1.5.0-alpha.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.
- package/dist/main.js +100 -44
- package/dist/main.js.map +1 -1
- package/dist/module.js +101 -45
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/Texture2DLoader.d.ts +2 -0
- package/types/gltf/GLTFUtils.d.ts +1 -1
- package/types/gltf/parser/GLTFTextureParser.d.ts +2 -1
- package/types/ktx2/KTX2Container.d.ts +4 -0
- package/types/ktx2/KTX2Loader.d.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0-alpha.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"types/**/*"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@galacean/engine-core": "1.
|
|
22
|
-
"@galacean/engine-math": "1.
|
|
23
|
-
"@galacean/engine-rhi-webgl": "1.
|
|
21
|
+
"@galacean/engine-core": "1.5.0-alpha.1",
|
|
22
|
+
"@galacean/engine-math": "1.5.0-alpha.1",
|
|
23
|
+
"@galacean/engine-rhi-webgl": "1.5.0-alpha.1"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"b:types": "tsc"
|
|
@@ -15,4 +15,6 @@ export interface Texture2DParams {
|
|
|
15
15
|
filterMode: TextureFilterMode;
|
|
16
16
|
/** Anisotropic level for texture. */
|
|
17
17
|
anisoLevel: number;
|
|
18
|
+
/** Whether the texture data is in sRGB color space, otherwise is linear color space. @defaultValue `true` */
|
|
19
|
+
isSRGBColorSpace: boolean;
|
|
18
20
|
}
|
|
@@ -31,7 +31,7 @@ export declare class GLTFUtils {
|
|
|
31
31
|
/**
|
|
32
32
|
* Load image buffer
|
|
33
33
|
*/
|
|
34
|
-
static loadImageBuffer(imageBuffer:
|
|
34
|
+
static loadImageBuffer(imageBuffer: TypedArray, type: string): Promise<HTMLImageElement>;
|
|
35
35
|
/**
|
|
36
36
|
* Parse the glb format.
|
|
37
37
|
*/
|
|
@@ -9,6 +9,7 @@ export declare class GLTFTextureParser extends GLTFParser {
|
|
|
9
9
|
10497: TextureWrapMode;
|
|
10
10
|
};
|
|
11
11
|
/** @internal */
|
|
12
|
-
static _parseTexture(context: GLTFParserContext, imageIndex: number, textureIndex: number, sampler?: number, textureName?: string): AssetPromise<Texture2D>;
|
|
12
|
+
static _parseTexture(context: GLTFParserContext, imageIndex: number, textureIndex: number, sampler?: number, textureName?: string, isSRGBColorSpace?: boolean): AssetPromise<Texture2D>;
|
|
13
13
|
parse(context: GLTFParserContext, textureIndex: number): AssetPromise<Texture>;
|
|
14
|
+
private _isSRGBColorSpace;
|
|
14
15
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AssetPromise, Engine, EngineConfiguration, LoadItem, Loader, ResourceManager, Texture2D, TextureCube } from "@galacean/engine-core";
|
|
2
|
+
import { KTX2Container } from "./KTX2Container";
|
|
2
3
|
import { KTX2TargetFormat } from "./KTX2TargetFormat";
|
|
3
4
|
import { TranscodeResult } from "./transcoder/AbstractTranscoder";
|
|
4
5
|
export declare class KTX2Loader extends Loader<Texture2D | TextureCube> {
|
|
@@ -6,7 +7,7 @@ export declare class KTX2Loader extends Loader<Texture2D | TextureCube> {
|
|
|
6
7
|
private static _binomialLLCTranscoder;
|
|
7
8
|
private static _khronosTranscoder;
|
|
8
9
|
private static _priorityFormats;
|
|
9
|
-
private static
|
|
10
|
+
private static _capabilityMap;
|
|
10
11
|
/**
|
|
11
12
|
* Release ktx2 transcoder worker.
|
|
12
13
|
* @remarks If use loader after releasing, we should release again.
|
|
@@ -14,13 +15,14 @@ export declare class KTX2Loader extends Loader<Texture2D | TextureCube> {
|
|
|
14
15
|
static release(): void;
|
|
15
16
|
/** @internal */
|
|
16
17
|
static _parseBuffer(buffer: Uint8Array, engine: Engine, params?: KTX2Params): Promise<{
|
|
18
|
+
ktx2Container: KTX2Container;
|
|
17
19
|
engine: Engine;
|
|
18
20
|
result: TranscodeResult;
|
|
19
21
|
targetFormat: KTX2TargetFormat;
|
|
20
22
|
params: Uint8Array;
|
|
21
23
|
}>;
|
|
22
24
|
/** @internal */
|
|
23
|
-
static _createTextureByBuffer(engine: Engine, transcodeResult: TranscodeResult, targetFormat: KTX2TargetFormat, params?: Uint8Array): Texture2D | TextureCube;
|
|
25
|
+
static _createTextureByBuffer(engine: Engine, isSRGB: boolean, transcodeResult: TranscodeResult, targetFormat: KTX2TargetFormat, params?: Uint8Array): Texture2D | TextureCube;
|
|
24
26
|
private static _decideTargetFormat;
|
|
25
27
|
private static _detectSupportedFormat;
|
|
26
28
|
private static _getBinomialLLCTranscoder;
|