Optimizing scenes and models