CCG/Modelling: Load Texture Replacement

From TrainzOnline
< CCG(Difference between revisions)
Jump to: navigation, search
(New page: ==Load Texture Replacement== This feature was created for rolling stock items that use animated bulk loads. If a rolling stock item (say a Gondola) is setup to carry any product within pr...)
 
 
Line 173: Line 173:
 
  Primary=coal.tga
 
  Primary=coal.tga
 
  Tile=st
 
  Tile=st
 
 
 
  
  
Line 214: Line 211:
 
This asset has an animated load (typical for bulk load rolling stock) and animated unload doors (specific to this asset). These doors are controlled by the hopper.gs script file.
 
This asset has an animated load (typical for bulk load rolling stock) and animated unload doors (specific to this asset). These doors are controlled by the hopper.gs script file.
  
 +
====Typical Directory Structure====
 
[[Image:CCG_coal_hopper_dir1.jpg]]
 
[[Image:CCG_coal_hopper_dir1.jpg]]
  
  
 
====Expanded Directory Structure====
 
====Expanded Directory Structure====
 +
<table cellpadding="10"><tr><td valign="top">
  
[[Image:CCG_coal_hopper_dir2.jpg]]
 
  
  
Line 225: Line 223:
  
  
 +
[[Image:CCG_coal_hopper_dir2.jpg]]</td>
 +
<td valign="top">
 +
Primary=coal_hopper_art_512.tga
 +
Alpha=coal_hopper_art_512.tga
 +
Tile=st
 +
Hint=Dynamic
 +
(512x512 pixel 32-bit .tga file)
  
 
 
 
 
 
Typical Directory Structure
 
 
 
 
 
 
 
(512x512 pixel 32-bit .tga file)
 
  
 
(128x64 pixel 32-bit .tga file)
 
(128x64 pixel 32-bit .tga file)
  
  
 +
'Load' animation file. Referenced through the config
  
'Load' animation file. Referenced through the config
 
 
'Load' mesh file. Referenced through the config
 
'Load' mesh file. Referenced through the config
 +
 
Exporter generated txt file
 
Exporter generated txt file
Primary=coal_hopper_art_512.tga
 
Alpha=coal_hopper_art_512.tga
 
Tile=st
 
Hint=Dynamic
 
 
 
 
  
 
Load texture.
 
Load texture.
 
 
  
  
Line 268: Line 252:
  
 
The hi-res mesh in level of detail mesh reduction
 
The hi-res mesh in level of detail mesh reduction
 +
 
LOD file (.lm). Ref. through default-mesh in config.
 
LOD file (.lm). Ref. through default-mesh in config.
 +
 
The low-res mesh in level of detail mesh reduction
 
The low-res mesh in level of detail mesh reduction
  
 
+
24-bit .tga file
24-bit .tga file
+
 
+
  
 
Default textures for shadows
 
Default textures for shadows
 +
 
Shadow mesh.
 
Shadow mesh.
  
 
Wave sound files. Timing controlled through script.
 
Wave sound files. Timing controlled through script.
 +
 +
</td></tr></table>
  
 
Config.txt and Hopper.gs (script) files. Refer:
 
Config.txt and Hopper.gs (script) files. Refer:
 +
 
http://www.auran.com/TRS2004/trssp4dl/dfile.php?FileID=10
 
http://www.auran.com/TRS2004/trssp4dl/dfile.php?FileID=10
 +
 +
 +
 +
[[CCG/Modelling: Level of Detail Mesh Reduction|Previous Page]] . . . . [[CCG/Modelling: Aliasing Trains|Next Page]]
 +
 +
==Return to CCG Index==
 +
