refactor render function to work without lights attached