代码之家  ›  专栏  ›  技术社区  ›  nnyby

将锐利文本呈现为3.js纹理

  •  3
  • nnyby  · 技术社区  · 8 年前

    我有一个512x512 SVG,我正在画一个像这样的圆形平面

        const texture = new THREE.TextureLoader().load('img/plane.svg');
    ​
        const material = new THREE.MeshBasicMaterial({
            transparent: true,
            map: texture,
            side: THREE.DoubleSide
        });
        const geometry = new THREE.CircleGeometry(5, 64);
        const plane = new THREE.Mesh(geometry, material);
        plane.rotation.x = -1;
        scene.add(plane);
    

    工作正常,但是这个svg上面有一些文本 在3.js中渲染时非常模糊:

    screenshot of blurry text in webgl

    我怎样才能使它尽可能锋利?

    作为参考,这里的SVG呈现为512x512 png:

    sharp compass

    1 回复  |  直到 8 年前
        1
  •  7
  •   nnyby    8 年前

    就在我决定在这里发帖的时候,我通过添加 material.map.minFilter = THREE.LinearFilter;