Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] General Discussion => Topic started by: juancarlosgzrz on 2017-02-27, 21:55:02

Title: Mie & Rayleigh atmospheric scattering
Post by: juancarlosgzrz on 2017-02-27, 21:55:02
Hey I've been testing volume rendering applied as atmosphere, I used a Corona Sun, black environment.  The edges of the atmosphere are hard because there's no option to control density with a map or even control de directionality (Anisotropy) As the atmosphere on the edges it's more visible than on the center.

I've attached a sample rendering.


Title: Re: Mie & Rayleigh atmospheric scattering
Post by: agentdark45 on 2017-02-27, 22:55:49
Nice, would be good to see the developments of this.
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: mferster on 2017-02-28, 00:59:43
Here is a super exaggerated atmosphere that i came up with.

Made with one sphere ( your planet)
Then a large sphere overlapping it (your atmosphere)

The atmosphere material I made is super simple.

0.05 light blue diffuse.

Opacity: 0.25 level; with the falloff map shown in the capture. You adjust the sharp point in the mix curve so it lines up with the horizon of your planet
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: juancarlosgzrz on 2017-02-28, 01:34:14
I keep getting the hard edges.

http://i.imgur.com/pXbOApD.png
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: mferster on 2017-02-28, 16:56:40
Here is my scene file if it helps
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: maru on 2017-02-28, 17:15:26
Density (absorption) can be controlled with a map.
There is also directionality.
It should be easy to get soft edges by simply tweaking the absorption distance. Or maybe I do not understand something?
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: Ludvik Koutny on 2017-02-28, 17:20:42
Unfortunately, Corona can not deal with this yet, as it does not support heterogenous media. You should cast the vote in most requested features list thread.

Only way for now is to fake it using falloff map, as someone above already described, but it's still a pretty bad workflow as it requires matching the end of falloff curve super precisely based on the radius of planed relative to radius of atmosphere.
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: juancarlosgzrz on 2017-02-28, 17:38:34
mferster Thanks buddy I'll check it out.

maru  :  That parameter does change volume density but it's homogeneous meaning the same density at all points, so I need this value to go at sea level i.e. 1, then the higher the altitude the less the value, creating a gradient like effect.
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: maru on 2017-02-28, 17:42:23
maru  :  That parameter does change volume density but it's homogeneous meaning the same density at all points, so I need this value to go at sea level i.e. 1, then the higher the altitude the less the value, creating a gradient like effect.
Oh I get it now. Sorry, I probably read the thread too briefly.
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: Ondra on 2017-02-28, 20:54:40
Unfortunately, Corona can not deal with this yet, as it does not support heterogenous media. You should cast the vote in most requested features list thread.
Does needing this for one test project really makes it the most wanted feature? Remember, that thread is not "every feature needed ever", but "what hurts you the most generally"
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: Ludvik Koutny on 2017-02-28, 21:12:02
Unfortunately, Corona can not deal with this yet, as it does not support heterogenous media. You should cast the vote in most requested features list thread.
Does needing this for one test project really makes it the most wanted feature? Remember, that thread is not "every feature needed ever", but "what hurts you the most generally"

No, but heterogenous volumetric media is needed by a lot of people for many different use cases, and if implemented, it would cover this use case as well.

Actually, rendering planets is not always a test use case. I remember helping a studio render planet atmosphere in Corona couple of years ago, because they could not find a way around it, and ended up suggesting to use the falloff map fake, which worked, but the workflow proved so tedious they reverted to V-Ray for that project. And I myself was doing some planet renders not that long ago, and had to resort to that ridiculous workaround too.

I think when people think of heterogenous media, planet atmosphere is one of the last things they consider, and despite that, it's now #1 request. That speaks for something, especially considering Corona has mainly archviz userbase now.
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: bluebox on 2017-02-28, 22:05:49
Unfortunately, Corona can not deal with this yet, as it does not support heterogenous media. You should cast the vote in most requested features list thread.
Does needing this for one test project really makes it the most wanted feature? Remember, that thread is not "every feature needed ever", but "what hurts you the most generally"

No, but heterogenous volumetric media is needed by a lot of people for many different use cases, and if implemented, it would cover this use case as well.

Actually, rendering planets is not always a test use case. I remember helping a studio render planet atmosphere in Corona couple of years ago, because they could not find a way around it, and ended up suggesting to use the falloff map fake, which worked, but the workflow proved so tedious they reverted to V-Ray for that project. And I myself was doing some planet renders not that long ago, and had to resort to that ridiculous workaround too.

