Jump to content

Rendering clouds with the Mie phase function


matt

Recommended Posts

I did some work today converting simulated Mie phase function data [1] into a form usable for integration into a vop net shader - an exr file. This can be useful for rendering clouds, faithfully reproducing atmospheric optic effects like fogbows and glories.

I've made a detailed writeup on my blog, and there's a demo on vimeo too:

http://mattebb.com/weblog/rendering-clouds-with-the-mie-phase-function/

cheers

[1] http://evasion.imag.fr/~Antoine.Bouthors/research/phd/thesis/tables/fitted_data_usage.html

  • Like 1
Link to comment
Share on other sites

no, I would have loved to have been there!

henyey-greenstein is reasonably simple[1], perhaps a bit cheaper than to the cost (using this method) of a texture lookup? Probably not by much... To properly calculate the Mie function from scratch is very heavy though - it goes right back to first principles (distribution of droplet sizes) and runs the physics through that. AFAIK it can take something like mieplot on the order of hours to calculate the full 180 degrees..

[1] (1 - g*g) / pow(1 + g*g - 2*g*costheta, 1.5f);

Link to comment
Share on other sites

But you wouldn't have to recalculate it, right?

Once you have the data you can just look it up, like you did there, and if you don't care too much about energy conservation you could tweak it (or make it up!) for different materials.

Edited by Macha
Link to comment
Share on other sites

Well if you'er talking about calculating the Mie function at render time, you may as well just precalculate some versions in an offline process (in mieplot or something) for a few different droplet sizes. I don't know the maths involved but I bet it's pretty complex - not the sort of thing I'd really want to code from scratch in a shadeop or something.

Link to comment
Share on other sites

Hey thanks for posting this, great info. How would you fold this into PBR in a way that could take advantage of MIS (multiple importance sampling)?

I was just about to post a related concern about the included physically based phase function, which is that at extreme forward scattering angles it appears to clamp to a fixed value.

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...