| Line 27: |
Line 27: |
| | Meshes will be loaded from the Models tag. The Models tag should contain children tags that define meshes. Each mesh tag should have a File tag, with the relative path to an obj file, a Position, Rotation and Scale. Optionally, the mesh tag can have a Parent tag, to make it a child transform of the ith mesh loaded (Zero index), a ComponentName tag to name the mesh for later reference and a Material tag to give it a material. | | Meshes will be loaded from the Models tag. The Models tag should contain children tags that define meshes. Each mesh tag should have a File tag, with the relative path to an obj file, a Position, Rotation and Scale. Optionally, the mesh tag can have a Parent tag, to make it a child transform of the ith mesh loaded (Zero index), a ComponentName tag to name the mesh for later reference and a Material tag to give it a material. |
| | | | |
| − | If no material is defined the furniture will use the default material which is much better performance wise and allows the player to colorize the furniture. Meshes using the default material should be UV mapped as shown below.
| + | Materials can either be any material you want or the default material, which is much better performance wise and allows the player to colorize the furniture. If you don't specify a material, the default material will be used and the meshes should be UV mapped according to the texture shown below. You can supply a default material with your own texture. The red color channel will be mapped to color 1, green is color 2 and blue is color 3. Grayscale pixels will not be color mapped. The alpha channel controls smoothness/specularity where 99% transparent means full specularity, 100% transparency is specifically used for glow in the dark, note that Photoshop destroys RGB channels for transparent pixels when you save as PNG, unless you keep the alpha mask on your layers before you save. |
| | | | |
| | [[File:FurnitureMap.png]] | | [[File:FurnitureMap.png]] |
| | | | |
| − | If you decide to use your own materials, you should have a Materials XML file in your furniture package folder, in which you define your materials. The Materials.xml file should have a root tag with material tags as children. Each material will be named as its tag and should have up to three children: Textures, Floats and Colors. All materials use Unity’s default material. If you want to set the texture you would write <_MainTex>test.png</_MainTex>. All textures will be loaded in 256x256. If you want to see all the colors, floats and textures you can change, refer to Unity’s default shader, which can be downloaded here: http://unity3d.com/get-unity/download/archive . Some variables include: | + | If you decide to use your own materials, you should have a Materials XML file in your furniture package folder, in which you define your materials. The Materials.xml file should have a root tag with material tags as children and each material will be named as its tag. If a material tag has the the Standard attribute as shown below, you should supply a relative path to one 256x256 texture in the a child <Texture> tag, which will be used for the standard colorable texture (as described above), any other child tag will be ignored: |
| | + | |
| | + | <MyMaterial Standard="True"> |
| | + | |
| | + | If you want a completely custom material, you should have up to three children: Textures, Floats and Colors. All materials use Unity’s default material. If you want to set the texture you would write <_MainTex>test.png</_MainTex>. All textures will be loaded in 256x256. If you want to see all the colors, floats and textures you can change, refer to Unity’s default shader, which can be downloaded here: http://unity3d.com/get-unity/download/archive . Some variables include: |
| | * _MainTex | | * _MainTex |
| | * _BumpMap | | * _BumpMap |