ASM Shader Info

A forum to store posts deemed exceptionally wise and useful
Post Reply
AlexL
Posts: 184
Joined: Tue Mar 02, 2004 6:06 pm
Location: Washington State

ASM Shader Info

Post by AlexL »

For quite a long while the ASM shading language really confused me, so I went off searching and reading quite abit and found some information on the language. I thought I'd share this bit of information that I found for anyone else who is having the same troubles with the ASM shading language as I did.
1. Syntax
Shader source are organised as following :
(brackets means that content is not needed)
[const r g b a ]
texture stage 0
[texture stage 1]
[...]
[texture stage N]

Each texture stage is composed of following parts :
tex param
rgb.operator param param
alpha.operator param param


1.1. const keyword
const keyword is optional and is used to specify a constant colour value.
It is followed by for values corresponding to Red, Green, Blue and Alpha components of colour.
Each values must be in range [0-255].
The constant colour is used with the c0 parameter (see 1.3.)


1.2. tex keyword
tex keyword specify to the texture stage which texture slot to use.
It influences any rgb and alpha placed after.

Texture slots can be numbers or following values :
0 diffuse
1 lightmap
2 detail
3 normalmap
4 reflection
5 user0
6 user1
7 normcubemap
8 internal0
9 internal1

1.3. rgb and alpha keywords
These keywords specify texture stage setup for for rgb and alpha components
Operator following those keyword can take the values contained in this table :
disable
leftarg
modulate
modulate2x
modulate4x
add
addsigned
subtract
diffusealpha
texturealpha
currentalpha
dot3

Each operator is followed by two parameters. The possible values for them are :
d0 diffuse colour
c0 constant colour
t0 texture
r0 previous stage
Post Reply