I want to apply this texture to one part of my yacht model:
In Blender it looks quite normal:
But in my browser I am getting this ugly result:
My code looks like this:
import { TextureLoader, MeshBasicMaterial } from 'three'
import leatherImage from '../../../assets/fabric_leather_02_diff_1k.jpg'
const initialTexture = new TextureLoader().load(leatherImage)
export const initialMaterial5 = new MeshBasicMaterial({ map: initialTexture })
//...
;(model.children[5] as Mesh).material = initialMaterial5
I have no idea what am I doing wrong here. UV vectors seem to be normal and other textures are also work quite fine.
Will be grateful for any ideas on how to solve this!
Problem was that the texture is not «big» enough to map correctly. I’ve explicitly specified this properties to make sure that texture will be repeated to fully map the model even if it is relatively small:
initialTexture.wrapS = initialTexture.wrapT = THREE.RepeatWrapping
initialTexture.repeat.set(3, 3)