Jump to content
  • Advertisement
Sign in to follow this  
L. Spiro

Generating Cube Maps for IBL

This topic is 2028 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to add IBL to my engine (finally) and was just about to use Debevec's HDRShop when I found out it costs too much and is not an option.

I checked for other tools but found mostly things for Blender, Maya, Unity 3D, etc.

#1: Are there are alternative tools you would recommend? I expect to provide it an input cube-map and have it return the cube-map that I need as a look-up table for IBL.
#2: How would I go about making my own? I am not at all against making my own, especially since that would give me full control over the output format. All I need to know is the basic method in which it is done.

I am guessing that for each pixel on the final IBL cube-map you simply sample a hemisphere of the original cube-map (maybe 256 samples or so?) and sum their weighted lambertian contributions (integrating them). Yes? No? Close? Can’t find much on generating these cube-maps either.


Thank you,
L. Spiro Edited by L. Spiro

Share this post


Link to post
Share on other sites
Advertisement
Hi,

ATIs CubeMapGen does what you want and although it's no longer being updated the source is available: http://developer.amd.com/resources/archive/archived-tools/gpu-tools-archive/cubemapgen/

IIRC in a recent presentation on the new Killzone, one of Guerrilla's devs said that they'd modified the code to match their BRDF when doing the integration, so material roughness is treated uniformly for all light types.

Oh, and this is handy for some of the background and rolling your own: http://www.rorydriscoll.com/2012/01/15/cubemap-texel-solid-angle/

thanks,
T

* Hmmm, not so sure it was Guerrilla now... I'll have a look and edit the post if I find different. Edited by Tessellator

Share this post


Link to post
Share on other sites

The general approach is to the take the input cubemap as if it contained radiance at each texel, and pre-integrate the radiance with some approximation of your BRDF. Unfortunately it's not possible to pre-integrate anything except for plain Phong without having to also parametrize on the view direction, so the approximation is not that great if you want a 1:1 ratio of cubemaps. Most people will use CubeMapGen to convolve with a phong-like lobe, using a lower specular power for each successive mip level. You can roll your own if you want, it's not terribly difficult. I actually made a compute shader integrator that we use in-house. Just make sure that you account for the non-uniform distribution of texels in a cubemap when you're integrating, otherwise the result will be incorrect.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!