Render cubemap and export to HDR file

Hi there,

I’m trying to generate a cubemap of my environment and export it to a texture file like an HDR file.
I have a script that creates my scene and places a camera. I then use Camera.RenderToCubemap(). This works fine and create the cubemap I want. Is it possible to export?

I can save it as an asset I suppose. but I’d really like to be able to export it as a texture. Does Unity have this ability?

Thanks,

  • Rich

You can render cubemap to RenderTexture, and convert to equirectangular format.
Then encode to EXR file so you can save as texture.
I used to export stereo panorama in that way.

By the way you can try Unity Recorder, will be much simpler.
https://docs.unity3d.com/Packages/com.unity.recorder@2.6/manual/RecorderImage.html

4 Likes

Ah, that’s perfect. Thank you!

I found it difficult to use Recorder to capture a cubemap - kept getting empty png files. You can also use OVR screen shot wizard, part of the Oculus Tools package on the app store. Cubemap Screenshots | Oculus Developers