|Anyone want to know about TrainEmissiveGlow.fx?|
Monday, 9 April 2012
I have seen a few people confused on new shaders, also seen one person post up how it does not work when it is clear he has his material set up wrong.
So, here I am to teach those who want to get their learn on.
Use this shader on scenery objects that require normal maps, specular maps and ambient occlusion maps.
In basic terms, when creating these assets, think of an ambient occlusion map as a shadow-map. Light areas of the map are unaffected and dark areas of the map represent the shadowy areas (under gutters or in crevices).
Use this shader on foreground buildings. Group assets that are built specifically for use as a background object should not use this material.
Slot 1 is the diffuse texture. (1st mapping channel)
Slot 2 is the normal map (24bit) with specular map (8bit) in the alpha channel. (1st mapping channel)
Slot 3 is the Ambient Occlusion map. (second map channel (shadow/lightbake))
Generally, make slot 1 and slot 2 share the same UV channel 1, and the Ambient Occlusion map have a second UV mapping channel 2. This allows for the same flexibility as when using the old shadow-map technique on the old legacy assets.
One thing to understand about this material and Trainlightmap with Diffuse, surfaces that point upwards the shadow bake gets washed out by the sun because it is a light.
If the same shadow/light map was applied to a vertical surface in stead of a horizontal one the shadow is more pronounced. (see image 3)
Shining a torch in a shadowed baked area now gets lit up, you would not expect to see a soft shadow that was generated from a global light would you?
Example of the occlusion map.
Once you have your materials set up correctly you can see how it looks.
This is a great shader to use on stations or any other track side buildings. Buildings away from the track really do not need this material.