Jump to content

GTA IV Material Types and Setup


Murphy

Material Types for GTA IV vehicle modding

Grand Theft Auto IV requires pre-defined rendering types in order to draw polygons in its shader-based RAGE engine. All of these shaders can be found in the directory:

Grand Theft Auto IV/common/shaders/win32_30

However, you will only find shader names in this location, and no details about them. This tutorial will help you understand how each material should be set up with its corresponding shader

All materials in Zmodeler must have one of these shaders specified:

  • badges
  • basic
  • chrome
  • disc
  • generic
  • interior
  • interior2
  • lightsemissive
  • mesh
  • paint1
  • paint2
  • paint3
  • rims1
  • rims2
  • rubber
  • shuts
  • tire
  • vehglass

I have searched online, and I haven't figured out how to set up all of these materials as of yet; however, the ones in bold are commonly used on GTA vehicles and should suffice in any car mod. The rest that aren't in bold can be ignored for now.

------

Naming materials:

Every material must be set up with a name and a shader. For example:

vehicle_generic_tyrewallblack tire

Note that the section in blue is the name of the material and the section in red is the shader name.

The name of the material can be anything you want, but it is commonly easier to name it the same as the main texture that the material is using. In this case, the vehicle_generic_tirewallblack.png texture is being used for this material.

In addition, many of the GTA shaders can render polygons differently, resulting in varied appearances. All of these settings can be found in the directory:

Grand Theft Auto IV/common/shaders/db

If you look at some IV vehicles, such as the Merit or the Lokus, you will notice that polygons of the headlight glass have this mixed shader type applied to them. In this case, the mixed type is lights(vehglass)

lights represents the shader, and vehglass represents the setting for that shader. This type of material is commonly used for when you have glass in front of headlights that are mapped to a lightsemissive material, which both the Merit and Lokus have.

------

Paint colors:

Many shaders in IV also allow them to be painted different colors.

Examples:

paint1 [CLR:2]

This means that this material will use the second color number value in the carcols data line (#1,#2,#3,#4,) and it will use the paint1 shader.

paint2 [CLR:1]

This means that this material will use the first color number value in the carcols data line (#1,#2,#3,#4,) and it will use paint2's metallic paint shader.

[CLR:3] and [CLR:4] use the 3rd and 4th carcols color number values, respectively.

------

Material Setup:

Each material requires that they are properly set up in order to export and appear properly in GTA IV. This requires that you apply the corresponding textures to the corresponding texture layers for each material.

In order to specify the settings for each texture layer, press the "Edit" button and set up the layer accordingly.

Note that you do not want to UV map any object(s) until you have properly set up the material. This could lead mapping issues afterwards.

badges

Layer 1: Badge texture. Apply as GTA: Texture, UV#1

Layer 2: Badge normal-map texture. Apply as GTA: DontProduct3, UV#1

Layer 3: Specular texture, typically vehicle_generic_smallspecmap. Apply as GTA: Specular, UV#1

interior/interior2

Layer 1: Main interior texture. Apply as GTA: Texture, UV#1

Layer 2: Specular texture for interior, typically vehicle_generic_smallspecmap. Apply as GTA: Specular, UV#1

lightsemissive

Layer 1: Base texture, typically vehicle_generic_glasswindows2. Apply as GTA: Texture, UV#1

Layer 2: Dirt texture, typically vehicle_genericmud_car. Apply as GTA: Dirt/Mud/Reflection, UV#2

Layer 3: Specular texture, typically vehicle_generic_smallspecmap. Apply as GTA: Specular, UV#1

mesh

Layer 1: Main vehicle texture. Apply as GTA: Texture, UV#1

Layer 2: Dirt texture. Apply as GTA: Dirt/Mud/Reflection, UV#2

Layer 3: Normal-map texture. Apply as GTA: DontProduct3, UV#1

Layer 4: Specular texture for main texture. Apply as GTA: Specular, UV#1

paint1

Layer 1: Base texture, typically vehicle_generic_smallspecmap. Apply as GTA: Texture, UV#1

Layer 2: Dirt texture, typically vehicle_genericmud_car. Apply as GTA: Dirt/Mud/Reflection, UV#2

Layer 3: Specular texture, typically vehicle_generic_alloy_silver_spec. Apply as GTA: Specular, UV#1

paint2

Layer 1: Base texture, typically vehicle_generic_smallspecmap. Apply as GTA: Texture, UV#1

Layer 2: Dirt texture, typically vehicle_genericmud_car. Apply as GTA: Dirt/Mud/Reflection, UV#1

Layer 3: Specular texture, typically vehicle_generic_alloy_silver_spec. Apply as GTA: Specular, UV#1

paint3*

The paint3 shader involves the use of livery textures.

Learn how to set up and UV map paint3 materials in corleone's tutorial here.

shuts

Layer 1: Inner door shuts texture, typically vehicle_generic_doorshut. Apply as GTA: Texture, UV#1

Layer 2: Normal-map texture. typically vehicle_generic_detail2_normal, Apply as GTA: DontProduct3, UV#1

Layer 3: Specular texture, typically vehicle_generic_smallspecmap. Apply as GTA: Specular, UV#1

tire

Layer 1: Main vehicle texture, typically vehicle_generic_tyrewallblack. Apply as GTA: Texture, UV#1

Layer 2: Dirt texture, typically vehicle_generic_tyrewall_dirt. Apply as GTA: Dirt/Mud/Reflection, UV#2

Layer 3: Normal-map texture. typically vehicle_generic_tyrewall_normal, Apply as GTA: DontProduct3, UV#1

Layer 4: Specular texture for main texture, typically vehicle_generic_tyrewall_spec. Apply as GTA: Specular, UV#1

vehglass [lights(vehglass), etc]

Layer 1: Base texture, typically vehicle_generic_glasswindows2. Apply as GTA: Texture, UV#1

Layer 2: Dirt texture, typically vehicle_glassdirt. Apply as GTA: Dirt/Mud/Reflection, UV#2

Layer 3: Specular texture, typically vehicle_generic_smallspecmap. Apply as GTA: Specular, UV#1

------

Reference resources for this tutorial:

forum.zmodeler3.com



User Feedback

Recommended Comments

this don't work i had the car appearing in gasme with only a few things missing  added   paint1[CLR:1] and added all those supposed shaders and blammo it crashes the game on spawn evetytime

 

Share this comment


Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×