The ingame shading on the Drill and Jetpack is incorrect and we will need to figure out the source of the problem before Warvinc or lhdc do what all modelers do eventually (get sucked into their modeling applications and fall down along the Z axis for all eternity), since we cannot yet know for sure that their exported material works for us.
The issue, visually
How the drill is supposed to look:
How the drill looks without normal mapping (the shading is already incorrect):
How the drill looks with normal and specular mapping (the shading is still incorrect):
Considering that the light is mostly coming from above, the shading doesn't look right in a lot of places but there is one spot where it gets obvious that it's actually wrong, which is the area I marked in the followig shot of an older version of the drill (the "Check smoothing here." note was directed at Warvinc at that time):
The issue is also visible on the flat sides of the drill's feet, which have a strong shadow gradient were none should be, given that they are entirely flat and small compared to the distance to the dominant light source (so a difference in radiance along the surface can be neglected).
The problem is even more apparent on the jetpack. Can you spot where?
Without normal mapping:
With normal mapping:
Right, there is more-than-bad shading around the hinges above the jets, regardless of the presence of normal mapping. Note that the hinges were supposed to be animated to have the jets extend outwards, so there are opposing surfaces hidden inside the jetpack body. Consequently this time the gradients of wrongness aren't conflicting – they repeat. So while the surface around the gap (which might even have a width of exactly zero) is entirely flat it is shaded like the jetpack is powered by a small reverse sun from a parallel universe. This is so wrong that there are literally no technically accurate terms to describe what's happening.
It's worth noting that the jetpack's normal map actually adds a hard edge in the middle. By now it should also be apparent how much these anomalies reduce the visual quality of our assets. So let's move on and try to explain what's going on.
The issue, technically
As suggested in the text on the shot of the drill above, the models appear like the normals of one surface "leak" over to the next. This seems consistent with the fact that (correct me if I'm wrong) IQM stores normals per vertex (as opposed to per surface), which means that all surfaces that share a vertex also share its vertex normal, which is then interpolated over the surface along with the other "shared" vertex normals, creating a smooth shading over edges (which is good for edges that only exist because of the limited poly count but bad for all intentional edges).
I can imagine two ways how IQM's representation of normals can be used to create an effect of "hard" (correct) shading in the relevant locations instead:
Surfaces are partitioned into different meshes so that they selectively don't share vertex normals with certain neighbours (which is what I would understand as "smoothing groups"). I heard rumors that this is how it was done with md5. This can happen manually, on export/import or heuristically on model load.
Normal maps are used to "correct" the interpolated normals. I consider this a rather hackish solution as it only works when normal maps are enabled. This can only be done when baking the normal map and needs to be supported by the modeling application.
Just to be clear
The shading is wrong. I spent a lot of time convincing people of the existence of problems like this and I don't want a meta-discussion to slow down our progress on fixing it, so if you really think the shading is correct talk to me in private and explain your breakthrough in quantum theory that allows light to do what it does for us.
If you think the issue is neglible wait until you see how gorgeous the models will look once it is resolved.
All hail teamwork!
A lot of people were involved bringing the models ingame, also involving entirely different responsibilities and areas of expertise, which means we have quite a few pieces of the debug cake to distribute. (Mine was spotting the issue. Your turn! )
Piece #1: Modeling, Baking, Export
Given that the models are made by two different artists we should ask them a few questions first. Warvinc and lhdc,
What modeling application do you use?
What plugin/subsystem do you use to bake the normal map?
What plugin/subsystem do you use to export the model?
Do you use a feature called "smoothing groups" or something similiar? How are smoothing groups considered on export?
Also, just for Warvinc, since his Telenode appears to have no such issue (I cannot judge it for the Spiker or Booster since they don't have hard edges):
Please name all methodical differences between the creation of the Telenode and the Drill, especially related to smoothing groups, baking and exporting.
I think that's it for now for you two. Lean back and refresh this thread once in a while!
Piece #2: IQM, Import
First of all, I would like Ishq and gavlig to
Find out which of the hard surface models currently use iqm and which use md5.
Find out by whom the latest versions of the relevant models were imported.
Analyze if there are import options that could make a difference with regards to normals.
Import either the Drill or the Jetpack as a MD5 model and see if this makes a difference. If yes, try to explain why.
Then, I need gimhael to add debug draw functionality that visualizes …
the vertex normals on iqm models.
just the normal map.
the combined normals of interpolated vertex normals and normal map.
the shading on top of a white diffuse with no specularity.
This will also help us spot future problems early. Using these debug draws should be mandatory when putting a new model ingame.
Also, I'd like gimhael to give a short technical explaination how normals are handled in the iqm format (or link to one that skips the implementational details).
So this is phase one. kharnov and I will keep track of the progress and I specifically will do my best to help with any of the tasks above if you're stuck.