Render to file

Hello-

I’ve noticed most/all of the SDK examples use a GLUT window for output. If I can’t spawn a window (e.g., remote login), what is the easiest way to have OptiX render an image to a file without the GUI getting involved?

When you render with OptiX, you get the image data back in an RTbuffer object. You’ll then need to convert that raw data to an image format of your choice and save that to a file. It’s easy to find a lot of image libraries online that you could use to convert the raw data once you retrieve it from the RTbuffer object.

I agree with nljones’ answer: in most of the samples you have the resulting data in an OptiX buffer. You only need to find out what’s the data format (and the GLUT stuff used to display the data can help you discovering that), map it back to the host and display it as you prefer.