Skip to content

Commit

Permalink
fix texture encoding in drag and drop texture
Browse files Browse the repository at this point in the history
  • Loading branch information
memelotsqui committed Nov 15, 2023
1 parent 327063c commit badf39f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/library/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export async function setTextureToChildMeshes(scene, textureFile){

// Load the image as a texture
const texture = await textureLoader.load(textureFile);
texture.encoding = THREE.sRGBEncoding;
texture.flipY = false;

// Traverse through the child meshes in the scene
Expand All @@ -53,8 +54,8 @@ export async function setTextureToChildMeshes(scene, textureFile){
}
else{
materials[i].map = texture
materials[i].emissiveMap = texture
}
console.log(materials[i]);
materials[i].needsUpdate = true

}
Expand Down

0 comments on commit badf39f

Please sign in to comment.