DynamicTexture uScale, vScale not working as expected

Hi there, when setting uScale and vScale of a DynamicTexture the canvas is not repeating properly.

For example, here is a playground where the canvas (which has lines drawn through the middle of it) should be repeated 4 times in each direction, creating a simple grid.

uScale and vScale are set on lines 30 and 31, if you want to comment them out to see how the canvas is drawn normally.

And if you uncomment line 27, it will replace the DynamicTexture with a Texture created from crate.png, in which case uScale and vScale work as expected, repeating the texture 16 times altogether.

You need to specify the desired wrapmode for it to repeat: https://playground.babylonjs.com/#UJWGY4#9

4 Likes

https://playground.babylonjs.com/#UJWGY4#10

Is this what you want?

1 Like

@nogalo as my daughters would tell: JINX :wink:

1 Like

@sebavan Hahaha, JINX indeed, I was so excited to answer this quickly :smiley:

2 Likes

Thanks for the quick solutions :+1: :beers:, Iā€™d completely overlooked the different address modes. :dizzy_face: