Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL ES: flat shading without duplicating vertices?

Is there a way in OpenGL ES to do flat shading without repeating each vertex for every triangle?

In regular OpenGL this is done with glShadeModel but in ES I write the shaders so its not that simple.

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.

Yet another way to do this uses dFdx,dFdy functions which, alas, are also missing in ES.

like image 737
shoosh Avatar asked Jan 31 '11 13:01

shoosh


1 Answers

No, flat-shading is not a feature of OpenGL ES 2.0, sorry.

like image 177
Holmes Futrell Avatar answered Nov 17 '22 00:11

Holmes Futrell