使用 GLSL 创建 topography/contour 行 - WebGL

Create topography/contour lines with GLSL - WebGL

我想通过与此 post -

中描述的过程类似的几何体切割水平轮廓线

我正在使用 WebGL 执行此操作,"fwidth" 似乎仅适用于 OpenGL。是否有可用的解决方法,以便我可以从网络上的 fwidth 获得抗锯齿功能?

使用 WebGL 可以使用 fwidth 函数,您只需使用 OES_standard_derivatives extension by 运行:

var ext = gl.getExtension("OES_standard_derivatives");
if (!ext) {
  // tell user they can't use your site or provide
  // other fallback
}