Started by Sep 23 2011 02:09 PM

,
5 replies to this topic

Posted 23 September 2011 - 02:09 PM

I'm not sure if this should be here or in the Math & Physics forum, if the mods want to move it, I won't complain.

I think I may have solved the Out-scattering integral as given in the GPU-Gems 2 article on atmospheric scattering.

I've written a solution and explanation on my crappy blog.

I would love it if some of you fine folks could go over my solution for me and let me know if I'm right, and perhaps even figure out how to apply it to solving the full In-scattering integral as well.

Thanks!

I think I may have solved the Out-scattering integral as given in the GPU-Gems 2 article on atmospheric scattering.

I've written a solution and explanation on my crappy blog.

I would love it if some of you fine folks could go over my solution for me and let me know if I'm right, and perhaps even figure out how to apply it to solving the full In-scattering integral as well.

Thanks!

Waramp.Before you insult a man, walk a mile in his shoes.That way, when you do insult him, you'll be a mile away, and you'll have his shoes.

Posted 24 September 2011 - 01:36 PM

Hi WarAmp,

Looking at your results it seems like your analytical solution is correct. The strange thing is that in all of the atmospheric scatting papers I've read, none have mentioned that this integral can by solved this way. They always rely on look-up tables or different sampling techniques. Funny thing is that I think Sean O'neil was getting close to analytically solving the integral in the article itself (section 16.4.1).

Inigo Quilez presents a solution similar to yours on an article on his website (link) if you would like to compare.

Victor

Looking at your results it seems like your analytical solution is correct. The strange thing is that in all of the atmospheric scatting papers I've read, none have mentioned that this integral can by solved this way. They always rely on look-up tables or different sampling techniques. Funny thing is that I think Sean O'neil was getting close to analytically solving the integral in the article itself (section 16.4.1).

Inigo Quilez presents a solution similar to yours on an article on his website (link) if you would like to compare.

Victor

Posted 25 September 2011 - 02:39 AM

Yea, his look-up table solution is pretty similar isn't it? And so is Inigo's. That's good, it makes me a bit more confident that I'm on the right track

Thanks for taking the time to look at it.

I think I can solve the In-scattering portion as well, I just need a way to figure out how to determine the distance to the edge of a circle along a line in 2D, given very limited information. I'll post more here if I can ever figure it out.

Thanks for taking the time to look at it.

I think I can solve the In-scattering portion as well, I just need a way to figure out how to determine the distance to the edge of a circle along a line in 2D, given very limited information. I'll post more here if I can ever figure it out.

Waramp.Before you insult a man, walk a mile in his shoes.That way, when you do insult him, you'll be a mile away, and you'll have his shoes.

Posted 25 September 2011 - 02:47 PM

Maybe I misunderstood something, but IMHO:

h =/= ((A + (C*x/N)) - R)

i.e. altitude is not a linear function. You can start from upper atmosphere (A), go through point at sea level and end in upper atmosphere again (B).

h =/= ((A + (C*x/N)) - R)

i.e. altitude is not a linear function. You can start from upper atmosphere (A), go through point at sea level and end in upper atmosphere again (B).

Lauris Kaplinski

First technology demo of my game Shinya is out: http://lauris.kaplinski.com/shinya

Khayyam 3D - a freeware poser and scene builder application: http://khayyam.kaplinski.com/

First technology demo of my game Shinya is out: http://lauris.kaplinski.com/shinya

Khayyam 3D - a freeware poser and scene builder application: http://khayyam.kaplinski.com/

Posted 25 September 2011 - 03:42 PM

...Isn't the distance to a circle from a line just part of a collision check?Yea, his look-up table solution is pretty similar isn't it? And so is Inigo's. That's good, it makes me a bit more confident that I'm on the right track

Thanks for taking the time to look at it.

I think I can solve the In-scattering portion as well, I just need a way to figure out how to determine the distance to the edge of a circle along a line in 2D, given very limited information. I'll post more here if I can ever figure it out.

OTOH, I'm probably misunderstanding something.

Are you going to put this in an article when you're done?

Now open: MouseProduced Games

Posted 25 September 2011 - 08:36 PM

Oohhhhh shiiiitttt. You are right. Seems like my solution is only good for flat-plane surfaces.Maybe I misunderstood something, but IMHO:

h =/= ((A + (C*x/N)) - R)

i.e. altitude is not a linear function. You can start from upper atmosphere (A), go through point at sea level and end in upper atmosphere again (B).

Well, thats why I posted it on here in the first place So I guess the proper solution would actually involve taking the magnitude of the point, not just the interpolated value. I'll see if I can figure that out.

Thanks for noticing! I guess it's still valid for planes though, which is something.

Waramp.Before you insult a man, walk a mile in his shoes.That way, when you do insult him, you'll be a mile away, and you'll have his shoes.