Jump to content
  • Advertisement
Sign in to follow this  
Tatsunami

Light-scattering integral

This topic is 4815 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

Hello! I've been reading and reading and reading any number of papers on advanced lighting and shading with regards to light-scattering (Harris, Dobashi, Nishita.. The big guns), but I keep getting hung up on actually implementing an algorithm for solving the integral(s) and, really, the whole system in some cases. I was wondering what data, in the case of multiple-scattering, is typically pre-computed and stored in look-up tables, what data is generated in real-time through discrete numerical integration, and what algorithms are commonly used for doing numerical integration at discrete points on the CPU/GPU? Overall, I suppose I'm asking what methods are available for solving these systems. Thanks! Chris Millward

Share this post


Link to post
Share on other sites
Advertisement
I've made several experiments trying to store scattering information FOR A WHOLE PLANET in a lookup table.
I ended up with the conclusion that the extinction part (the fraction of light that leaves the ray from object to eye) can be stored in a 3D table (possibly 2D).
The inscatter part (the light that is added to the light in the ray object-eye) depends also on the sun position, giving 2 more degrees of freedom in my case, so that's 5 dimensions! Too much!

Anyway, if you just want light scattering for low altitudes (say, <5000m), things simplyfy a lot. You should be able to store everything in a 2D table then, I guess.

Share this post


Link to post
Share on other sites
I think you can do something by mixing the CPU and the GPU. Some parameters of extinction/inscattering are dependant on your position on the planet. As such, you can make a texture assuming these parameters are constants for your current position, and recompute the lookup textures on-the-fly when your position on the planet has changed too much.

I haven't tried to implement it (yet) though. It might also be an issue if your camera moves too fast (like going from one point of the planet to another in one second).

If your lookup textures are 256x256, updating them in pseudo-real-time should not cost too much.

Y.

Share this post


Link to post
Share on other sites
It depends if you want this for a real-time application in a scanline renderer or on off-line application such as a ray-tracer. In isotropic materials, you can approximate multiple scattering using something called the Dipole Diffusion approximation (see both of Jensen's papers on subsurface scattering). This can be done quickly if you use a heirarchical structure like a kd-tree or octree to cache irradiance samples. There are also techniques like ray marching and photon marching that can be used to solve single or multiple scattering. Just google for them to find out more.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I haven't done any work on realtime light scattering but I think this paper looks good. The multiple scattering is simulated by changing and tweaking different parameters of the extinction and phase functions.
http://www.imm.dtu.dk/pubdb/views/edoc_download.php/2554/pdf/imm2554.pdf

I am currently implementing a NON realtime renderer/simulator for the atmosphere using a wavelength based path tracer.

Multiple scattering I think depends on if you are rendering clouds or the sky. I am currently implementing second order scattering as described in the paper from Nishita from 1996! We'll see how it turns out.

In general I think it's quite hard for "programmers" to make sense of all these papers on atmospheric scattering, I've read lot's of them and it took some time to get the hang of it :-) And multiple scattering is usually just briefly mentioned.

Good luck.




Share this post


Link to post
Share on other sites
Thanks for replying, everyone!

AP, that paper is huge, I can't wait to get into it (probably shouldn't print all 134 pages at work, I'll have to wait until tonight :( )

Chris Millward

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!