Taking HD Screenshots in Unity

One of my favorite sessions from Vision Summit 2017 was presented by NVIDIA about VRWorks and Ansel. I was really impressed with the ability to create high definition screenshots in Unity using Ansel. It seemed amazingly simple to setup, and the example images I saw were breathtaking. The ability to also take 360 degree screenshots AND 360 degree 3D screenshots for VR games set it over the top though. So when I got home, I started playing with it and wanted to share the results.

Requirements & Setup

Ansel is an NVIDIA tool, so it only works for people with an NVIDIA card.

If you have one though, setup is simple.

Drivers

First, make sure you have drivers that support it.

If your driver version is 368.81 or higher, you should be good.

You can get the most recent NVIDIA drivers here: http://www.nvidia.com/Download/index.aspx

Asset Pack

Once you have them installed, you’ll need to add the plugin from the asset store.

The Script

Once you have the asset pack imported, you simply need to add the Ansel script to your camera.

Not Allowed – The Command Line to enable it

Before you can start taking screenshots though, you’ll need to run the following command to ‘whitelist’ everything (unless you have your app whitelisted).

NvCameraEnable.exe whitelisting-everything

You can find the executable in your NVIDIA install folder.

Mine is in C:\Program Files\NVIDIA Corporation\ansel\Tools

Activating & Taking Screenshots

To activate Ansel, create a build, run your build, then press Alt-F2.

You’ll have a nice dialog appear with a variety of options for taking and adjusting your screenshots.

Movement

While you’re taking screenshots, you can move the camera around!

Use W,A,S,D & X,Z to move, and hold left mouse to rotate.

Results

I wanted to share an image of the super sized screenshots.

Click on the image to view the full size version.

VR Issues

My main use for Ansel is to take great screenshots of VR games.

Unfortunately, it’s a bit more complex than I’d expected, with a few issues that popped up for me.

Luckily, those can be overcome pretty easily.

Single Pass Rendering – This is not supported at the time of this writing. It does appear to be coming soon, but from what I’ve seen, screenshots with SPS enabled do not appear to work properly. VR Support & Camera Movement – If you have “VR Supported” checked in player settings, you won’t be able to move the camera around. In my case, I was able to un-check the option and still take my screenshots, though I’d really prefer being able to move it without breaking VR mode.

Overall Conclusion

I really like Ansel and what they’re doing to make 360 & VR media easier to share. Right now, it’s a bit rough, but I fully anticipate that to be resolved with the 2017.1 version. NVIDIA has some great engineers and Ansel is just a small part of what they’re providing on top of all the awesome hardware (VRWorks looks amazing).