0

I run into the following issue: <a-videosphere material="repeat: ..." does not seam to work, while it works with a simple a-video tag.

I'm trying to create a half sphere and map the left half on it of an Equirectangular Video.

material="side: back; shader: flat; repeat: 0.5 1;"
geometry="primitive: sphere; radius: 100; thetaStart: 0; thetaLength: 180; phiStart: 0; phiLength: 180; segmentsWidth: 64; segmentsHeight: 64"

Is material repeat not supported by videospheres? Is there any workaround?

Kory75
  • 3
  • 1
  • Interestingly it works with `````` If I use : `````` – Kory75 Jun 15 '21 at 13:27
  • I thought the `material` is setting the texture values before the `videotexture` is used, no idea why `` works tho, still in any case you can always access the underlying `THREE.js` layer and set whatever you need – Piotr Adam Milewski Jun 15 '21 at 13:38

1 Answers1

0

You can always access the video texture direcly, and there set the repeat value:

// custom component declaration
AFRAME.registerComponent("foo", {
  init: function() {

    // wait until the texture is loaded
    this.el.addEventListener("materialtextureloaded", e => {
      // grab the texture
      const tex = e.detail.texture; 
      // set the repeat value
      tex.repeat.set(0.5, 1); 
    })
   }
})
// <a-videosphere foo></a-videosphere>

Check it out in this glitch

Piotr Adam Milewski
  • 14,150
  • 3
  • 21
  • 42