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/w...phase-function/
https://vimeo.com/47389097
cheers
[1] http://evasion.imag....data_usage.html
Rendering clouds with the Mie phase function
Started by matt, Aug 12 2012 03:53 AM
9 replies to this topic
#1
Posted 12 August 2012 - 03:53 AM
#2
Posted 12 August 2012 - 06:35 AM
Interesting. Were you at SIGGRAPH? The DreamWorks cloud presentation mentioned that it would nice if we could render the Mie function. I wonder how this compares in speed with henyey-greenstein.
don't panic!
#3
Posted 12 August 2012 - 02:08 PM
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);
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);
#4
Posted 12 August 2012 - 03:49 PM
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.
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, 12 August 2012 - 03:49 PM.
#5
Posted 12 August 2012 - 05:13 PM
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.
#6
Posted 13 August 2012 - 07:52 AM
BTW, I tried a simple example and couldn't find any problems with an array with 2000 entries in VEX. It would really help if you could log an issue with your version of the shader that uses arrays.
don't panic!
#7
Posted 13 August 2012 - 02:41 PM
oh thanks! I should give it a more thorough look to see what the deal is there.
#8
Posted 16 August 2012 - 05:07 PM
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.
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.
#9
Posted 20 August 2012 - 12:19 AM
Hey Matt,
Very interesting stuff. Were you on Dan B's cloud team at Dr D. I was always very interested in the set up you guys were using.
Rob
Very interesting stuff. Were you on Dan B's cloud team at Dr D. I was always very interested in the set up you guys were using.
Rob
Land of Monkey
#10
Posted 24 October 2012 - 01:43 PM
Lovin' it Matt. You're a killer!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users










