使用GLSL创建地形/轮廓线-WebGL [英] Create topography/contour lines with GLSL - WebGL
本文介绍了使用GLSL创建地形/轮廓线-WebGL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I want to slice horizontal contour lines through a geometry similar to the process described in this post - How to create latitudinal (horizontal) contour lines in GLSL?
我正在使用WebGL进行此操作,看来"fwidth"仅适用于OpenGL.是否有可用的解决方法,以便我可以从Web上的fwidth获得抗锯齿功能?
I'm doing this with WebGL, and it seems that "fwidth" is only available for OpenGL. Is there an available workaround so that I can get the anti-aliasing from fwidth on the web?
推荐答案
The fwidth function is available using WebGL, you just have to use the OES_standard_derivatives extension by running:
var ext = gl.getExtension("OES_standard_derivatives");
if (!ext) {
// tell user they can't use your site or provide
// other fallback
}
这篇关于使用GLSL创建地形/轮廓线-WebGL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文