@galacean/engine-loader 2.0.0-alpha.6 → 2.0.0-alpha.8
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 +5 -6
- package/dist/main.js.map +1 -1
- package/dist/module.js +6 -7
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
package/dist/module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Utils, AssetPromise, AnimationClip, AnimationEvent, Loader, AnimationStringCurve, Keyframe, AnimationBoolCurve, AnimationRefCurve, AnimationQuaternionCurve, AnimationColorCurve, AnimationVector4Curve, AnimationVector3Curve, AnimationVector2Curve, AnimationFloatArrayCurve, AnimationArrayCurve, AnimationFloatCurve, ModelMesh, BlendShape, Entity, Transform, Texture2D, ReferResource, DiffuseMode, BackgroundMode, resourceLoader, AssetType, AnimatorController, AnimatorControllerLayer, AnimatorStateTransition, BufferAsset, AmbientLight, TextureCube, TextureFilterMode, TextureCubeFace, ContentRestorer, Font, SystemInfo, Animator, Logger, IndexFormat, VertexElementFormat, GLCapabilityType,
|
|
1
|
+
import { Utils, AssetPromise, AnimationClip, AnimationEvent, Loader, AnimationStringCurve, Keyframe, AnimationBoolCurve, AnimationRefCurve, AnimationQuaternionCurve, AnimationColorCurve, AnimationVector4Curve, AnimationVector3Curve, AnimationVector2Curve, AnimationFloatArrayCurve, AnimationArrayCurve, AnimationFloatCurve, ModelMesh, BlendShape, Entity, Transform, Texture2D, ReferResource, DiffuseMode, BackgroundMode, resourceLoader, AssetType, AnimatorController, AnimatorControllerLayer, AnimatorStateTransition, BufferAsset, AmbientLight, TextureCube, TextureFormat, TextureFilterMode, TextureCubeFace, ContentRestorer, Font, SystemInfo, Animator, Logger, IndexFormat, VertexElementFormat, GLCapabilityType, request, InterpolationType, SkinnedMeshRenderer, PBRMaterial, TextureCoordinate, RenderFace, VertexElement, Buffer, BufferBindFlag, BufferUsage, Camera, MeshRenderer, Skin, TextureWrapMode as TextureWrapMode$1, TextureUtils, AnimatorStateMachine, JSONAsset, Shader, Material, PrimitiveMesh, SpriteAtlas, Sprite, TextAsset, AudioClip, AudioManager, ShaderFactory, ShaderLib, PhysicsMaterial, Scene, DirectLight, PointLight, SpotLight, UnlitMaterial } from '@galacean/engine-core';
|
|
2
2
|
import { Quaternion, Vector4, Color, Vector3, Vector2, SphericalHarmonics3, MathUtil, BoundingBox, Matrix, Rect } from '@galacean/engine-math';
|
|
3
3
|
import { GLCompressedTextureInternalFormat } from '@galacean/engine-rhi-webgl';
|
|
4
4
|
|
|
@@ -1720,7 +1720,6 @@ var EnvLoader = /*#__PURE__*/ function(Loader) {
|
|
|
1720
1720
|
sh.copyFromArray(new Float32Array(arraybuffer, 0, 27));
|
|
1721
1721
|
ambientLight.diffuseSphericalHarmonics = sh;
|
|
1722
1722
|
ambientLight.specularTexture = texture;
|
|
1723
|
-
ambientLight.specularTextureDecodeRGBM = true;
|
|
1724
1723
|
resolve(ambientLight);
|
|
1725
1724
|
}).catch(function(e) {
|
|
1726
1725
|
reject(e);
|
|
@@ -1733,7 +1732,7 @@ var EnvLoader = /*#__PURE__*/ function(Loader) {
|
|
|
1733
1732
|
var _this;
|
|
1734
1733
|
var shByteLength = 27 * 4;
|
|
1735
1734
|
var size = (_this = new Uint16Array(buffer, shByteLength, 1)) == null ? void 0 : _this[0];
|
|
1736
|
-
texture || (texture = new TextureCube(engine, size,
|
|
1735
|
+
texture || (texture = new TextureCube(engine, size, TextureFormat.R16G16B16A16, true, false));
|
|
1737
1736
|
texture.filterMode = TextureFilterMode.Trilinear;
|
|
1738
1737
|
var mipmapCount = texture.mipmapCount;
|
|
1739
1738
|
var offset = shByteLength + 2;
|
|
@@ -1741,8 +1740,8 @@ var EnvLoader = /*#__PURE__*/ function(Loader) {
|
|
|
1741
1740
|
var mipSize = size >> mipLevel;
|
|
1742
1741
|
for(var face = 0; face < 6; face++){
|
|
1743
1742
|
var dataSize = mipSize * mipSize * 4;
|
|
1744
|
-
var data = new
|
|
1745
|
-
offset += dataSize;
|
|
1743
|
+
var data = new Uint16Array(buffer, offset, dataSize);
|
|
1744
|
+
offset += dataSize * 2;
|
|
1746
1745
|
texture.setPixelBuffer(TextureCubeFace.PositiveX + face, data, mipLevel);
|
|
1747
1746
|
}
|
|
1748
1747
|
}
|
|
@@ -6239,7 +6238,8 @@ var Texture2DContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
|
|
|
6239
6238
|
var scaleFactor = Math.pow(2, pixels[srcIndex + 3] - 128) / 255;
|
|
6240
6239
|
var dstIndex = y * texSize * 4 + x * 4;
|
|
6241
6240
|
for(var c = 0; c < 3; c++){
|
|
6242
|
-
|
|
6241
|
+
// Clamp to half-float max (65504) to prevent Infinity in R16G16B16A16
|
|
6242
|
+
floatView[0] = Math.min(pixels[srcIndex + c] * scaleFactor, 65504);
|
|
6243
6243
|
var f = uint32View[0];
|
|
6244
6244
|
var e = f >> 23 & 0x1ff;
|
|
6245
6245
|
facePixels[dstIndex + c] = baseTable[e] + ((f & 0x007fffff) >> shiftTable[e]);
|
|
@@ -6719,7 +6719,6 @@ var SceneLoader = /*#__PURE__*/ function(Loader) {
|
|
|
6719
6719
|
scene.ambientLight.specularIntensity = ambient.specularIntensity;
|
|
6720
6720
|
scene.ambientLight.diffuseMode = ambient.diffuseMode;
|
|
6721
6721
|
scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
|
|
6722
|
-
scene.ambientLight.specularTextureDecodeRGBM = true;
|
|
6723
6722
|
if (useCustomAmbient && ambient.customAmbientLight) {
|
|
6724
6723
|
promises.push(// @ts-ignore
|
|
6725
6724
|
resourceManager.getResourceByRef(ambient.customAmbientLight).then(function(ambientLight) {
|