Fragment shader on plane with modified vertices

落花浮王杯 提交于 2019-12-02 11:52:43

Your "spikes" do not have different vertex normals because you didn't change the vertex normals; they are all ( 0, 1, 0 ). This is something you could have checked yourself in the console.

Also, when you modify the vertices of a quad ( a face of the plane ), the four vertices are likely no longer planar. This will cause you all sorts of problems. ( google non-planar quads. )

You can avoid these problems by triangulating the PlaneGeometry first:

THREE.GeometryUtils.triangulateQuads( geometry );

Be advised that this function recomputes vertex normals. Have a look at the source so you understand what it is doing.

three.js r.58

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!