lightsource
AQSIS_V 1.6.0


segment Data

USES 524384

param uniform  float intensity
param uniform  color lightcolor
param uniform  point from
param uniform  point to
param uniform  float coneangle
param uniform  float conedeltaangle
param uniform  float beamdistribution
param uniform  string shadowname
param uniform  float samples
param uniform  float width
param uniform  float blur
param uniform  float falloff
varying  float atten
varying  float cosangle
uniform  point A
uniform  float cosoutside
uniform  float cosinside


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
	pushif 1
	pushif 0
	pushif 0
	settp
	pushis "current"
	pushis "shader"
	transform2
	pop to
	pushif 30
	radians
	pop coneangle
	pushif 5
	radians
	pop conedeltaangle
	pushif 2
	pop beamdistribution
	pushis ""
	pop shadowname
	pushif 16
	pop samples
	pushif 1
	pop width
	pushif 0
	pop blur
	pushif 2
	pop falloff


segment Code
	pushv from
	pushv to
	subpp
	length
	setfp
	pushv from
	pushv to
	subpp
	divpp
	pop A
	pushv coneangle
	cos
	pop cosoutside
	pushv conedeltaangle
	pushv coneangle
	subff
	cos
	pop cosinside
:0
	S_CLEAR
	pushv coneangle
	pushv A
	pushv from
	illuminate2
	S_JZ 1
	RS_PUSH
	RS_GET
	pushv L
	length
	pushv A
	pushv L
	dotpp
	divff
	pop cosangle
	S_CLEAR
	pushif 2
	pushv falloff
	eqff
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 3
	pushv L
	pushv L
	dotpp
	pushv beamdistribution
	pushv cosangle
	pow
	divff
	pop atten
:3
	RS_INVERSE
	RS_JZ 2
	S_CLEAR
	pushif 1
	pushv falloff
	eqff
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 5
	pushif 2
	pushv L
	length
	divff
	pushv beamdistribution
	pushv cosangle
	pow
	divff
	pop atten
:5
	RS_INVERSE
	RS_JZ 4
	pushv beamdistribution
	pushv cosangle
	pow
	pop atten
:4
	RS_POP
:2
	RS_POP
	pushv cosangle
	pushv cosinside
	pushv cosoutside
	smoothstep
	pushv atten
	mulff
	pop atten
	pushv lightcolor
	pushv intensity
	pushv atten
	mulff
	mulfc
	pop Cl
	S_CLEAR
	pushis ""
	pushv shadowname
	ness
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 6
	pushv width
	pushis "width"
	pushv blur
	pushis "blur"
	pushv Ps
	pushif 0
	pushv shadowname
	pushif 4
	shadow
	pushif 1
	subff
	setfc
	pushv Cl
	mulcc
	pop Cl
:6
	RS_POP
	RS_POP
	jmp 0
:1
