TDU2: Filter guide

Modifications and related discussions forum

Moderators: Oleg, _RicH_

TDU2: Filter guide

Postby Oleg » Tue Nov 08, 2011 3:15 am

Test Drive Unlimited 2 Materials setup guide.

Requirements
ZModeler v2.2.6 Build 992 or higher
TestDriveUnlimited2.zmf v2.2.6 Build 263 or higher
Mini BNK Manager Beta3 or higher.


Preparements

common_car.bnk file must be unpacked. It creates lots of 2DB textures laid in different subfolders. You must put them all together into one folder. This folder with common textures must be accessible by ZModeler (Options\Settings\Services\Textures -> add path to this folder).

An unpacked vehicle BNK file might create two destination folders starting from 4Build and 5prepared. The first one might contain files that needed, e.g. it could be textures from maps folder. You have to move these texture files into maps folder of the 5prepared branch.

The stock TDU2 model contains 3 files:
Scene definition .3DD
Geometry data .3DG
Materials library .2DM
You can (and should) leave model's textures inside maps folder.

Note, an imported model shuld not log errors in a log window. There could be warnings about "Can not resolve string ...." or something like that, but all textures should be found and loaded.


Materials Setup
Material name
Material name now contains a target shader name. This is a must for the newly created materials too. Shader name is specified in square braces.

Beside shader name, you can specify additional commonly used material options in braces. At the moment, only one option is left "GLT", it will be described below.

Material name is defined as follows:
name [shader] (options)
name part could be any material name you like, but it's also used by game enging to determine coloring material options. Material name starts with:
Paint = material will be painted into vehicle color
A_C1 = material will be painted into interior primary color
A_C2 = material will be painted into interior secondary color
A_C3 = material will be painted into interior third color
The rest of material name could be anything you like: Both Paint_Glossy and Paint3 materials will be painted in game.

shader name part of material name is not case sencitive but must be specified in square braces with no leading or trailing spaces. For example, [ CarPaint2 ] is not valid, but [carPaint2] is Ok.
There are several shaders definitions available in the filter, but not all of game's shader set. At the moment only vehicle exterior and interior related shader defnitions are available and can be used.

options is a trailing part of material name and specified in braces. Options can be comma-separated if you need several options, but at the moment only one option available for material: (GLT). This option indicates that GLoss (specular map) texture will be used as Transparency. In some cases shader do not use base texture, but use grayscale specular Glossy maps. When this option specified, beside specular level, this texture will affect material transparecity. So, black areas of glossy texture will not be drawn. The most common example, is a petrol cap on car's side: it's "drawn" by transparent glossy texture (it just add glossy round shape while there is no actual petrol cap polygons modelled there). Using this in combination with Bump-mapped textures will enhance visual effect with no polygon cost at all.


User-defined options

Stock imported models create materials with some user-defined options. These options can be used to adjust some settings that can't be edited or shown in ZModeler. These settings are solely for precise materials export and will get visual effect in game only. Each shader will look for suitable user-defined options in material, but not all options listed below affect each particular shader.

RAMP value1, value2, value3
Color ramp values to use for material coloring model. TDU uses imroved coloring model and Diffuse + Specular are not the only material colors used. Additionally, RAMP colors are used and their interpolation curve is specified by these values. I haven't tested them much, you can use the most common configuration, or even remove this option to allow filter apply default RAMP interpolation for your material.

RAMP1 (R, G, B)
is the lit material color. The color of material when it's lit by any portion of light. This is not a specular highlight, but could be considered as a main/primary color of diffuse lighting;
RAMP2 (R, G, B)
is a non-lit material color. The color interpolation of material that is not lit or when the light reflects out from the viewer.
Usually it's a darker variation of RAMP1 color.
DMGCOLOR (R, G, B)
is a damages and scratches color. This color will be used to paint scratches on material. According mask is defined by green channel of Dirt+Scratch texture layer; used by CarPaint2 shader only.
FLAKES (power, scale)
is used by CarPaint2 shader only and specify specular metallic flakes behaviour. The first value controls a power of flakes effect (0.0 to 1.0 or even bigger power value can be used). The second value is a scale for texture layer. By default, flakes are mapped over the surface in low resolution (to avoid noisy effect for 3D viewport) and appears as big grayscale show flakes. Increasing the scale value you make flakes smaller on exported model. Usually values in range 5-10 are suitable).
ILUM value
This option specifies the strength of nighttime self-illumination of material. This option affects only DashBoard shader; Value is in range 0.0 to 1.0; The color of self-illumination is defined by material's Emissive color. For example, dahboard speed and tach gauges could have 0.5 of white illumination and according red-zone can have 1.0 of bright red illumination. To make this possible, you will need two materials with different settings applied to different polygons of spped and tach gaugles.


