GTA IV: .WFT Materials and textures

GTA San Andreas and GTA Vice City discussion.

Moderators: _RicH_, Oleg

GTA IV: .WFT Materials and textures

Postby Oleg » Tue Apr 17, 2012 10:47 pm

Materials settings and definitions for GTA

GTA4 engine is shader-based and requires to use pre-defined rendering programs to draw polygons. These programs (shaders) can be found in GTA\common\shaders\win32_30* folders, but they will not give any valueable information to you. Actually, only shader names is what you should find there, and that's enough.

Material in ZModeler must contain shader name to use, or your will have a corrupt export (warnings will be prompted). Shader names are:
gta_vehicle_badges
gta_vehicle_basic
gta_vehicle_chrome
gta_vehicle_disc
gta_vehicle_generic
gta_vehicle_interior
gta_vehicle_interior2
gta_vehicle_lightsemissive
gta_vehicle_mesh
gta_vehicle_paint1
gta_vehicle_paint2
gta_vehicle_paint3
gta_vehicle_rims1
gta_vehicle_rims2
gta_vehicle_rubber
gta_vehicle_shuts
gta_vehicle_tire
gta_vehicle_vehglass
Actually, any shader from game folder can be used, but I don't have "internal" definitions for these shaders (as well as I don't have definitions for some of listed above), but it's a question of time.
Since all shaders have "gta_vehicle_" prefix, you can omit it and use simple names like "paint1", "mesh", "tire" etc. If you do, make sure to set default shader prefix like on the image below:
gta4vehiclemats01.gif



Shader name is A MUST in material name!

Update: 23 July 2009: You can specify any name in a begining of material. Then, after a spacebar, shader name must follow. For example, instead of

mesh
mesh
interior2 [CLR:2]
interior2 [CLR:2]
paint1 [CLR:1]



you can have:

front_rear mesh
underside mesh
seats1 interior2 [CLR:2]
dashboard interior2 [CLR:2]
Left and right side paint1 [CLR:1]




Additionally, most of shaders can render polygons with different behaviour (and different result appearence on screen). These settings are listed in GTA\common\shaders\db folder. In most of cases, shader has a one-to-one settings file, but you are allowed to mix shader and shader settings. I'm not sure about actual need of such a mix, but original GTA models usually have a mix like this: gta_vehicle_lights (shader) with gta_vehicle_vehglass (settings). You can specify such a mix in ZModeler by specifying settings name in brackets of material name. For example:
lights(vehglass)
which is equivalent to:
gta_vehicle_lights(gta_vehicle_vehglass)

Most of vehicle shaders in GTA allows vehicle paint in different colors. If you used to GTA:SA DFF exporting, then a so-called "primary" and "secondary" vehicle colors can be specified now as [CLR:1] and [CLR:2] in material name. For example, polygons that use material:
paint2 [CLR:1]
will be painted into primary vehicle color, they will use deep-metallic "gta_vehicle_paint2" shader. Polygons assigned to material
mesh [CLR:2]
will be painted into secondary vehicle color and will use shader "gta_vehicle_mesh" shader.

Each material can have additional user-defined settings, like reflection level, dirt level, specular level and such. You are allowed to specify preferable settings for you material in Extensions\User Defined options page of materials editor:
gta4vehiclemats02.gif


Note, if you created new material, you can add required user-defined options manually. Make sure to specify correct label of the entry. Filter will use default settings for material on export, if user-defined values are not specified.

I'll provide texture slots configurations for all known shaders, but it will take some time. Currently, you can refer imported models (they have to be loaded with all textures) or refer GTA Example Pack.

Materials settings

Each shader requires properly assigned texture slots. Texture slot must have pre-defined apply method, or it won't be recognized. "Using texture AAA which doesn't suit settings for shader BBB" is the most common warning in such a case.
Let's see which options have to be set properly for each texture slot:
gta4vehiclemats03.gif

First of all, when you assigned a texture for certain texture slot, press "Edit..." button next to "Apply as" label.

There are severl pre-defined apply methods for textures. Additionally, Use UV Mapping is important and it can vary in shaders, so make sure to set proper configuration before uv-mapping your model.

Shader: gta_vehicle_paint1
Texture layer #1: generic texture, usually white placeholder (vehicle_generic_smallspecmap). Apply as GTA: Texture, UV#1
Texture layer #2: dirt texture, usually vehicle_genericmud_car. Apply as GTA: Dirt/Mud/Reflection, UV#2
Texture layer #3: specular texture, usually vehicle_generic_alloy_silver_spec. Apply as GTA: Specular, UV#1.
Environment reflection texture is added automatically to this shader.
Note, specular layer (#3) and main texture (#1) uses UV#1. Thus, specular texture layout must match main texture layout. Stock models use blank white main texture and dots-noise texture as a specular. UV#1 is enlarged several times, so Specular noise texture is wrapped 10-20 times per body and noise appears as a very small glossy/metallic/pearl effect on car body.

Shader: gta_vehicle_paint2
Texture layer #1: generic texture, usually white placeholder (vehicle_generic_smallspecmap). Apply as GTA: Texture, UV#1
Texture layer #2: dirt texture, usually vehicle_genericmud_car. Apply as GTA: Dirt/Mud/Reflection, UV#1
Texture layer #3: specular texture, usually white placeholder (vehicle_generic_smallspecmap). Apply as GTA: Specular, UV#1

Shader: gta_vehicle_badges
Texture layer #1: Badges texture. Apply as GTA: Texture, UV#1
Texture layer #2: Badges bump-texture. Apply as GTA: BumpMap, UV#1
Texture layer #3: specular texture, usually white placeholder (vehicle_generic_smallspecmap). Apply as GTA: Specular, UV#1
Texture layer #4: environment reflection texture, usually vehicleenvmap128. Apply as GTA: Dirt/Mud/Reflection, Auto Sphere Environment UV

Shader: gta_vehicle_shuts
Texture layer #1: Main door-shuts texture (usually vehicle_generic_doorshut). Apply as GTA: Texture, UV#1
Texture layer #2: Bump-map for main texture (usually vehicle_generic_doorshut_normal) Apply as GTA: BumpMap, UV#1
Texture layer #3: specular texture, usually white placeholder (vehicle_generic_smallspecmap). Apply as GTA: Specular, UV#1

Shader: gta_vehicle_mesh
Texture layer #1: Main vehicle texture (usually vehicle_generic_detail2). Apply as GTA: Texture, UV#1
Texture layer #2: dirt texture, usually vehicle_genericmud_car. Apply as GTA: Dirt/Mud/Reflection, UV#2
Texture layer #3: Bump-map for main texture (usually vehicle_generic_detail2_normal) Apply as GTA: BumpMap, UV#1
Texture layer #4: Specular texture for main texture, (vehicle_generic_detail_spec). Apply as GTA: Specular, UV#1

Shader: gta_vehicle_interior2
Texture layer #1: Main interior texture. Apply as GTA: Texture, UV#1
Texture layer #2: Specular texture for interior, usually (vehicle_generic_smallspecmap). Apply as GTA: Specular, UV#1

Update will be posted here later.
User avatar
Oleg
Site Admin
 
Posts: 3386
Joined: Fri Feb 06, 2004 3:54 am

Return to Grand Theft Auto

Who is online

Users browsing this forum: Google [Bot] and 5 guests