Skip to content

Commit

Permalink
Handle missing texture data
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusLongmuir committed Dec 8, 2023
1 parent c97262c commit 7bbd062
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { forEachMapKey } from "./materials/forEachMapKey";
import { Step } from "./types";

function fixTexture(texture: Texture, setDefaultColorIfMissing: boolean = false): Texture | null {
if (!texture.image) {
if (!texture.image || texture.image.data === null) {
// Replace with a placeholder texture (all white)
const placeholderTexture = new THREE.Texture();
placeholderTexture.image = new ImageData(1, 1);
Expand Down

0 comments on commit 7bbd062

Please sign in to comment.