Difference between revisions of "Importing Models & Textures"
m |
m |
||
Line 36: | Line 36: | ||
If you use a Mac and don't know how to access the folders, right click the Alpha, click 'Show Package Contents', Contents->Data. For easy access you can then drag it into your Sidebar. | If you use a Mac and don't know how to access the folders, right click the Alpha, click 'Show Package Contents', Contents->Data. For easy access you can then drag it into your Sidebar. | ||
− | [[Category: | + | [[Category: Tutorials]] |
[[Category: Overgrowth]] | [[Category: Overgrowth]] | ||
[[Category: Modding]] | [[Category: Modding]] |
Revision as of 05:20, 17 June 2011
This page explains how you can tell Phoenix engine to use custom 3D models and textures. To learn how to create these from scratch, please see the Making New Models & Textures page.
Objects, Models and Textures
Overgrowth's Phoenix engine differentiates between the 3D model and the in-game object. Object is an XML file with links to the model, combined diffuse/specular and normal images, and the shader. The object file is saved as a plain text xml file, and can be created in most text editors. As of Alpha 64, you can't leave out any of tag pairs without causing a crash. Missing or incorrect links will be replaced with a default FailWhale model or texture. Below is an XML template you can use to create custom objects. Many more can be found under Data/Objects folder.
<?xml version="1.0" ?> <Object> <Model> Data/Custom/Username/custom_model.obj </Model> <ColorMap> Data/Custom/Username/custom_diffuse.png </ColorMap> <NormalMap> Data/Custom/Username/custom_normals.png </NormalMap> <ShaderName> cubemap </ShaderName> </Object>
File Formats
XML object files are text files with the filetype '.xml'. Phoenix engine can read 3D models in the Wavefront OBJ format. Most 3D modeling applications let you export your models out in the OBJ format. The object doesn't have to be specifically triangelized, and Overgrowth doesn't use the MTL (material) files that may be created during the exporting process.
Phoenix engine will also automatically create .dds images from TGA and PNG images with or without transparency. In an effort to reduce the amount of textures used, Phoenix engine reads the alpha channel of the color map as the specular map. As mentioned in the latter half of the How to make a seamless tiling texture blog post [[1]], you can paste the greyscale information of the specular map into the color map's alpha channel.
By default, Overgrowth uses Object-space normal mapping [[2]], but you can also use Tangent-space normal maps. The way the normal map is used depends on the shader name defined in the XML file. Shader 'cubemap' uses tangent-space and 'cubemapobj' object-space normals.
Folder Structure
There are no folder structure restrictions on Overgrowth objects, models or textures; they don't even have to be under the main Overgrowth folder. It is, however, recommended that any custom objects go under the Data/Custom/ directory, into a subfolder named after the creator. This makes it easy to keep custom content separate from the official content. If the XML object files contain a precise folder structure as shown in the example, for the objects to work the same folder structure must be used in all Overgrowth installations.
If you use a Mac and don't know how to access the folders, right click the Alpha, click 'Show Package Contents', Contents->Data. For easy access you can then drag it into your Sidebar.