View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Baking direct lighting into light probe

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

### #1ingramb  Members

Posted 29 January 2014 - 03:50 PM

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?

### #2MJP  Moderators

Posted 29 January 2014 - 09:01 PM

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, 29 January 2014 - 09:04 PM.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.