IBLBaker

You can access the repository at:

https://github.com/derkreature/IBLBaker

The IBLBaker is a small tool for baking diffuse irradiance and specular pre-convolved environment cubemaps evaluated over roughness over mips computed using a user specified brdf. The baker uses importance sampling to evaluate the environment maps and visualize the results using the separable method proposed by Epic Games at Siggraph 2013. A small reference debug shader for visualizing the results of the importance sampling is provided.

The tool allows a user to save the pre-convolved environment maps for specular over roughness, diffuse irradiance and the BRDF LUT to evaluate the specular environment map to disk for use in other pipelines. Creation of additional BRDFs can be performed by creating additional .brdf files. For the moment there are 2 example brdfs: Schlick Beckmann and Smith GGX.

I have included a couple of sample maya scenes in .ma format with example cgfx shaders.
The inputs to the supplied CgFX shaders are the MDR encoded cubemaps and BRDF LUT that are output from the baker scene.

Usage

The solution was created for Visual Studio 2013 Express. It should also build fine with some minor modifications in Visual Studio 2012.

Input IBLs may be specified in equirectangular or cubemap. While only the DDS codec is enabled by default, it is possible to enable the FreeImage codec by #defining IBL_USE_ASS_IMP_AND_FREEIMAGE = 1.
This will give you access to EXR and HDR formats. You will have to provide your own build of FreeImage.

You will need to provide your own build of both AssImp and FreeImage:
http://assimp.sourceforge.net/
http://freeimage.sourceforge.net/

I will be making a prebuilt before thanksgiving that includes AssImp and FreeImage for people to mess around with.

The documentation in the project Readme.md is much more detailed than this post.

Maya

I have setup a short example video of using this tool and its outputs with Maya. Maya does have some issues with HDR formats and Cgfx. You will need to convert the BrdfLut to 32 bpp for this reason.
Please reach out through my github account if you have any questions, have found bugs or have suggestions.

Notes

A massive number of people must be thanked and attributed for this creation:

- The guys at Munkyfun for agreeing that this was a good idea and supporting me through this project.
  Thanks guys! This project wouldn't have got much further than an idea without them.
        http://www.munkyfun.com/
- Andrew Maximov for the awesome pistol asset to test this work against: http://artisaverb.info/
- Epic and Disney for their continued sessions at Siggraph:
       http://blog.selfshadow.com/publications/s2013-shading-course/
       http://blog.selfshadow.com/publications/s2014-shading-course/
- Sébastien Lagarde: Sebastein Legarde, for his wonderful PBR expositions:
       http://seblagarde.wordpress.com/
- Brian Karis, for detailing all a number of critical equations in one concise and easily consumed web page :
       http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html
- Steve Streeting and the Ogre project, for a useful image codec that didn't require referencing a 1000 other projects. (Sorry for pilfering just the codec stuff).
       http://www.ogre3d.org/
- Philippe Decaudin for the amazing anttweakbar:
        http://anttweakbar.sourceforge.net/doc/
- Arseny Kapoulkine for the wonderful pugi library:
        https://github.com/zeux/pugixml
- Austin Appleby for murmerhash:
        https://code.google.com/p/smhasher/wiki/MurmurHash
- Syoyo Fujita for a compact and reasonably sane obj loader when I had a change of heart regarding the use of AssImp:
        http://syoyo.github.io/tinyobjloader/

Below are some example results running in my personal framework, Kreature.