Skip to content

Getting Offset Overflows texture dimension on Three.js 0.136.0 #29

@LasseStaffJensen

Description

@LasseStaffJensen

I just updated both my Three.js from 0.117 to 0.136 and also updated your libraries:

  • "three.textsprite": "18.7.14"-> "@seregpie/three.text-sprite": "^3.2.0"
  • @seregpie/three.text-texture": "^2.0.1 -> "@seregpie/three.text-sprite": "^3.2.0"

When adding the TextSprite object to the scene I'm getting "GI_INVALID_VALUE: Offset overflows texture dimensions." printed to console by the WEBGL driver:

image

Example code failing:

const spriteMD = new TextSprite({
            color,
            fontFamily: 'Arial Helvetica, sans-serif',
            fontSize: 8,
            text: (pt[0] - yofs).toFixed(0).toString(),
          });
spriteMD.position.set(x + 1, y, z + 1);
scene.add(spriteMD);

Using TextTexure and manually creating a sprite works on the other hand:

let texture = new TextTexture({
        color: cssColor,
        fontFamily: 'Arial Helvetica, sans-serif',
        fontSize: 32,
        text: y > starty ? y.toString() : y.toString() + ' [' + prefUnit + ']',
      });
  let material = new THREE.SpriteMaterial({
        map: texture,
        sizeAttenuation: false,
      });
 const sprite = new THREE.Sprite(material);
 sprite.position.set(startx * SCALE, -y * SCALE, -endz * SCALE);
 scene.add(sprite);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions