I've been working on bringing Marmoset Toolbag shaders into Unity, and along with it, a suite of tools for processing HDR skies into IBL data.
Introducing: Marmoset Skyshop!
Skyshop takes sky images (panoramas, crosses, or cubemaps) as input and will generate diffuse and specular IBL cubemaps from them.
Web-Player Demo: http://marmoset.co/skyshopdemo/
The specular cubemap also stores varying gloss levels in the different mip-map levels, allowing for blurry specular reflections and gloss-maps in the IBL shader.
A custom cubemap importer saves and loads these mip levels from sub-assets of the cubemap for now. Eventually I want to use DDS cubemaps for everything.
Sky Objects -
The IBL cubemaps can be stored and managed by a custom Sky object in your scene. Sky objects are treated as ambient light-sources in your scene and work along-side Unity's direct lights. They also take care of binding all cubemaps, skyboxes, and exposure settings to our IBL shaders globally, making swapping out skies and messing with exposure through scripting very easy.
High dynamic range skies are handled with a .pbm importer and turned into RGBM textures. All the shaders handle RGBM cubemaps as well, allowing for super light-weight HDR without floating-point textures or any hardware restrictions really; HDR that'll run on a phone!
I plan to write more file formats later, .pbm was just one I had code for already.
Much care is taken to do all the fancy maths and light convolution in linear color-space. All the output textures will work in both Linear and Gamma color-space so both Pro and Free versions of Unity are supported.
Along with the IBL tools, Skyshop will come with all the permutations of shaders and material types you've come to expect from Unity:
diffuse, Blinn-specular, normalmaps, and transparency. The IBL overhead for a shader is really just two cubemap lookups so adding new shader types is easy and I plan to do more of it.
The shaders I've written so far conform to what Toolbag uses and include parameters for:
- Diffuse Color
- Diffuse Intensity
- Specular Color
- Specular Intensity
- Specular Exponent
- Specular Fresnel
And channels for:
- Diffuse map (RGBA)
- Specular (RGB) Gloss (A)
- Normalmap (RGB)
Edit: Skyshop now works in both free and pro versions of Unity 3.5 and 4.