1

How would one create a flat shaded mesh in libgdx? Most examples of custom meshes(that I could find) are gouraud shaded. I would like my game to have a flat shaded style like the following: world

So, how would I generate a flat shaded custom shape?

Native
  • 157
  • 12
  • what's the difference? – Xoppa Jul 31 '14 at 20:44
  • this: http://s.hswstatic.com/gif/question484-shading.gif From what I've read, I would need 3 unique vertices for each face of the polygon, so that they wouldn't share colours and normals. In openGL, it's just a flag you can turn on I believe. [Here's a more detailed explanation of my problem](http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=15672) – Native Jul 31 '14 at 21:46
  • possible duplicate of [Flat shading in LibGDX](http://stackoverflow.com/questions/24959523/flat-shading-in-libgdx) – Tenfour04 Aug 01 '14 at 16:19
  • 1
    In OpenGL ES 1.0, I think you could just turn off normals, and it would end up lighting it flat-shaded by calculating its own normals. But with OpenGL ES 2.0, which is what libgdx uses, I don't think this is possible. You need to construct a mesh with the appropriate normals. – Tenfour04 Aug 01 '14 at 16:21
  • See this answer: http://stackoverflow.com/a/10875870/506796 – Tenfour04 Aug 01 '14 at 16:22

0 Answers0