   Computing Shared Normals for many instanced connected meshes
  I understand the concept that triangles connected together into a structure will have a hard lighting edge if "shared" or averaged normals are not used for each vertex. One simple algorithm is as follows:for (int i = 0; i < vertices.size(); i++){    vertices.normal = D3DXVECTOR3( <span class="cpp-number">0</span>, <span class="cpp-number">0</span>, <span class="cpp-number">0</span> );}<span class="cpp-keyword">for</span> (<span class="cpp-keyword">int</span> i = <span class="cpp-number">0</span>; i &lt; indices.size() / <span class="cpp-number">3</span>; i++){    D3DXVECTOR3 firstVec = vertices[ indices].Pos - vertices[ indices].Pos;    D3DXVECTOR3 secondVec = vertices[ indices].Pos - vertices[ indices].Pos;    D3DXVECTOR3 normal = D3DXVec3Cross( &amp;secondVec, &amp;firstVec );    D3DXVec3Normalize( &amp;normal, &amp;normal );    vertices[ indices].normal += normal;    vertices[ indices].normal += normal;    vertices[ indices].normal += normal;}<span class="cpp-keyword">for</span> (<span class="cpp-keyword">int</span> i = <span class="cpp-number">0</span>; i &lt; vertices.size(); i++){    D3DXVec3Normalize( &amp;vertices.normal, &amp;vertices.normal );}</pre></div><!–ENDSCRIPT–>The question I have is how should &#111;ne go about computing the correct shared normals for large connected meshes that are instanced many times across the game world. For instance, if an underground maze is modeled using 3 hallways and 5 room meshes and then these 8 meshes are instanced many times to form a huge maze system consisting of dozens of copies of hallways and rooms, is there any technique for correctly computing shared normals for the triangles at the borders of an arbitrary hall and room?The &#111;nly thing I could think of was to create &#111;ne giant array of vertices and indices that could hold all the duplicated mesh pieces transformed to their world positions and then run the above algorithm over it. This seems incredibly slow, memory wasteful and not scalable.Any ideas? How do other people handle this problem without visible seams showing all over their mazes?
  Why not keep the normals for all the models?Does it look that bad if you do so?If so, perhaps you can restructure your models and make softer transition segments with computed shared normals for the corners.   