[[Content Creator's Guide]]

Latest revision as of 15:23, 15 June 2011

Contents

[edit] Load Texture Replacement

This feature was created for rolling stock items that use animated bulk loads.

If a rolling stock item (say a Gondola) is setup to carry any product within product-category `Bulk Load', AND it's config.txt file is set up to enable texture replacement, then a texture replacement on the load mesh will take place to visually represent the product.

[edit] Let us break down the texture-replacement setup

Texture swapping functionality relies on 2 things:

1) The rolling stock item config.txt to include with `product-texture' load effects setup (see Rollngstock examples 1 and 2 below).
2) The product config.txt itself needs product-texture information and reference to the texture to be loaded (see product examples on Page 374).


[edit] Rollingstock Example 1

[edit] COAL HOPPER

Load allows texture replacement:

Note: The load_map.tga texture file is the original texture used on the mesh in 3DSMax, and is to be replaced. The load_map.texture.txt file references this texture to be replaced in Trainz by a different texture for the new product (see load, effects, product-texture in config.txt).

The original texture size and the mapping on the mesh will effects the appearance of the replacement texture.

Default product load:

COAL <KUID:44179:60013> (see product-kuid field in config.txt)

Can take product-category:

BULK LOAD <KUID:-3:10040> (see allowed-categories field in config.txt)


When the Coal hopper enters an industry asset that produces a bulk-load other than it's default (ie. woodchips at a lumbermill), and it loads this product, texture-replacement will take place.

[edit] Coal Hopper Directory Structure

[edit] Extract from Coal Hopper Config.txt

mesh-table
{
  default
    {
      mesh coal_hopper_body/coal_hopper_body.lm
      auto-create 1
    }
  shadow
   {
      mesh coal_hopper_shadow/coal_hopper_shadow.pm
   }
 load
   {
      mesh coal_hopper_body/load/load.pm
      anim coal_hopper_body/load/load.kin
      auto-create 1
      use-parent-bounds 1
      effects
        {
          product-texture
            {
               kind     "texture-replacement"
               texture  "load_map.texture"
            }
        }
   }
}
queues
{
  load0
    {
      size              54300
      initial-count     0
      animated-mesh     "load"
      product-kuid      <KUID:44179:60013>
      allowed-categories
        {
          0             <KUID:-3:10040>
        }
    }
}


[edit] Rollingstock Example 2

[edit] WOODCHIP GONDOLA

Load allows texture replacement. Note the texture to be replaced (load_map). (see load, effects, product-texture in config.txt)

Default product load:

WOODCHIPS <KUID:-3:10002> (see product-kuid field in config.txt)

Can take product-category:

BULK LOAD <KUID:-3:10040> (see allowed-categories field in config.txt)

When the Woodchip Gondola enters an industry asset that produces a bulk-load other than it's default (ie. coal at a coalmine), and it is loads this product, texture-replacement will take place.


[edit] Woodchip Gondola Directory Structure

[edit] Extract from Woodchip Gondola Config.txt

mesh-table
{
  default
    {
       mesh               "woodchip_gondola_body/woodchip_gondola_body.lm"
       auto-create        1
    }
  shadow
    {
       mesh               "woodchip_gondola_shadow/woodchip_gondola_shadow.im"
    }
  load
    {
       mesh               "woodchip_gondola_body/load/load.im"
       anim               "woodchip_gondola_body/load/load.kin"
       auto-create        1
       use-parent-bounds  1
       effects
         {
           product-texture
             {
               kind       "texture-replacement"
               texture    "load_map.texture"
             }
         }
    }
}
queues
{
  load0
    {
      size                60500
      initial-count       0
      animated-mesh       "load"
      product-kuid        <KUID:-3:10002>
      allowed-categories
        {
          0               <KUID:-3:10040>
        }
    }
}

As a rolling stock item with texture-replacement enabled has reference to the texture to be replaced, the product has reference to the texture that will be used in its place.


[edit] Product Example 1:

[edit] COAL PRODUCT

In the case of the coal product, the texture to be used is `coal.tga', i.e. if the woodchip gondola enters the coal mine to load coal, the load-map texture will be replaced with coal.tga.


[edit] Coal Product Directory Structure

[edit] Coal Product Config.txt

kind               product
kuid               <KUID:44179:60013>
username           "Coal"
instance-type      "resource"
product-category   <KUID:-3:10040>
icon-texture       "icon_texture.texture"
mass               0.860
product-texture    "coal.texture"
mesh-table
{
}


[edit] coal.texture.txt

Primary=coal.tga
Tile=st



[edit] Product Example 2:

[edit] WOODCHIP PRODUCT

In the case of the woodchip product, the texture to be used is `woodchips.tga' I.e. If the coal hopper enters the lumber mill to load woodchips, the load-map texture will be replaced with woodchips.tga.


[edit] Woodchip Product Directory Structure

[edit] Woodchip Product Config.txt

kind               product
kuid               <KUID:-3:10002>
username           "woodchips"
instance-type      "resource"
product-category   <KUID:-3:10040>
icon-texture       "icon_texture.texture"
mass               0.400
product-texture    "woodchips.texture"
mesh-table
{
}


[edit] woodchips.texture.txt

Primary=woodchips.tga
Tile=st


[edit] TrainCar Directory Structure

The following example is of a typical Coal hopper.

This asset has an animated load (typical for bulk load rolling stock) and animated unload doors (specific to this asset). These doors are controlled by the hopper.gs script file.

[edit] Typical Directory Structure

CCG coal hopper dir1.jpg


[edit] Expanded Directory Structure




CCG coal hopper dir2.jpg
Primary=coal_hopper_art_512.tga
Alpha=coal_hopper_art_512.tga
Tile=st
Hint=Dynamic

(512x512 pixel 32-bit .tga file)


(128x64 pixel 32-bit .tga file)


'Load' animation file. Referenced through the config

'Load' mesh file. Referenced through the config

Exporter generated txt file

Load texture.


The grey area indicates optional files. The load files are essential for visualisation of the TRS bulk load product such as coal or woodchips.




The hi-res mesh in level of detail mesh reduction

LOD file (.lm). Ref. through default-mesh in config.

The low-res mesh in level of detail mesh reduction

24-bit .tga file

Default textures for shadows

Shadow mesh.

Wave sound files. Timing controlled through script.

Config.txt and Hopper.gs (script) files. Refer:

http://www.auran.com/TRS2004/trssp4dl/dfile.php?FileID=10


Previous Page . . . . Next Page

[edit] Return to CCG Index

Content Creator's Guide

Personal tools