2

Is it possible to lad multiple svg textures to a sprite in threejs?

This is my code

var materials = [];
    var texture = map.load("../images/Defects_Icons/Placeholder.svg", function (texture) {
      materials.push(new THREE.SpriteMaterial({ map: texture, color: 16777215, fog: true }));
      var secondTextire = map.load("../images/Defects_Icons/Placeholder1.svg", function (texture) {
        materials.push(new THREE.SpriteMaterial({ map: texture, color: 16777215, fog: true }));
        var img = new THREE.Sprite(materials);
        scene.add(img)
      })
    });
Edric
  • 24,639
  • 13
  • 81
  • 91
Shai Kimchi
  • 746
  • 1
  • 4
  • 22
  • 1
    AFAIK, the constructor of `THREE.Sprite()` takes only one material, not an array of materials. – prisoner849 Jun 23 '19 at 07:21
  • 2
    Possibly you can use a [`PlaneBufferGeometry`](https://threejs.org/docs/#api/en/geometries/PlaneBufferGeometry) and put multiple material layers to the plane. See the answer to [Is there a built-in way to layer textures within the standard PBR shader?](https://stackoverflow.com/questions/49702885/is-there-a-built-in-way-to-layer-textures-within-the-standard-pbr-shader/49708915#49708915) – Rabbid76 Jun 23 '19 at 08:17

0 Answers0