lightsource
AQSIS_V 1.6.0


segment Data

USES 524384

param uniform  float intensity
param uniform  color lightcolor
param uniform  point from
param uniform  string sfpx
param uniform  string sfnx
param uniform  string sfpy
param uniform  string sfny
param uniform  string sfpz
param uniform  string sfnz
param uniform  float width
param uniform  float samples
param uniform  float falloff
varying  float attenuation
varying  float Lx
varying  float Ly
varying  float Lz
varying  float AbsLx
varying  float AbsLy
varying  float AbsLz
varying  vector Lrel


segment Init
	pushif 1
	pop intensity
	pushif 1
	setfc
	pop lightcolor
	pushif 0
	pushif 0
	pushif 0
	settp
	pushis "current"
	pushis "shader"
	transform2
	pop from
	pushis ""
	pop sfpx
	pushis ""
	pop sfnx
	pushis ""
	pop sfpy
	pushis ""
	pop sfny
	pushis ""
	pop sfpz
	pushis ""
	pop sfnz
	pushif 1
	pop width
	pushif 16
	pop samples
	pushif 2
	pop falloff


segment Code
	pushif 0
	pop attenuation
:0
	S_CLEAR
	pushv from
	illuminate
	S_JZ 1
	RS_PUSH
	RS_GET
	pushv L
	pushis "world"
	vtransform
	pop Lrel
	pushv Lrel
	xcomp
	pop Lx
	pushv Lx
	abs
	pop AbsLx
	pushv Lrel
	ycomp
	pop Ly
	pushv Ly
	abs
	pop AbsLy
	pushv Lrel
	zcomp
	pop Lz
	pushv Lz
	abs
	pop AbsLz
	S_CLEAR
	pushv AbsLy
	pushv AbsLx
	gtff
	pushv AbsLz
	pushv AbsLx
	gtff
	land
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 3
	S_CLEAR
	pushif 0
	pushv Lx
	gtff
	pushis ""
	pushv sfpx
	ness
	land
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 5
	pushv width
	pushis "swidth"
	pushv width
	pushis "twidth"
	pushv samples
	pushis "samples"
	pushv Ps
	pushif 0
	pushv sfpx
	pushif 6
	shadow
	pop attenuation
:5
	RS_INVERSE
	RS_JZ 4
	S_CLEAR
	pushis ""
	pushv sfnx
	ness
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 6
	pushv width
	pushis "swidth"
	pushv width
	pushis "twidth"
	pushv samples
	pushis "samples"
	pushv Ps
	pushif 0
	pushv sfnx
	pushif 6
	shadow
	pop attenuation
:6
	RS_POP
:4
	RS_POP
:3
	RS_INVERSE
	RS_JZ 2
	S_CLEAR
	pushv AbsLx
	pushv AbsLy
	gtff
	pushv AbsLz
	pushv AbsLy
	gtff
	land
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 8
	S_CLEAR
	pushif 0
	pushv Ly
	gtff
	pushis ""
	pushv sfpy
	ness
	land
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 10
	pushv width
	pushis "swidth"
	pushv width
	pushis "twidth"
	pushv samples
	pushis "samples"
	pushv Ps
	pushif 0
	pushv sfpy
	pushif 6
	shadow
	pop attenuation
:10
	RS_INVERSE
	RS_JZ 9
	S_CLEAR
	pushis ""
	pushv sfny
	ness
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 11
	pushv width
	pushis "swidth"
	pushv width
	pushis "twidth"
	pushv samples
	pushis "samples"
	pushv Ps
	pushif 0
	pushv sfny
	pushif 6
	shadow
	pop attenuation
:11
	RS_POP
:9
	RS_POP
:8
	RS_INVERSE
	RS_JZ 7
	S_CLEAR
	pushv AbsLy
	pushv AbsLz
	gtff
	pushv AbsLx
	pushv AbsLz
	gtff
	land
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 12
	S_CLEAR
	pushif 0
	pushv Lz
	gtff
	pushis ""
	pushv sfpz
	ness
	land
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 14
	pushv width
	pushis "swidth"
	pushv width
	pushis "twidth"
	pushv samples
	pushis "samples"
	pushv Ps
	pushif 0
	pushv sfpz
	pushif 6
	shadow
	pop attenuation
:14
	RS_INVERSE
	RS_JZ 13
	S_CLEAR
	pushis ""
	pushv sfnz
	ness
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 15
	pushv width
	pushis "swidth"
	pushv width
	pushis "twidth"
	pushv samples
	pushis "samples"
	pushv Ps
	pushif 0
	pushv sfnz
	pushif 6
	shadow
	pop attenuation
:15
	RS_POP
:13
	RS_POP
:12
	RS_POP
:7
	RS_POP
:2
	RS_POP
	S_CLEAR
	pushif 2
	pushv falloff
	eqff
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 17
	pushv L
	pushv L
	dotpp
	setfc
	pushv lightcolor
	pushv intensity
	pushv attenuation
	pushif 1
	subff
	mulff
	mulfc
	divcc
	pop Cl
:17
	RS_INVERSE
	RS_JZ 16
	S_CLEAR
	pushif 1
	pushv falloff
	eqff
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 19
	pushif 2
	pushv L
	length
	divff
	setfc
	pushv lightcolor
	pushv intensity
	pushv attenuation
	pushif 1
	subff
	mulff
	mulfc
	divcc
	pop Cl
:19
	RS_INVERSE
	RS_JZ 18
	pushv lightcolor
	pushv intensity
	pushv attenuation
	pushif 1
	subff
	mulff
	mulfc
	pop Cl
:18
	RS_POP
:16
	RS_POP
	RS_POP
	jmp 0
:1
