Can't repeat my texture

Hi,

I have a box geometry and its a rectangle. i want the texture to be repeated. but it doenst work.
if i take crate.repeat.set(4,4) away it only shows the texture but he doesnt repeat it.
if i add crate.repeat.set(4,4) my whole canvas is black.

Can someone help me?

code:

	var textureLoader = new THREE.TextureLoader();
crateTexture = textureLoader.load("crate0/crate0_diffuse.png");
crateBumpMap = textureLoader.load("crate0/crate0_bump.png");
crateNormalMap = textureLoader.load("crate0/crate0_normal.png");


crate = new THREE.Mesh(
	new THREE.BoxGeometry(3,3,3),
	new THREE.MeshPhongMaterial({
		color:0xffffff,
		
		map:crateTexture,
		bumpMap:crateBumpMap,
		normalMap:crateNormalMap
	})
);
crate.wrapS = THREE.RepeatWrapping;
crate.wrapT = THREE.RepeatWrapping;
crate.repeat.set(4,4);
scene.add(crate);
crate.position.set(2.5, 3/2, 2.5);
crate.receiveShadow = true;
crate.castShadow = true;

wrapS, wrapT and repeat belong to THREE.Texture(), not to THREE.Mesh().

3 Likes

Yeaah it works now… im dumb

But thanks for your comment!<3

1 Like

You’re welcome :beers: