Treez
Line 42: | Line 42: | ||
If using PlantFactory you will want to get the example files above and look at the metadata .txt files to determine what additional tags are being used. You will also want to watch the PlantFactory video information below to understand how to use the program and also how to export from PlantFactory, setup your Trainz Asset and import into Trainz. | If using PlantFactory you will want to get the example files above and look at the metadata .txt files to determine what additional tags are being used. You will also want to watch the PlantFactory video information below to understand how to use the program and also how to export from PlantFactory, setup your Trainz Asset and import into Trainz. | ||
− | If you are using another 3D modelling program to create your trees. If you want to use camera facing leaf cards ( m.leafcardbillboard ) then you must point your leaf cards in the positive X direction | + | If you are using another 3D modelling program to create your trees. If you want to use camera facing leaf cards ( m.leafcardbillboard ) then you must point your leaf cards in one single direction. The default is the positive X direction. Also each leaf card must be an individual mesh so they can rotate individual. |
[[Image:leaf_card_blender.jpg|400px]] | [[Image:leaf_card_blender.jpg|400px]] | ||
+ | |||
+ | If you do not point your leaf cards in the default positive X direction, you can rotate the leaf cards around X, Y or Z using the following tag in the metadata file. | ||
+ | |||
+ | camera-facing-rotate-normals 0,180,0 | ||
+ | |||
+ | 0,180,0 is just an example. Use the values you require to get your leaf cards facing in the correct direction when importing into Trainz. Find out more information on the Trainz [[Mesh_metadata_file]] wiki page. | ||
+ | |||
===Materials=== | ===Materials=== |
Revision as of 14:07, 6 June 2024
Contents |
Software Requirements
This is a step by step tutorial that will teach you how to create a 3D TREE model for use in Trainz. This method uses PlantFactory (free software) to create the 3D tree model but you could use Blender or any other 3D modelling software in it's place. The principles are the same.
Before you start you will need:
- A copy of Trainz. Currently this is in development so in order to test this new foliage system you must be part of the BETA - JOIN.
- A copy of PlantFactory 2024. Click the Download button on that page, agree to the EULA and the next page the software should show for download.
- You need a set of textures (Bark and Leaves at a minimum) for your trees. These can be created from scratch using the likes of Photoshop (paid) or GIMP (free). You can look to source them from many different websites including Adobe Substance Library or other stock places. There are many other places you can purchase tree stock as a base or to get ideas to build from including CGTrader, TurboSquid and more.
PlantFactory
Examples
A good place to start is with one of our PlantFactory templates. This can speed up your development a lot, especially if you are new to PlantFactory.
Download Youtube Video 1 Example Files
Download Youtube Video 2 Example Files
Tree Asset Structure
The new tree assets are scenery assets.
They use the .fbx format for their mesh files.
.PNG or .TGA is recommended for textures.
The new materials are outlined below.
The texture setup is outlined below.
You should try and keep the highest LOD under 5000 polygons. Each additional LOD level should drop down by 25%. Your lowest LOD should be under 1000 polygons, ideally under 500 polygons. There is no need to create billboards as Trainz will create this for you using a new "Imposter" system that will release alongside "Treez".
If using PlantFactory you will want to get the example files above and look at the metadata .txt files to determine what additional tags are being used. You will also want to watch the PlantFactory video information below to understand how to use the program and also how to export from PlantFactory, setup your Trainz Asset and import into Trainz.
If you are using another 3D modelling program to create your trees. If you want to use camera facing leaf cards ( m.leafcardbillboard ) then you must point your leaf cards in one single direction. The default is the positive X direction. Also each leaf card must be an individual mesh so they can rotate individual.
If you do not point your leaf cards in the default positive X direction, you can rotate the leaf cards around X, Y or Z using the following tag in the metadata file.
camera-facing-rotate-normals 0,180,0
0,180,0 is just an example. Use the values you require to get your leaf cards facing in the correct direction when importing into Trainz. Find out more information on the Trainz Mesh_metadata_file wiki page.
Materials
There are two new materials to use for trees.
m.leafcard - Use this material for your transparent leaf cards that are not camera facing. This material structure is identical to m.pbrmetal. The only difference in setup is the name of your material.
m.leafcardbillboard - Use this material for your transparent leaf cards that are to be camera facing. This material structure is identical to m.pbrmetalmasked. The only difference in setup is the name of your material.
Textures
The makeup of m.leafcard is the same as m.pbrmetalmasked.
The makeup of m.leafcardbillboard is the same as m.pbrmetalmasked.
The exception to both materials is the blue channel in the parameters texture. The blue channel of the parameters texture is used to modulate the strength of the directional lighting. This is intended to give the feel of individual leaves being deeper inside the tree and shadowed from all directions, even though the leaf card as a whole is not shadowed. (Note that this is the same channel used for Ambient Occlusion on m.pbrmetal; the leaf card materials do not support ambient occlusion.)
Full brightness (100% blue channel) gives a standard lighting response, while darker values give a weaker response to directional lighting.
Here is an example of what the blue (AO) channel could look like in the parameters texture for both m.leafcard and m.leafcardbillboard.
PlantFactory Tutorial
Once the software starts up and you've either loaded one of the templates above or you've started a new tree from scratch, if you are new to PlantFactory, you will want to read the "PlantFactory — Reference Manual" (specifically 'Section 5 - Modifying Plants: Using Parameters') which can be accessed by clicking on the Main Menu -> Help -> Reference Manual. This manual explains everything you need to know about the software. It is definitely worth the read.
For those that want to come back to the manual later, here is a video breakdown on a very raw PlantFactory / Trainz explanation you can get started with.
Work-in-Progress Test Trees
There isn't one way to create trees in PlantFactory but these trees were created using the procedural node method.