It won’t work because the texture has float components and .png files only use 8-bits per component: the file saved by the inspector is only an approximation of the real texture.
You will need to save yourself the instancedBaker.rawPixels
data (as well as the instancedBaker.imageWidth
and instancedBaker.imageHeight
values) in a custom file, making sure to save floats. Then you can reload it and use the same call to recreate the texture:
const boneTexture = BABYLON.RawTexture.CreateRGBATexture(savedPixels, savedWidth,
savedHeight, scene, false, false, BABYLON.Texture.NEAREST_NEAREST,
BABYLON.Constants.TEXTURETYPE_FLOAT);
Note that Texture
won’t let you create textures with float components, you must use a raw texture for that.