Jump to content


Rendering clouds with the Mie phase function


  • Please log in to reply
9 replies to this topic

#1 matt

matt

    Peon

  • Members
  • Pip
  • 13 posts
  • Joined: 07-July 09
  • Location:Sydney, Australia
  • Name:Matt Ebb

Posted 12 August 2012 - 03:53 AM

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

#2 edward

edward

    Grand Master

  • Members
  • PipPipPipPipPip
  • 3,326 posts
  • Joined: 10-September 02
  • Name:e.d.w.a.r.d. .

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 matt

matt

    Peon

  • Members
  • Pip
  • 13 posts
  • Joined: 07-July 09
  • Location:Sydney, Australia
  • Name:Matt Ebb

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);

#4 Macha

Macha

    Grand Master

  • Members
  • PipPipPipPipPip
  • 1,654 posts
  • Joined: 23-July 08
  • Location:The Small Big P
  • Name:Marc ♥

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.

Edited by Macha, 12 August 2012 - 03:49 PM.

My Vimeo

LinkedIn

improve side effects - use haskell


#5 matt

matt

    Peon

  • Members
  • Pip
  • 13 posts
  • Joined: 07-July 09
  • Location:Sydney, Australia
  • Name:Matt Ebb

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 edward

edward

    Grand Master

  • Members
  • PipPipPipPipPip
  • 3,326 posts
  • Joined: 10-September 02
  • Name:e.d.w.a.r.d. .

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 matt

matt

    Peon

  • Members
  • Pip
  • 13 posts
  • Joined: 07-July 09
  • Location:Sydney, Australia
  • Name:Matt Ebb

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 jonp

jonp

    Peon

  • Members
  • Pip
  • 60 posts
  • Joined: 10-July 07
  • Location:United States
  • Name:Jon Parker

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.

#9 rob

rob

    Illusionist

  • Members
  • PipPipPip
  • 250 posts
  • Joined: 14-September 06
  • Name:rob

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
Land of Monkey

#10 tjeeds

tjeeds

    Initiate

  • Members
  • PipPip
  • 115 posts
  • Joined: 12-July 07
  • Location:Los Angeles
  • Name:Jesse Erickson

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