Using Normal Maps in San Andreas
Using Normal Maps in San Andreas
Using
Normal Maps
In GTA San Andreas
2015
White Paper Using Normal Maps In San Andreas
Table of Contents
1. Introduction 3
2. Requirements 4
3. Installing Normal Map plugin 5
4. Adapting your models to Normal Map Plugin 6
Importing normal map textures into TXD archive 6
Attaching normal maps to DFF files with nm_matbuild tool 6
Attaching normal maps to DFF files with MatFx tool 8
Normal maps for player model 10
6. Normal Map Plugin settings 11
General 11
Ambient 11
Directional 11
1. Introduction
NormalMap is an .ASI plugin for GTA San Andreas (named as
normalmap_byDK.asi) which gives an ability for modmakers to use normal
maps with their models.
2. Requirements
Normal Map Plugin requires GTA San Andreas with 1.0 US executable.
Also, for loading .ASI plugins you need to have an ASI Loader installed for your
game. It is recommended to use Silents ASI Loader.
3. Installing Normal Map plugin
An installation process is pretty simple. Just copy following items to your GTA SA
folder:
normalmap_byDK.asi a plugin itself
normalmap_byDK.ini configuration file for plugin
normalmap_player folder for player model normal maps (empty by default)
Notice the plugin can be launched even without additiona files. If the .ini file is
not presented, a plugin will load default settings. And if a folder
(normalmap_players) is not exist, it just means the plugin wont load any
normal maps for player model.
Attaching Normal Map to material means that material will lose such settings as
specular and environment map (used for vehicle models in San Andreas). Also,
its impossible to combine Normal Map with MatFX effects.
If a geometry uses 2 UV sets (or more) and you attach normal map to its material,
you could see wrong results in a game. Thus nm_matbuild tool deletes additional
UV sets for geometry and leaves only one (first) set.
Adapted models will work normally on a game without Normal Map Plugin
installed.
6
#
# A DFF file path
# B Texture name
# C Normal map texture name
# D Normal map texture alpha mask name --use "-" if texture has no alpha
# E Normal map texture filtering
# F Normal map texture u addressing
# G Normal map texture v addressing
# H Normal map texture has mipmaps
# I Reflection map texture name --optional. If NM doesn't use
reflection, skip these parameters
# J Reflection map texture alpha mask name --use "-" if texture has no alpha
# K Reflection map texture filtering
# L Reflection map texture u addressing
# M Reflection map texture v addressing
# N Reflection map texture has mipmaps
# O Reflection intensity
# P Modulate reflection map with normal map
#
# A B C D E F G H I J K L M N O P
willard.dff wheel wheel_n - 6 1 1 1 wheel_r - 6 1 1 1 2.0 1
Lines marked with # at the beginning are ignored by tool. These lines are
commentaries. They explain parameters which are used in this line:
Notice parameters since I parameter are optional. You dont need them if you dont
plan to add reflection map with normal map to material. So the line will look so in this
case:
In most of cases, you wont need to touch parameters other than texture names and
reflection intensity. So use them only if you know what do they mean.
As usual, for texture filtering use 2 if texture has no mipmaps and 6 if it has them.
1 FILTER_NEAREST
2 FILTER_LINEAR
3 FILTER_MIP_NEAREST
4 FILTER_MIP_LINEAR
5 FILTER_LINEAR_MIP_NEAREST
6 FILTER_LINEAR_MIP_LINEAR
1 WRAP_WRAP
2 WRAP_MIRROR
3 WRAP_CLAMP
For has mipmaps parameter use 1 if texture has mipmaps and 0 if it hasnt.
7
Adapting your models to Normal Map Plugin
For texture alpha mask name (if texture uses alpha) use the same texture name but
with a suffix (for example, reflection and reflectiona).
For reflection intensity, it is normal to use 1.0 value. But you can experiment with
higher and lower values too.
Notice you cant use spaces ( ) within dff path or texture names.
Number of lines inside nm.txt is not limited anyhow. You can use few lines to set
up different materials within one dff model or materials in different dff models.
If there were any problems while attaching normal maps, youll see an error
message in tool window:
File nm.txt not found A tool cant find this file. Check if this file is
placed in the same folder with nm_matbuild.exe.
File filename.dff not found A tool cant find this dff model. Check if a
path is correct.
Cant find material with texture texture A tool cant find material with
such texture name in dff model.
Error when reading dff model There was an error when reading dff
model. Check if everything fine with this model.
8
As you see, it has same parameters with nm_matbuild tool. The only difference is that
if you dont want to include reflections, set Enable parameter to 0 for EnvMap
texture.
EnvMap 0 6 1 1 1 - -
After you built a .mfx file, you will need to import it to DFF model with
RwAnalyze. Create a new section inside Materials Extension (Clump > Geometry
List > Geometry > Material List > Material > Extension) with type Normal Map
PLG (which has an ID 0x133). After this, import .mfx file as a data into this
section.
Notice you need to delete all other Material Extension (if they are presented) if
you attach Normal Map plugin data (such as Specular, Reflection, and
Material Effects).
Also, you need to import some specific data to Atomic which use this material. Create a
new section in Atomics Extension (Clump > Atomic > Extension) with type Right To
Render (which has an ID 0x1F). After this, import:
normalmap_static.rights file if model is not skinned
normalmap_skin.rights file if model is skinned
For non-skinned atomic, it will look like this:
9
Adapting your models to Normal Map Plugin
Normal Maps For Player thing is mainly oriented for global player
modification, such as full player model/textures replacement. It supposes that
all player textures have their normal maps. So if some part hasnt, you could
see some strange result in a game.
10
6. Normal Map Plugin settings
General
UpdateSettingsEachFrame if true (1), settings will be updated each frame.
Gives you an ability to change values in a file and do a quick check in a game
without closing it. A value in ranges [0;1]
MoonIntensity intensity of moon light at night. A value in ranges [0.0;1.0]
Ambient
AmbientMultR, AmbientMultG, AmbientMultB ambient light intensity. It is
recommended to use values in ranges [0.0;1.0], but you can also try higher
values.
Directional
UseSunColors use sun colors (those defined in timecyc.dat file) for directional
light. A value in ranges [0;1]
SunColorsContribution intensity of sun colors (if UseSunColors parameter is
enabled). A value in ranges [0.0;1.0]
DirectionalMultR, DirectionalMultG, DirectionalMultB directional light
intensity. It is recommended to use values in ranges [0.0;1.0], but you can also
try higher values.
11