added soft shadow code fromcookbook