Rendering to texture working correctly