Size of external texture

Hi,

Trying to customize the texture of a chair in my scene with external textures using this example GitHub - shapespark/shapespark-viewer-api: JavaScript API for interacting with the Shapespark 3D scene.

Do the textures need to be a square of dimensions in multiple of 2(512512 or 256256)? Can i use a rectangle(600*400)?

Currently getting an error if i don’t use a texture which is a square with dimension in multiple of 2.

If the texture is repeated it must have power-of-two dimensions, however it doesn’t need to be a square. So, both 512x512 and 512x256 will work.

Thank you, that clarifies a lot of things for us.

Hi,

Referring to this same link I also created one simple project where I am replacing 9 textures in object A, and another 9 textures in object B. i need to do this same things with total 4 object and 36 textures.
Is that possible ?

But while doing the same thing with other object B with another 9 texture, shapespark stops working, even though it seems that the whole file is corrupted and it’s not even opening. I am not a code expert so I am attaching my edited code for reference.

`

var viewer = WALK.getViewer(); viewer.setMaterialEditable('material2'); var textureElementIds = ['carpet1', 'carpet2', 'carpet3', 'carpet4', 'carpet5', 'carpet6', 'carpet7', 'carpet8', 'carpet9']; textureElementIds.forEach(function(textureElementId) { var textureElement = document.getElementById(textureElementId); var texture = null; textureElement.addEventListener('click', function() { if (texture === null) { if (textureElement instanceof HTMLVideoElement) { texture = viewer.createTextureFromHtmlVideo(textureElement); } else { texture = viewer.createTextureFromHtmlImage(textureElement); } } var material = viewer.findMaterial('material2'); material.baseColorTexture = texture; viewer.requestFrame(); }); }); </script`

Could you share a link to the scene, so we could take a closer look at the issue?