Jump to content

  • Log In with Google      Sign In   
  • Create Account

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.

  • You cannot reply to this topic
1 reply to this topic

#1 ingramb   Members   -  Reputation: 313

Like
0Likes
Like

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?



Sponsor:

#2 MJP   Moderators   -  Reputation: 11352

Like
3Likes
Like

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.



PARTNERS