Optimization for camera render function in cpp targets.