Editing Shading

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
===Direct3D Gouraud shading===
+
Orbiter used the Direct3D vetrex 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).
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.pdf). 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.
 
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 from here:
+
These infos are form here:
[http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_m/directx/direct3d/gettingstarted/3dcoordinatesystems/facevertexnormalvectors.asp MSDN library, Getting Started with Direct3D > 3-D Coordinate Systems and Geometry]
+
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_m/directx/direct3d/gettingstarted/3dcoordinatesystems/facevertexnormalvectors.asp
  
===[[MeshMaker]] tool===
+
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)
 
 
[http://www.orbithangar.com/searchname2.cfm?search=MeshMaker&Submit2=Search download MeshMaker from Orbithangar]
 
 
 
Msh_MakerV21.exe (see the MshMaker.pdf) solves this problem by assigning a "Material Tension" 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.
  
Just apply different materials for groups that need different shading angles.
+
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!
 
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!
 
[[Category: Articles]]
 
[[Category:Orbiter 3D model]]
 
[[Category:Glossary]]
 
[[Category: Tutorials]]
 
[[Category:Add-on tutorials]]
 

Please note that all contributions to OrbiterWiki are considered to be released under the GNU Free Documentation License 1.2 (see OrbiterWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)