Advertisement Jump to content
Sign in to follow this  
ingramb

Baking direct lighting into light probe

This topic is 1815 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 have a typical system for rendering light probes, where I render a cube map at the probe position, and then project the cube map onto SH.  I render the lightmapped world geometry into the cube map, which captures indirect lighting from the lights in the lightmap.

 

I'd also like to capture direct lighting from the lightmap lights.  To do this, I was thinking I'd render a sphere with the light's color/radius/position in the cube map for each lightmap light.  Is this the right idea?  Am I missing anything?

Share this post


Link to post
Share on other sites
Advertisement

You can do this, and it will work as long as the light is large enough relative to its projection onto the cubemap texels. If it's too small the cubemap rasterization will undersample the light, and you may get poor results due to aliasing.

 

One alternative would be to directly project the light onto SH, and then combine that with the SH from your cubemap. Peter-Pike Sloan gave an analytic formula for computing the zonal harmonics coefficients of a sphere positioned directly above the Z axis in his "Stupid SH Tricks" paper, which can then be easily rotated to their actual world-space direction (I believe that this paper provides the formula for the rotation). One major downside of this approach is that it won't handle occlusion of the light source (or the light source occluding other geometry/lights), unless of course you handle that yourself.

Edited by MJP

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!