Yo @bghgary and @Deltakosh (maybe @sebavan ) … I got a situation where i am exporting HDR Lightmaps (Packed as RGBD 8-Bit PNG)… I need to set the Texture.isRGBD = true from the GLTF Parse… The problem is… Textures use an Internal Texture called _texture that is not available UNTIL the the texture is actually READY
So setting texture.isRGBD = true does nothing until then… So how would i set the isRGBD since there is not Texture.OnReady observable i can hook into…
How can i handle that in GLTF… Can we add a Texture.OnReadyObservable
FYI… I am using loader.loadTextureInfoAsync to load the actual lightmap Texture like this
promises.push(this._loader.loadTextureInfoAsync(context + "/lightmapTexture", commonConstant.lightmapTexture, (texture) => {
texture.name = `${sourceMaterial.name} (Light Map)`;
texture.level = (commonConstant.lightmapLevel) ? commonConstant.lightmapLevel : 1;
texture.gammaSpace = false;
commonMaterial.lightmapTexture = texture;
commonMaterial.useLightmapAsShadowmap = true;
if (BABYLON.Utilities.HasOwnProperty(commonMaterial, "ambientColor")) {
commonMaterial.ambientColor = BABYLON.Color3.White();
}
if (this._textureList != null) this._textureList.push(texture);
}));