surface
AQSIS_V 1.6.0


segment Data

USES 510215

param uniform  string dMap
param uniform  float Kd
param uniform  string sMap
param uniform  float Ks
param uniform  float roughness
param uniform  string oMap
param uniform  float Ko
param uniform  string bMap
param uniform  float Kb
param uniform  string aMap
param uniform  float Kf
param uniform  float Ka
param uniform  string pass
varying  color diff
varying  float spec
varying  float bmp
varying  float opac
varying  color afx
varying  normal Nf
varying  vector V


segment Init
	pushis ""
	pop dMap
	pushif 1
	pop Kd
	pushis ""
	pop sMap
	pushif 1
	pop Ks
	pushif 0.5
	pop roughness
	pushis ""
	pop oMap
	pushif 1
	pop Ko
	pushis ""
	pop bMap
	pushif 0.025
	pop Kb
	pushis ""
	pop aMap
	pushif 1
	pop Kf
	pushif 1
	pop Ka
	pushis "beauty"
	pop pass


segment Code
	pushif 1
	pushif 1
	pushif 1
	settc
	pop diff
	pushif 1
	pop spec
	pushif 1
	pop bmp
	pushif 1
	pop opac
	pushif 0
	pushif 0
	pushif 0
	settc
	pop afx
	S_CLEAR
	pushis ""
	pushv dMap
	ness
	pushis "beauty"
	pushv pass
	eqss
	pushis "diff"
	pushv pass
	eqss
	lor
	land
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 0
	pushv t
	pushv s
	pushif 0
	pushv dMap
	pushif 0
	ctexture2
	pop diff
:0
	RS_POP
	S_CLEAR
	pushis ""
	pushv sMap
	ness
	pushis "beauty"
	pushv pass
	eqss
	pushis "spec"
	pushv pass
	eqss
	lor
	land
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 1
	pushv t
	pushv s
	pushif 0
	pushv sMap
	pushif 0
	ftexture2
	pop spec
:1
	RS_POP
	S_CLEAR
	pushis ""
	pushv bMap
	ness
	pushis "beauty"
	pushv pass
	eqss
	pushis "bmp"
	pushv pass
	eqss
	lor
	land
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 2
	pushv t
	pushv s
	pushif 0
	pushv bMap
	pushif 0
	ftexture2
	pop bmp
:2
	RS_POP
	S_CLEAR
	pushis ""
	pushv oMap
	ness
	pushis "beauty"
	pushv pass
	eqss
	pushis "opac"
	pushv pass
	eqss
	lor
	land
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 3
	pushv t
	pushv s
	pushif 0
	pushv oMap
	pushif 0
	ftexture2
	pop opac
:3
	RS_POP
	S_CLEAR
	pushis ""
	pushv aMap
	ness
	pushis "beauty"
	pushv pass
	eqss
	pushis "add"
	pushv pass
	eqss
	lor
	land
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 4
	pushv t
	pushv s
	pushif 0
	pushv aMap
	pushif 0
	ctexture2
	pop afx
:4
	RS_POP
	S_CLEAR
	pushis "bmp"
	pushv pass
	eqss
	pushis "beauty"
	pushv pass
	eqss
	lor
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 5
	pushv N
	normalize
	pushv bmp
	pushv Kb
	mulff
	mulfp
	pushv P
	addpp
	calculatenormal
	pop N
:5
	RS_POP
	pushv I
	pushv N
	normalize
	faceforward
	pop Nf
	pushv I
	normalize
	negp
	pop V
	pushv afx
	pushv roughness
	pushv V
	pushv Nf
	specular
	pushv spec
	pushv Ks
	mulff
	mulfc
	pushv Nf
	diffuse
	pushv diff
	pushv Kd
	mulfc
	mulcc
	addcc
	pushv Cs
	mulcc
	addcc
	pop Ci
	S_CLEAR
	pushis "opac"
	pushv pass
	eqss
	pushis "beauty"
	pushv pass
	eqss
	lor
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 6
	pushv opac
	setfc
	pushv Os
	mulcc
	pop Oi
:6
	RS_POP
	pushv Oi
	pushv Ci
	mulcc
	pop Ci
	S_CLEAR
	pushis ""
	pushv pass
	ness
	pushis "beauty"
	pushv pass
	ness
	lor
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 7
	S_CLEAR
	pushis "spec"
	pushv pass
	eqss
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 8
	pushv spec
	setfc
	pop Ci
:8
	RS_POP
	S_CLEAR
	pushis "bmp"
	pushv pass
	eqss
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 9
	pushv bmp
	setfc
	pop Ci
:9
	RS_POP
	S_CLEAR
	pushis "diff"
	pushv pass
	eqss
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 10
	pushv diff
	pop Ci
:10
	RS_POP
	S_CLEAR
	pushis "opac"
	pushv pass
	eqss
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 11
	pushv opac
	setfc
	pop Ci
:11
	RS_POP
	S_CLEAR
	pushis "add"
	pushv pass
	eqss
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 12
	pushv afx
	pop Ci
:12
	RS_POP
:7
	RS_POP
