Texture repeat not working

I have a texture generated with a WebGLRenderTarget. I’m setting wrapS and wrapT and repeat but it appears to still be using Clamp. Any suggestions?

const map = renderTarget.texture;
map.wrapS = THREE.RepeatWrapping;
map.wrapT = THREE.RepeatWrapping;
map.repeat.set( 1, 1 );

const map = renderTarget.texture;
map.wrapS = THREE.RepeatWrapping;
map.wrapT = THREE.RepeatWrapping;
map.repeat.set( 2, 2 );

Maybe need for this generateMipmaps: true

const renderTarget = new THREE.WebGLRenderTarget(256, 256, {
generateMipmaps: true,
minFilter: THREE.LinearMipmapLinearFilter, 
magFilter: THREE.LinearFilter,            
});

Setting wrapS and wrapT at constructor time fixed it. Thanks for putting me on the right track

If you change the wrapping mode you have to set texture.needsUpdate = true.

1 Like

I actually tried that and it still didn’t work. The only way I could get it to work is at construct time.

const renderTarget = new THREE.WebGLRenderTarget(128, 128, {
     generateMipmaps: true, 
     wrapS: THREE.RepeatWrapping,
     wrapT: THREE.RepeatWrapping,
     minFilter: THREE.LinearMipmapLinearFilter
});