
I am trying to recreate a retro look and feel for a game I am working on (see above). Specifically I want to have only coloured polygons making up the shape of a space ship but with GL_COLOR_MATERIAL turned on to that there can be some light and shading on the object.
If you're old enough you may recognise the image above to be from Novell Netwars (circa mid 90's). I'm actually using the original model file format from Advanced Netwars. The idea being that if anyone out there still has their custom model (the original game had an editor) they'll be able to immediately load it up in my rewrite and use it for maximum nostalgia.
I should mention that these models are not at all complex. You're allowed 64 vertices and up to 64 polys based on those. So the models look, as you would expect, very simplistic by today's standards. But it kind of makes you very careful about what you do and it gives the ships a kind of retro quality. You were allowed triangles, lines, quads and pentagons as poly types.
So to draw these in opengl es I wrote some code to convert everything down to triangles. Quads get divided into two triangles and pentagons into three. That is all fine and works well. The first snag I hit with this was finding a way to draw single colour polygons. Without using textures I decided to use a vertex colours array. However to actually get a single coloured poly all the vertices making up the corners need to be the same colour, otherwise ogl will give you a colour gradient between them like the image below.

So to avoid this I doubled up on vertices where necessary so that I could assign them separate colours and provide a poly with three vertices of the same colour. I know this wasteful but remember how simple the models are! So anyway this is all working fine and the models draw with the desired single poly colour effect with hard edges between polygons. However I now want to calculate normals so that I can have proper lighting!
The original model data that comes down from Advanced Netwars just has vertices, polys and poly colours; no normals since the original game had no concept of lighting. I consume all this in my conversion code to produce the single poly effect described above.
I am getting there, 100%, thanks if you have read this far! Because I have doubled up on some vertices, some polygons will never actually touch others. If you imagine a red triangle surrounded by grey ones for example. The vertices for the red triangle will not be shared by the grey polys since they need to have a different a vertex colour to make the triangle red. I do let two touching polys of the same colour share vertices in my conversion code though, so I have at least made some attempt at being efficient.
Now here is my question. Because I have done this cludge with the vertex colours have I broke my ability to automatically calculate the normals from the vertices? I am just trying to get the algorithm straight in my head before I attempt to program it. If you can give me any advice I would appreciate it.
I'm going to have to do something clever to work out which vertices are copies and then also work out which polys the copies are used in when averaging the surface normals for all the polys a vertex or vertex copy is used in... arrg my brain hurts.
I hope you get the drift! Anyway, all suggestions welcome. Shoot, go for it.
