Difference between revisions of "Shading"
Line 7: | Line 7: | ||
===MeshMaker addon=== | ===MeshMaker addon=== | ||
http://www.orbithangar.com/searchid.cfm?ID=632 | http://www.orbithangar.com/searchid.cfm?ID=632 | ||
+ | |||
Msh_MakerV21.exe (see the MshMaker.pdf) solves this problem by assigning a "Material Tenstion" to each material. Normally this is set to 1 (in radians). This is the max angle between two faces where shading is still aplied. Is the angle higher, Mshmaker generates two vertices resulting in a sharp edge. (->and higher file size) | Msh_MakerV21.exe (see the MshMaker.pdf) solves this problem by assigning a "Material Tenstion" to each material. Normally this is set to 1 (in radians). This is the max angle between two faces where shading is still aplied. Is the angle higher, Mshmaker generates two vertices resulting in a sharp edge. (->and higher file size) | ||
The parameter can be set in the debug.txt. | The parameter can be set in the debug.txt. |
Revision as of 10:28, 25 July 2005
Direct3D Gouraud shading
Orbiter uses the vertex normals for Gouraud shading: The information on how to shade is provided by the normals of every vertex in the msh file. (see 3DModel.pfd). If no normals are provided, Direct3D calculates them in realtime by taking the mean of the normals form the surrounding triangles (faces). This results in a smaller msh file, but the shading is smooth for every angle, that means, no sharp edges at all (a cube looks quite odd then). Now, if we want a sharp edge, we have to double the vertex and give it two different normals. This results in a larger filesize. These infos are form here: http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_m/directx/direct3d/gettingstarted/3dcoordinatesystems/facevertexnormalvectors.asp
MeshMaker addon
http://www.orbithangar.com/searchid.cfm?ID=632
Msh_MakerV21.exe (see the MshMaker.pdf) solves this problem by assigning a "Material Tenstion" to each material. Normally this is set to 1 (in radians). This is the max angle between two faces where shading is still aplied. Is the angle higher, Mshmaker generates two vertices resulting in a sharp edge. (->and higher file size) The parameter can be set in the debug.txt.
Just apply diffeent materials for groups that need different shading angles.
Summary
If the shading is done correct, a model can look much smoother without much more work. Shading is the primary tool when modelling to reduce polycount!