Saturday 24 October 2009

Shaders and kuju materials - Part 2 - Texdiff

Good old tex diff, the default shader you should use the first time you try to display anything in game.
Why? Because it needs no extra work in setting up, it's the quickest shader to use to find out if something is wrong with your model or texture.

Description:
This shader is lit by diffuse lighting.
Example use:
Small clutter objects.
Point of Interest:
This is a 2 sided material. however the polygons only get lit correctly from one side in game.
Also, be careful when putting 2 surfaces close together when using this material, as the material is 2 sided and even though poly normals are facing away from each other you will get z fighting which will cause the surfaces to flicker as they fight to be displayed.

There are many legacy buttons and values in all of the Kuju shaders many of them do not function in RWs, even the team have not explored all of the options!


1 - Mip LOD Bias.
This is used to push the mipping further out or bring it in.
Normally we leave this at 0.
However if you want to push the mipping out on textures (For dials in cabs,logos/text on the side of trains etc) a minus value needs to be used. Thi means the texture stays sharper for longer the further you pull away. -2 is what the team use for mnost dials in cabs.

2 - Transparency.
NONE or TRANS, speaks for itself. If your texture is 24 bit then leave this on NONE as default.
Below is an example texture and it's alpha channel.


Texture - Diffuse texture


Texture - Alpha channel

Texdiff - without transparency


Texdiff - with transparency

If you have an alpha channel in your texture and it is saved as 32 bit and you want the alpha to be used then Change this to TRANS.
(Black is transparent and white is solid in the alpha channel)

3 - Lighting Material
These settings don't get used much by the team but you can change the Diffuse Colour, Ambient Colour and Emissive Colour.

This is useful if you make a greyscale texture and colourise it by one of these methods.
For Example, create 1 car texture and create many coloured versions by this method. A great way to keep texture count down.

Specular and Specular power are not used in this material.

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hi Derek, Thanks for all the great info, I kind of hoped it was more up to date, but it helped me get through some problems I was having with exporting my objects as assets in TS2016, Thanks again.

    ReplyDelete