Thursday, 28 January 2010

Shaders and kuju materials - SubtractATexDiff

SubtrackATexDiff is the material we use for soft shadows under rolling stock.
This object should be exported in the same 3DSmax file as the asset you want it under. (However you could also set it up as child object also)

First of all I made a box roughly the size of the wagon or asset you want the shadow to sit under.
I deleted all the polygons except the top one and then reset x form/and position and transform on pivot. I then placed this at 0/0/0 in the world. Remember that 0 height in Max is the top of the rails in RailWorks for rolling stock.
So with that in mind I dropped the shadow object down a few centimetres so that the shadow would be above the sleepers but below the rail height.

I have my object a name 1_0300_softshade, so after 300M the shadow would not be drawn.

I selected the Kuju Material SubtractATexDiff, set the alpha to Test Only (1) then selected my texture.

Below is an example of a 24Bit shadow texture. (no alpha channel is needed)
The darker the grey the less it shadows, black is invisible and white is solid black shadow (I know it seems wrong)

Export your 3DSMax scene and view the effects in the Asset Editor.


  1. thank you for sharing. Could the next artikel be a little bit of those glowing effects on Signals?

  2. Thank you, try it! When the lights and dynamic shadows in RailWorks?

  3. Thank you so much Derek. I´m making some good shadows with this now. I was using alpha channels, I´ll give it a try this afternoon.

  4. Thanks for spelling that out. I had hoped that such a thing existed.