Rendering and Shaders: Difference between revisions
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
Valid map slots to be used are Diffuse, Specular Colour, Glossiness, and Bump (which is the normal map). The exporter should correctly handle baked materials. The maps are available in the game shaders in the following order in samplers [0-3]. | Valid map slots to be used are Diffuse, Specular Colour, Glossiness, and Bump (which is the normal map). The exporter should correctly handle baked materials. The maps are available in the game shaders in the following order in samplers [0-3]. | ||
Diffuse | Diffuse | ||
Normal | Normal | ||
Specular | Specular | ||
Gloss | Gloss | ||
=== Tool Controls === | === Tool Controls === | ||
Hold LMB - rotate camera | Hold LMB - rotate camera | ||
Hold RMB - pan camera | Hold RMB - pan camera | ||
Mousewheel - zoom | Mousewheel - zoom | ||
RETURN - reset camera | RETURN - reset camera | ||
L - cycle through lights | L - cycle through lights | ||
SPACE - toggle camera light | SPACE - toggle camera light | ||
F1 - reload shaders | F1 - reload shaders | ||
=== CONFIG file === | === CONFIG file === | ||
Line 32: | Line 32: | ||
PATH ... | PATH ... | ||
Lights | |||
Multiple lights can be set up, each light must be a triplet of direction, colour, and ambient | |||
[LIGHTS] | |||
DIRECTION <vector> | |||
COLOUR <hex> | |||
AMBIENT <hex> | |||
DIRECTION ... | |||
And example CONFIG file is | |||
<code> | |||
[TEXTURES] | |||
PATH C:\DATA\BATTLE\UNITTEXTURES | |||
PATH C:\DATA\TEXTURES | |||
[LIGHTS] | |||
DIRECTION 0 -1 0 | |||
COLOUR FFFF0000 | |||
AMBIENT FF003300 | |||
DIRECTION 1 0 0 | |||
COLOUR FFFFFF00 | |||
AMBIENT 0 | |||
</code> | |||
==Shader input data== | ==Shader input data== |
Revision as of 21:27, 18 November 2015
Converter Tool
NOTE: The Converter replaces the MAX script plugin for exporting units. The converter can accept FBX files from most 3D tools.
Valid map slots to be used are Diffuse, Specular Colour, Glossiness, and Bump (which is the normal map). The exporter should correctly handle baked materials. The maps are available in the game shaders in the following order in samplers [0-3].
Diffuse Normal Specular Gloss
Tool Controls
Hold LMB - rotate camera Hold RMB - pan camera Mousewheel - zoom RETURN - reset camera L - cycle through lights SPACE - toggle camera light F1 - reload shaders
CONFIG file
If a CONFIG.TXT file is found in the same folder as the EXE, it can contain the following:
Texture Paths
Multiple texture paths which are searched in order for any textures
[TEXTURES] PATH <texturePath> PATH ...
Lights
Multiple lights can be set up, each light must be a triplet of direction, colour, and ambient
[LIGHTS] DIRECTION <vector> COLOUR <hex> AMBIENT <hex>
DIRECTION ...
And example CONFIG file is
[TEXTURES]
PATH C:\DATA\BATTLE\UNITTEXTURES
PATH C:\DATA\TEXTURES
[LIGHTS]
DIRECTION 0 -1 0
COLOUR FFFF0000
AMBIENT FF003300
DIRECTION 1 0 0
COLOUR FFFFFF00
AMBIENT 0
Shader input data
When writing shaders, the following registers can be assumed to be filled
- world matrix c0
- view matrix c4
- projection matrix c8
- WVP combo c12
- light data (dir, colour, ambient) c16
- world Normal matrix c20
- shadowmap lighting trx combo c24
- camera position vector c28
- c29-31 not used yet
- c32 assume all past here are bones