I think when people think of heterogenous media, planet atmosphere is one of the last things they consider, and despite that, it's now #1 request. That speaks for something, especially considering Corona has mainly archviz userbase now.

Totaly agree, one can see this being requested for some time. Imho very important now, when archiviz is shifting and is not about making only sunny images anymore, but also making very very moody images. Fog is one of those moody additions that can change otherwise boring scenatio into super interesting one ;)

(http://images.fineartamerica.com/images-medium-large-5/highlands-nc-morning-mist-blue-ridge-mountains-fog-dave-allen.jpg)

Don't get me wrong, I dont want to start "this over that" debate again because I can (to a certain degree) understand your point of view of providing most complex rendering package you can, but you guys really could think of supporting for example phoenix fd or any other similiar package instead of lets say  further development of Corona Scatter (I don't mean you should totaly forget about it) which in my humble opinion is basically reinventing the wheel since one can get Forest Pack or Multiscatter which both are far superior atm.
You already provided an intermediate scattering solution to people needing one, if they need something more powerfull they can get one of the above and will still remain your clients. Those requesting support for non homogeneous media still don't have anything :)
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: juancarlosgzrz on 2017-02-28, 23:54:40
@Rawalanche @bluebox You are right

So @Ondra, I can do this in Vray, Cycles, but there's no way to do it in Corona? :1
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: juancarlosgzrz on 2017-03-03, 00:14:36
No answer?
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: jorari71 on 2017-03-30, 15:41:17
I have the same needing: how to implement this fading atmosphere for a planet rendering from the space.
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: dvdufo on 2019-01-18, 18:58:39
Here is the link to "HOW TO CREATE PLANETARY ATMOSPHERE WITH CORONA C4D" by Shawn Astrom.
https://lesterbanks.com/2018/11/planetary-atmosphere-corona-c4d/ (https://lesterbanks.com/2018/11/planetary-atmosphere-corona-c4d/)

I tried to go step by step by his guides, not in C4D but inside 3DS Max and corona.
I noticed that max version of corona, lacks the "Mix Mode" option for texture in Corona Volume Material in Absorption & Scattering section.
He uses Fresnel map in both Absorption & Scattering texture with Mix Mode set to Multiply to fade edges of atmosphere.
Anyone know how to do same or something similar to reach that fade effect on edges of Atmosphere?
I tried to reach that with Corona Distance & Fall off map but with no success.
Here's my render
https://imgur.com/a/eCMwN0w (https://imgur.com/a/eCMwN0w)

Title: Re: Mie & Rayleigh atmospheric scattering
Post by: juancarlosgzrz on 2019-01-18, 22:22:43
Do not use fallof, use a gradient map to drive density.
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: juancarlosgzrz on 2019-01-21, 22:15:39
http://dev.wallworm.com/document/252/osl_radial_gradient.html
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: dvdufo on 2019-02-09, 15:15:18
Thanks juancarlosgzrz for your reply but actually I couldn't reach to my wanted result.
I used radial_gradient.osl too but I may missing something, and I can't get them to work as realistic fade on edge of atmosphere.
Actually I can reach my wanted effects in simple Corona MTL like assigning a FallOff map or GradientRamp to Opacity slot and making edges go fade but when using CoronaVolumeMaterial, it behaves as sharp edge shrink instead of fade.
I uploaded 3DsMax scene file with materials I used on slate material editor. I hope someone can help me.
Thanks.
Title: Re: Mie & Rayleigh atmospheric scattering
Post by: sprayer on 2019-02-09, 18:53:45
(https://i.imgur.com/JOacPEF.jpg)

this effect you want?

I used falloff map because for gradient ramp you need uvw map, you rotate camera so it won't properly placed, but it's possible if you make camera angle perpendicular to plane uvw
Title: Falloff works great on Zoomed renders but not when looking from distance...
Post by: dvdufo on 2019-05-11, 23:56:33
Thank you Sprayer. Yes, this is what I want on atmosphere edge. But there's a problem.
On zoomed renders your falloff method works great, I copied your falloff map to mine, both looks well in zoomed but both looks fake on zoomed out renders, specially mine :)
in fact adding falloff affects atmosphere's realistic look.
(https://i.imgur.com/rwBfHPV.jpg)
Title: Re: Falloff works great on Zoomed renders but not when looking from distance...
Post by: sprayer on 2019-05-12, 09:46:32
Not sure how you  want it to look on zoom out view, if you want it to increase the size you may adjust radius of atmosphere sphere object and adjust curve in falloff map with distance in coronaVolume shader
(https://i.imgur.com/PB0Xba7.png)