Texture slots

Texture slots configuration is very important. It's a must to set up each texture slot with respect to it's destination role, or filter will fail to determine shader configuration. In general, the following texture layer options are significant:
Enabled (enabled/disabled state of texture layer). Certain layers must be disabled to be exported properly. Of cause you can enable them to change texture or it's settings, but you have to disable such a texture layer before you export.
Apply As: Blend Opration. This value can be changed in Advanced mode of "Texture layer properties editor". It's the top-right drop-down box.
Apply As: Color0 and Color2. These values are generally should be set to Current, but certain layers require them to be Specular. For example, a Glossy "Specular Map" must use Specular in Color:Arg0 entry (the top-left drop box). Again these settings are only available in Advanced mode of texture layer properties.
Texture's UV source is only important for enviroment reflection texture and must be set to Auto Sphere Environment. For the rest of layers it should be Manual UV #1, Manual UV #2, and so on.

Note, you can create your own texture layer "Settings Template"; Switch to advanced mode, apply proper settings, switch to Simple mode, specify a name for "Preset" and press "Add". These options configuration will be now available in Simple mode as a preset with the name given.

Here's a list of texture layer configuration to use (Additional options are follows:
S0 = Specular in Color Arg0;
S2 = Specular in Color Arg2;
C = "Const Color" in Color Arg2; Dragging a slider "const color" you can affect the level of texture affection;
Disabled = Layer should be disabled on Textures rollup before you export;
Env = Layer should use "Auto Sphere Environment" UV mapping;


Layer meaning: Blend operation + Options

Primary texture: Modulate
Secondary texture: Modulate
BumpMap: DotProduct3 + Disabled
Specular Map: MultiplyAdd + S0
Reflection: MultiplyAdd + Env + C
LightCondition: SelectArg2 + Disabled
LightOn Map: Add
Shadow/Darkening: AddSigned + Disabled
Dirt Map : AddSigned
Dirt,Scratch Map: AddSigned
Flakes: MultiplyAdd + S2
Stikers Layer: Modulate + Disable
Damage Map : Modulate + Disable
Interior-view Primary Texture: Modulate
Interior-view Dirt: Modulate



Shaders configuration

Most of available shaders give you some freedom in configuration and textures appearence. For example, Default shader can have primary base texture, specular (glossy) map , enviroment (reflection) texture and a mapping texture for dirt; Some of these textures could be missing and "Default" shader still applies. For example, it could be used for material that has only environment reflection (e.g. interior chrome parts) and it still can be used for matte exterior plastic details (with no reflection but with dirt-mapping used).

I'm not sure about exact varity of texture slots for each shader, but most of shaders have been seen using particular set of their available set of texture slots.

Default: Primary texture, Specular, Reflection, Shadow, Dirt;
Default_A: Primary texture, Bump, Specular, Reflection, LightCondition, LightOn, Dirt;
Default_N: Primary texture, Bump, Specularp, Reflection, Shadow, Dirt;
CarGlassDirt: Interior-view Primary Texture, Interior-view Dirt;
CarPaint: Primary texture, Secondary texture, Specular, Reflection, LightCondition, LightOn, Dirt;
CarPaint2: Primary texture, Bump, Reflection, Dirt+Scratch, Flakes, Stickers (usermap), Damage (impactmap);
CarPlate: Primary texture, Bump, Reflection, Dirt;
DashBoard: Primary texture, Bump, Specular, Reflection;
GPS: Primary texture (will be replaced by map texture);
Mirror: Primary texture, Reflection;
ShadowBox: Primary texture (looks like does not requrie UV-mapping at all; used for light-drection projection mapping on road surface)


====================================================
Last updated 08.November.2011
User avatar
Oleg
Site Admin
 
Posts: 7763
Joined: Fri Feb 06, 2004 3:54 am

Return to Test Drive Unlimited

Who is online

Users browsing this forum: No registered users and 3 guests