aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.69k stars 3.98k forks source link

material: repeat doesn't work, when repeat has default or '1 1' set #5120

Open Dirk-27 opened 2 years ago

Dirk-27 commented 2 years ago

Description:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>A-Frame - material texture repeat issue</title>
        <meta name="description" content="A-Frame">
        <script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
    </head>
    <body>
        <a-scene>
            <a-plane src="https://cdn.vrdoro.com/data/vrdoro/images/11/1663758749743.jpeg" position="0 1.6 -1" rotation="0 0 0"></a-plane>
        </a-scene>
    </body>
</html>

Now do in console of browser inspector: document.querySelector('a-plane').setAttribute('material', 'repeat:2 2');

Workaround (choose one):

  1. Set material="repeat: 1.001 1.001" as initial value
  2. call document.querySelector('a-plane').getObject3D('mesh').material.map.needsUpdate = true; once
dmarcos commented 2 years ago

FWIW, wrapS and wrapT values are correct. I think we just need to call needsUpdate on the map. Example on glitch