The TrainBumpSpecEnvMask Shader

Discussion of rolling-stock creation & re-painting.

The TrainBumpSpecEnvMask Shader

Unread postby ricksan » Fri Feb 27, 2009 9:57 pm

TrainBumpSpecEnvMask is one of those workhorse shaders that we'll be using a lot, especially for locomotives and rolling stock. If you're looking for a shader that takes advantage of bump mapping and environment reflections, this is the one for you. Here are a few notes on its use.

You'll need three texture sheets: your basic RGBA diffuse texture; the corresponding normal map; and a dummy texture which serves as a placeholder for the RS environment map.

I will paraphrase a post by Derek Siddle on how these texture sheets are used in the Shader. The TrainBumpSpecEnvMask shader has three texture slots.

-- In slot 1 select the diffuse texture and set the UV Channel to 1. In UV Arguments make sure box 1 is set as 32 or 64.
-- In slot 2 select the normal map and set the UV Channel to 1.
-- In slot 3 select dummy.ace and set the UV Channel to 1.

Note that I specified the diffuse texture as RGBA. The alpha channel is what controls reflectivity. White is highly reflective and black is non-reflective. Using grayscale values, you can vary the degree of reflectivity over different parts of the diffuse texture as needed. Very nice.

So suppose you also need some punch-through alpha. Well, since the diffuse alpha channel of the TrainBumpSpecEnvMask shader is used exclusively for reflectivity, you simply can't use it for this. You'll either have to make physical holes in your mesh or separate out the part needing punch-through alpha and apply a separate texture map using our old friend the BlendATexDiff shader, with TRANS selected. That's not what we've been used to doing, so you'll have to plan your texture maps accordingly. This is an especially important consideration if you're upgrading your old MSTS models.

Newbie note. I recently saw a post in which somebody seemed to think that a normal map actually distorts the underlying mesh, adding things like rivets to it. The writer concluded that normal mapping in RS has no effect because he noticed that the outer sides of a particular object had no "bumps." As most of us know, that's not how a normal map works. The normal map only gives the impression of surface relief by adjusting the shading of the rendered pixels. The mesh itself is unaffected.
ricksan
Forum Mod
 
Posts: 327
Joined: Fri Feb 13, 2009 10:55 am
Location: Bandon, OR USA

Re: The TrainBumpSpecEnvMask Shader

Unread postby g_nash » Sun Mar 01, 2009 7:44 am

ricksan wrote:
Newbie note. I recently saw a post in which somebody seemed to think that a normal map actually distorts the underlying mesh, adding things like rivets to it. The writer concluded that normal mapping in RS has no effect because he noticed that the outer sides of a particular object had no "bumps." As most of us know, that's not how a normal map works. The normal map only gives the impression of surface relief by adjusting the shading of the rendered pixels. The mesh itself is unaffected.


I'm hoping they were directed to useful primer on normal mapping

Geoff
g_nash
 
Posts: 462
Joined: Fri Feb 13, 2009 11:43 pm


Return to Rolling-Stock Design

Who is online

Users browsing this forum: No registered users and 4 guests