Game Development Reference
In-Depth Information
The Content Pipeline
system responsible to manage all the user interface
controls. In addition it is capable of rendering more
than one hundred models in computers with graph-
ics cards compatible with the shader model 1.1. It
is worth to note that it does not include any kind of
hardware skinning animation since all the major
animations are powered by the physics engine.
Unfortunately the default lighting and material
system component provided by XNA (Basic Effect
class) did not suit the ITS PLC systems' specifica-
tion. So, it was necessary to develop a proprietary
lighting and material system. This allowed for
materials composed of albedo, reflection, detail,
specular and ambient occlusion textures. All the
materials also support UV offsets and scale al-
lowing animation when necessary - a very useful
functionality for simulating a conveyor belt or
the transmission chains of a transelevator. Other
important functionality is the ability of drawing
translucid models.
The XNA Framework Content Pipeline was used
extensively to import and process practically all
kinds of content needed by our game engine. Al-
though the content pipeline offers an extensive list
of importers and processors they are all related to
2D, 3D and sound content. In the present case, the
project required to get different types of content
into the game engine like collision shapes, mate-
rial descriptions and user interface skins. Using
the XML content importer and processor (Sav-
age, 2008) it was possible to get them in a pretty
straightforward way. All this content is defined in
a XML file - Listings 1 and 2 - that is imported
by the XML Importer and after processed by our
own processor. The developed 3D assets were
created using the Autodesk Softimage software
and then exported to the Autodesk fbx file format.
After this, the content is prepared and imported
Listing 1. A pallet material file that is imported and processed by the XML content pipeline
<XnaContent> 
          <Asset Type=”RG.Graphics.Pipeline.DiffuseMaterialDescription”> 
                    <AlbedoTexture>SortingContent\Textures\Pallet.dds</AlbedoTex-
ture> 
                    <AmbientColor>0.8 0.8 0.8 1.0</AmbientColor> 
                    <DiffuseColor>1.0 1.0 1.0 1.0</DiffuseColor> 
                    <SpecularColor>0.5 0.5 0.5 1.0</SpecularColor> 
                    <Shininess>200</Shininess> 
          </Asset> 
</XnaContent>
Listing 2. Another example of a XML file, this time used to describe a pallet collision shape
<XnaContent> 
          <Asset Type=”RG.Physics.CollisionBox”> 
                    <Size>0.8027 0.0808 0.617</Size> 
                    <Rotation>0 0 0</Rotation> 
                    <Position>0 0 0</Position> 
          </Asset> 
</XnaContent>
Search Nedrilad ::




Custom Search