Use one image for several different textures

Hello community!

In my scene I use different BoxGeometries and ExtrudeGeometries. For each object I want to use texture with same image, but different parameters of scale and offset. Texture.clone and material.clone doesn’t work. I can’t find any decision for make it.

@Denis please can you share a code pen for this problem

1 Like

What you do you mean wiht “does not work”? Texture.clone() should exactly do what you are looking for.

this is my code
http://jsfiddle.net/dvisik/f98zomvc/
I’m trying to clone texture to texture2 and change offset and scale parameters for texture2. But see just black color

Updated fiddle: http://jsfiddle.net/xkds6b0o/

When cloning a texture, you have to tell the renderer when a texture upload is required. Hence, you have to add the following code to your onLoad() callback.

texture2.needsUpdate = true;
1 Like

same we have to do for the mesh right @Mugen87

Thank you for help!

Meshes do not have a needsUpdate flag.

1 Like