additions to render to texture code
some fixes to shadows