Linear EXR Texture Baking

Texture Baking 3dsmax/Vray -> Unity3d)

I wanted to post this up for future reference. Somehow I've managed to bake textures as .tga all this time without complaining - The problem is I wanted to try baking my textures as .exr. But when baking more than one object, you aren't able to adjust the filetype you want to export your baked textures as. So they default to .tga

While chatting with a friend about making a baking script for me, we stumbled across this post online - http://forums.cgarchitect.com/34620-render-texture-multiple-objects-jpg.html. Michiel Quist posts the steps needed to change the default filetype used by the Render to Texture dialog.

  • Find your 3dsmax folder and go into this subfolder ...\UI\MacroScripts
  • Edit 'Macro_BakeTextures.mcr' in a text editing program
  • Find this line, local    defaultFileType = ".tga" -- default bitmap file extension

I replaced .tga with .exr to try and take advantage of rendering textures in linear color space. I know Unity3d has buttons for working with linear color space.

So far in Unity3d I've done this --

  • Change the imported texture settings to 'advanced' texture type
    - Bypass sRGB Sampling, tick On
    - Encode as RGBM, tick Off
    - Generate Mip Maps, tick Off
    - Wrap Mode, Clamp
    - Format, Automatic Truecolor
  • Camera has HDR ticked. edit: this is been problematic. One thing is that HDR cameras do not support MSAA. Another problem is that Unity does not support post corrections to linear exr textures. You'd need to invest in Amplify Textures 2 if you wanted full control. But even then, the sacrifice of MSAA doesn't seem to be worth it at the moment.

  • Batch convert materials to lit/texture, then selectively go around and switch various textures/shaders to standard material to give reflective properties
  • Extra camera screen space adjustments

I'll try and put together a personal 3d scene at home that I can share this new process.