#! /bin/sh

if [ ! -d Cache ]
then
	mkdir Cache
fi

for i in Cache/*.vp
do
	vp=${i/.vp/.cgv}
#	if [ -s $vp ]
	if [ ! $i -ot $vp ]
	then
		echo Compiling VP $vp
		$SCE_PS3_ROOT/host-win32/Cg/bin/sce-cgc -strict -p sce_vp_rsx $i -o $vp
	fi
done

for i in Cache/*.fp
do
	fp=${i/.fp/.cgf}
	if [ ! $i -ot $fp ]
	then
		$SCE_PS3_ROOT/host-win32/Cg/bin/sce-cgc -strict -p sce_fp_rsx $i -o $fp
	fi
done
