Can we skip the ready check in screenshots?

Quick update here: we implemented this code and when we invoke it before every screenshot, it solves the issue.

const textureNames = [
  'albedoTexture',
  'bumpTexture',
  'emissiveTexture',
  'metallicTexture',
  'opacityTexture',
  'reflectanceTexture',
  'reflectionTexture',
  'refractionTexture',
];

export const validateAndFixMaterialTexures = () => {
  Engine.LastCreatedScene.meshes.forEach(mesh => {
    if (mesh.material) {
      textureNames.forEach(texName => {
        if (!mesh.material[texName]?._texture) {
          mesh.material[texName] = null;
        }
      });
    }
  });
};

Just a confirmation that this is the source of our problems…

2 Likes