问题描述
在OpenGL ES中,有没有一种方法可以进行平面着色而无需为每个三角形重复每个顶点?
Is there a way in OpenGL ES to do flat shading without repeating each vertex for every triangle?
在常规OpenGL中,这是通过glShadeModel
完成的,但是在ES中,我编写了着色器,所以并不是那么简单.
In regular OpenGL this is done with glShadeModel
but in ES I write the shaders so its not that simple.
GLSL 1.3或1.4(不确定)引入了关键字flat
,该关键字似乎启用了此功能,但不幸的是ES 2.0尚没有此功能.
GLSL 1.3 or 1.4 (not sure) introduces the keyword flat
which seem to enable this but unfortunately ES 2.0 doesn't have this yet.
另一种实现方法是使用dFdx
,dFdy
函数,可惜,ES中也缺少这些函数.
Yet another way to do this uses dFdx
,dFdy
functions which, alas, are also missing in ES.
推荐答案
否,对不起,平面着色不是OpenGL ES 2.0的功能.
No, flat-shading is not a feature of OpenGL ES 2.0, sorry.
这篇关于OpenGL ES:在不复制顶点的情况下进行平面着色吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!