Quote:
Originally Posted by gap
To the best of my knowledge, the diffuse and the AO meshes are indentical but in their UV coordinates: same number of polygons, same number of edges, same number of vertices, but since the AO map encompasses two separate meshes, each composed by several geometries assembled together (i.e. bunker parts + rock parts), before baking it I had to combine the two meshes. I then separated the combined object and combined the resulting geometries again as per their original arrangement (bunker parts with bunker parts and rock parts with rock parts). Possible that when doing it vertices/faces order was scrambled? Does this order actually matter? 
|
Yes the order actually matters. Here's why:
Bunker.obj - small excerpt from beginning of face definitions:
f 1/21/1 33/20/33 32/46/32
f 1/582/1 73/566/73 33/581/33
f 1/273/1 416/274/416 2/230/2
f 2/564/2 82/543/82 83/565/83
f 2/564/2 83/565/83 1/582/1
Bunker_AO.obj - small excerpt from beginning of face definitions:
f 1/418/1 3/481/3 2/419/2
f 2/229/2 6/227/6 1/230/1
f 3/481/3 8/488/8 4/480/4
f 4/480/4 2/419/2 3/481/3
f 5/438/5 2/445/2 8/402/8
In Bunker.obj the indices would look like so:
1, 33, 32, 1, 73, 33, 1, 416, 2, 2, 82, 83, 2, 83, 1
In Bunker_AO.obj the indices would look like so:
1, 3, 2, 2, 6, 1, 3, 8, 4, 4, 2, 3, 5, 2, 8
Everytime there is a duplicate indice in the non-AO indice list the app will create a clone of that vertice to satisfy Granny's needs. If we just look at indice 1 it will need to be duplicated 3 times.
After the non-AO indice list is adjusted to account for duplicate indices the vertice list is generated from the indice list. The app then maps the face definitions from the AO to the non-AO. I think you can see why your AO's are scrambled now.
The problem will get worse the more the objects are optimized. If you had a straight 1:1 export then there would be no problem because the app wouldn't have to clone any vertices.
If the face definitions in the AO do not match the face definitions in the non-AO (except for the UVs) you will get scrambled AOs. You're talking one huge mapping nightmare trying to figure out how to match different face definitions, especially ones that have been optimized.