Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to repeat or tile a texture in A-Frame?

Tags:

aframe

I have a material

 <a-entity material="src:#imgGround; repeat: 400"></a-entity>

that I want to repeat or tile for the ground, but it is not working. How do I repeat or tile a texture in A-Frame?

I also want to do it for displacement and normal maps:

<a-entity id="ground_model" geometry="primitive:circle;radius:1" position="0 0 0" rotation="-90 0 0" scale="30 30 30" color="green" material="src:#imgGround;flatShading:false;transparent:false;repeat:44;normalMap:#imgGroundN;displacementMap:#imgGroundZ">
like image 927
ngokevin Avatar asked Feb 03 '26 10:02

ngokevin


1 Answers

https://aframe.io/docs/master/components/material.html#built_in_materials_repeat

A repeat takes two values (for U and V mapping, or X and Y), not one.

<a-entity material="src:#imgGround; repeat: 20 20"></a-entity>

https://aframe.io/docs/master/components/material.html#built_in_materials_normaltexturerepeat

Similarly for displacement and normal maps, there are specific repeat properties:

<a-entity material="displacementMap:#imgGroundZ; displacementTextureRepeat: 4 4">
like image 138
ngokevin Avatar answered Feb 06 '26 01:02

ngokevin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!