Threejs制作了一个置换的网格(地形模型) [英] Threejs make a displaced mesh (terrain model)

查看:938
本文介绍了Threejs制作了一个置换的网格(地形模型)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在可视化大约59k数据点.目前,我正在将它们制成纹理,然后将它们应用于平面几何.

So I have around 59k data points that I'm visualizing. Currently I'm making them into a texture, and then applying them to a plane geometry.

现在的问题是,我需要显示一个高度图,每个数据点都有一个高度值,我需要将其应用于网格.

Now the issue is that I need to show a heightmap, each datapoint has a height value, and I need to apply that to the mesh.

如何最好地做到这一点?以前,我使用大量的立方体几何体显示此数据,然后可以更改其高度.但这会使性能受损,因此这并不是一个选择.

How is the best way to go about doing this? Previously I was displaying this data using a ton of cube geometries, which I could then change the height on. But this made performance suffer, so it wasn't really an option.

推荐答案

需要使用置换着色器通过将计算推送到GPU来提高性能.

Displacement shader is needed to increase the performance by pushing the calculation to GPU.

这是很好的例子使用置换着色器.

这是使用置换着色器的高度图的示例

这篇关于Threejs制作了一个置换的网格(地形模型)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