gpt4 book ai didi

javascript - 将清晰的文本渲染为 three.js 纹理

转载 作者:搜寻专家 更新时间:2023-11-01 05:19:40 25 4
gpt4 key购买 nike

我有一个 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 上有一些文本,它是在 three.js 中呈现时非常模糊:

screenshot of blurry text in webgl

如何使它尽可能清晰?

作为引用,这里是呈现为 512x512 png 的 SVG:

sharp compass

最佳答案

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

解决了我的问题

关于javascript - 将清晰的文本渲染为 three.js 纹理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51410357/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com