What do you think about the light scattering in these clouds?

Started by Daniil, August 30, 2013, 01:10:19 AM

Previous topic - Next topic

Daniil

What do you think about the light scattering in these clouds? Especially in the cases when the sun is behind the camera?

Dune

I like the light in all but the first (except for the grain in some of the last). In the first the clouds look like plastic foam or something, and the light almost looks reversed, as if lit from inside only. A bit strange.
Second is great, as well as some of the middle ones. I wouldn't mind seeing the tgd's for those clouds  ;) How high are these clouds?

TheBadger

Yeah, last 4 are nice.

Welcome, blinkfrog.
You did not have to post these down here in "open". If you move up to "image sharing" you'll probably get more feed back.
It has been eaten.

Daniil

TheBadger Well, this isn't Terragen, it is my own engine, so I think "Image Sharing" isn't appropriate.

Dune, and because of that, tgds are not available too. :)

Well, it's a pity that the first image isn't good. Because it is my first goal to render this phenomena.

I noticed, that all programs I have seen are very weak in rendering the clouds when the sun is behind the camera. And because of that the artists usually avoid to make the scenes when the sum is behind and prefer to set it at side or in front of camera. And even vue-featured cartoons do the same way.

When the angle between camera direction and sun direction is small there is mostly only the first order of light scattering plays the main role. And also some variants of higher order scattering, and skylight (which is sunlight too, but already scattered in the sky). But wider the angle, the bigger role starting to play the higher orders of light scattering, when the fotons are travelling at complex paths in the cloud.

In result there are many interesting phenomena, one of interested I believe the next: when the camera-sun angle is big enough (sun is behind the observer) the bigger clouds and it's bigger parts became brighter, and the edges of clouds seems darker than the inner parts. The bigger and densier clouds are, the more prominent is effect.

You can see this phenomena on many photos. For example:
http://www.flickr.com/photos/marotta47/288230372/   (very high pseudo-internal light too)
http://commons.wikimedia.org/wiki/File:Cumulonimbus_Clouds.jpg
http://www.free-background-wallpaper.com/imagelarge/1600x1200/132/Vast-Cumulus-Clouds-Wallpaper
http://www.meteonet.org/html/cumulus.html
http://www.meteorologia.it/Fotoatlante/cumulonembi.htm
http://blogs.discovermagazine.com/imageo/2013/07/04/a-happy-independence-day-postcard-from-38000-feet/#.UiBqx364n_U
http://en.paperblog.com/cumulonimbus-incus-february-2013-441607/

Some engines uses some simple fakes to imitate it (such as detecting the edges by relative density and darkening/brightening it according to the camera-sun angle. I believe TG does that way - "fake internal scattering"). Results can be nice, but not realistic.

So I decided to solve the task by myself. From pure interest, just for fun. As hobby, in the free minutes of time I developed my own engine.  And I tried many ideas, most of all was crap, but some are quite good.

Well, it is like I need to work more at the internal scattering. But may be the cloud just isn't designed well? May be it too dense?
Well, how do you like other images with "behind" word in the name?

As for height of clouds, it is up to 1500 meters on the most pictures, 5 km on massive_cumulus pictures and up to 3500 meters on 20km picture.

Matt

Very interesting blinkfrog! You clearly understand the problem.

To my eye, your view from above the clouds is doing a pretty good job, although it's not quite right yet. There are compromises and plenty of edge cases that just don't look right unless we literally brute-force sample every path. Or are you actually doing that?

What sorts of rendering times are you getting?

QuoteWell, it is like I need to work more at the internal scattering. But may be the cloud just isn't designed well? May be it too dense?

It may be the scattering isn't right, or the cloud density isn't realistic, or both. But nature creates clouds with such incredible variety, and there are probably many different density profiles that all look "real". I would expect that we should have some freedom to create many different density models and still make them look realistic if the lighting simulation is good enough. So I think the scattering probably needs improvement. However, your first cloud image might look more convincing if the fractal did not have such sharp valleys. The unrealistic fractal might be distracting us from really being able to judge the realism of the scattering. It looks like it's generally doing the right thing, even if there's still something unnatural about the falloff and it's hard to pinpoint what it is.

I'll be interested to see how this progresses :)

Matt
Just because milk is white doesn't mean that clouds are made of milk.

cyphyr

These are all great. I'd love to know the render times (and your setup for comparison).
I think they could all pass (some more than pass)for realistic.
As Matt says there and so many different types of possible cloud formations, densities, and scatterings that it's hard to say what is not realistic.
How far developed is this project so far, do you have a GUI?
If you need any testing, give me a shout :D
Cheers
Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Daniil

Quote from: Matt on August 30, 2013, 08:50:04 AM
Very interesting blinkfrog! You clearly understand the problem.

Hello Matt, this is a honor for me.

Quote from: Matt on August 30, 2013, 08:50:04 AM
To my eye, your view from above the clouds is doing a pretty good job, although it's not quite right yet. There are compromises and plenty of edge cases that just don't look right unless we literally brute-force sample every path. Or are you actually doing that?
:) Of course there are plenty of fakes. Indeed I started to implement some things by brute forcing it, by tracing the some of the most probable photon paths in the cloud, to understand the overall principle. Next I simplified the paths, also added some volume estimation, and next I eliminated the direct tracing and simplified the estimation to make calculations faster. Now it is pixel-based (I mean, not GI-based, but calculated for every pixel for every tracing step, that is slow) cloud volume estimation.

Quote from: Matt on August 30, 2013, 08:50:04 AM
What sorts of rendering times are you getting?

Well... For the quality of last two images the rendering process is somewhere about 2 hours at the 3.3 GHz i5. Too many, I know. There is a space for optimization, I have some ideas. But I currently prefer work at algorithms, than at optimization. I need to learn many other things as it is. Constantly reinventing the wheels, because I haven't any experience at 3DCG.

As for that scattering phenomenon at wide angles (I call it "curve scattering" because of curve scattering paths idea laid in the core) I can make it GI-based that can greatly speed up things. But it can lead to great detail loss, that is critical for high density clouds. I tryed it before, and it wasn't good, but my old GI-system was very slow and crude (so I usually used it at low resolution) with ugly interpolation. May be with my current reworked GI it would be better. But my GI is still far from TG or Vue in terms of smoothness and speed.

Quote from: Matt on August 30, 2013, 08:50:04 AM
QuoteWell, it is like I need to work more at the internal scattering. But may be the cloud just isn't designed well? May be it too dense?
It may be the scattering isn't right, or the cloud density isn't realistic, or both. But nature creates clouds with such incredible variety, and there are probably many different density profiles that all look "real". I would expect that we should have some freedom to create many different density models and still make them look realistic if the lighting simulation is good enough. So I think the scattering probably needs improvement. However, your first cloud image might look more convincing if the fractal did not have such sharp valleys. The unrealistic fractal might be distracting us from really being able to judge the realism of the scattering. It looks like it's generally doing the right thing, even if there's still something unnatural about the falloff and it's hard to pinpoint what it is.
Yes, of course scattering needs more work. And cloud design too. Currently I get cumulus billows by abs() of perlin noise (shaped for linear distribution), may be it is worth to round the zero mirroring.
As for clouds design, it is my favorite thing, so creative! All this multifractality with some tweaks and height-dependent behaviour changing is like magic. But it isn't so handy currently because of hardcoded functions, so I currently am starting to thinking out my shader system. So many wheels to reinvent. :)

Quote from: Matt on August 30, 2013, 08:50:04 AM
I'll be interested to see how this progresses :)

:) Well, I can't promise fast progress. :) After all, it currently at hobby status, and I working already about 3 years with great breaks (sometimes several months). I thought about commercial project, but it is hard. I need to learn so many things, and even if I invest my time and money to it there is no sense to make such project when at the market such brilliant products as TG or Vue are presented.

But I like that I worked at it. I learned so many interesting things, and also now I am seeing at the sky different to earlier. I can spend many time looking at the clouds, and now I see all the beauty in the nature multiple light scattering. There are no people understanding me. :) They just can't notice nothing special in the light scattering, they can just say "nice shape, it's like rabbit".  ;D


P. S. Also there are some other ideas that I like in my engine. For example, multiple scattering in the sky. While it needs tweaking, it featuring more or less realistic rayleigh multiple scattering, and I got nice solution for sunset time. I mean, just 1st order rayleigh (and mie) scattering is too dark at sunset,  multiple scattering can greatly illuminate sunset sky, but it is more gray than blue. So I implemented atmospheric ozone imitation which influence is very prominent at sunset (when the sun is low or below the horizon) and makes blue colours more juicy. But there is also a problem of HDR to LDR conversion, and my current solution distort the colors.
Here is a picture of sunset, the sun is below the horizon.

Daniil

Quote from: cyphyr on August 30, 2013, 12:33:31 PM
I'd love to know the render times (and your setup for comparison).
How far developed is this project so far, do you have a GUI?
If you need any testing, give me a shout :D
It is very slow, as I said.  :(
The project currently is... Which letter was before the Alpha in Ancient Greek?  ;D
There is no GUI, there is no shaders. It's just pure engine.
My current roadmap may be the next:
1. Modular Shader system.
2. Project scenes in txt files (shaders settings, topology, scene configuration and render options).
3. GUI.
And reworking, retweaking and optimizing various parts of engine inbetween.
But all this can take literally ages, as I need to research many things, haven't many free time, and also have another hobbies that are very time-consuming too.

Tangled-Universe

Well Blinkfrog,

It seems you're applying for a position at Planetside ;)

A fresh look/ideas and extra manpower to bump up development speed couldn't hurt TG ;)

pokoy

Blinkfrog, these are some really cool examples, and I really like the sunset image. It's something I wondered before actually, how are atmospheric rendering apps rendering their atmospheres? Are they using simplified models or really calculating the effects based on scattering through different layers of dust, ozone etc.? Would it be also possible to simulate the bending of light paths based on different IORs of the different media in the atmosphere? So many questions here... :-)

The clouds look mostly good when looked at as thumbnails but look too dense when looked at in original resolution. I'm not able to tell what it is, but it really may be a too much simplified scattering, though I'm not an expert really.

Anyways, great research and I'm looking forward to see more!

Daniil

Quote from: pokoy on September 04, 2013, 03:11:57 PMBlinkfrog, these are some really cool examples, and I really like the sunset image.
Thank you.
QuoteIt's something I wondered before actually, how are atmospheric rendering apps rendering their atmospheres? Are they using simplified models or really calculating the effects based on scattering through different layers of dust, ozone etc.?
There are several ways to do it. You can (theoretically) to construct perfect model and to trace every foton and to collect every scattering events, or even calculate physics at sub-atom-level. But there are no computers that are possible to calculate it. So you need to simplify model and to find a balance between realistic, but slow calculated physics and simplifyed physics or even fast fakes to obtain good picture and good performance.

So it is need to analyze the things. Some aspects, such as first order scattering, can be computed relatively precisely while being not very CPU hungry.

And you can do it with simplified physics: you can trace photon path from your camera by steps and estimate the inscattering events based on the local air density and the length of the step. You can calculate then the inscattered light based on that, the sun-camera angle and wavelenght-dependent coefficients (so you get the color sky). Similar for outscattering.  Oh, yes, you need to trace to the sun to calculate the light before it will be inscattered.

Some things, such as second (and higher order) scattering are very CPU-consuming, but you can notice that it's effect is quite blurred in space so you don't need to calculate it for every pixel and every tracing step. You can do it, for example, at GI-stage. You can use more crude integration at lower resolution.

Some things can be computed using estimation and statistics. And some can be faked. You can use very crude, but fast fakes, for example, not calculate the sky scattering perfectly, but to draw blue-gray gradient and to reddish it at sunset. This is very good way for real-time graphics such as computer games.

My initial goal was to refrain to crude fakes, and I still trying.

By the way, I still not implemented the dust. There in my model currently are air molecules, water aerosols and small drops (haze), bigger drops (clouds) and ozone (blue sky enhancement based on Chappuis band).

Quote
Would it be also possible to simulate the bending of light paths based on different IORs of the different media in the atmosphere? So many questions here... :-)
Yes, it is possible, and isn't very hard to simulate, but calculations would be slower. I thought about implementing it, because it would enhance sunset images (and good sunsets is my second goal).

Quote
The clouds look mostly good when looked at as thumbnails but look too dense when looked at in original resolution. I'm not able to tell what it is, but it really may be a too much simplified scattering, though I'm not an expert really.
Well, currently I am not pretending to photorealistic images. :) Of course it is need to improve the scattering and also clouds models. Working at it.

cyphyr

Regarding IOR I'd be very interested in methods to simulate light scattering on "other" worlds.
Some where with a methane or phosphorus rich atmosphere for example. You can sort of guess at in TG (a greenish or pink hue maybe) but it is a wild guess and probably wide of the mark.

Cheers
Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Daniil

Little reworking of some parts of algorithm.
I tryed to capture more character of light scattering from the photo http://www.flickr.com/photos/marotta47/288230372/ .
Comparing to my first image, the scattering on the photo is much smoother, while more contrast.
The cloud design is the same as before for easier comparing. The "valleys" now look not so sharp because of smoother light distribution. But of course the cloud design is need reworking. The billows have to be less flat, and it is better to eliminate overal "patterning" caused by perlin noise. May be it is worth to use some sort of fractal cellular noise? Although it would be much slower.

Oshyan

I think you're getting some nice results, but your reference picture is actually noticeably post-processed. Is it intentional that you use that? I would suggest using reference images that are as neutral (unprocessed) as possible, and with known exposure info as well (since exposure can have such a dramatic effect on the results, particularly with very bright and high contrast things like clouds/sky). Your basic shading concepts seem good though.

What I've come to realize, and it seems you have found as well, is that for getting good clouds, it's not so much a matter of being unable to get highly realistic results at all, but rather *getting realistic results in reasonable render time*. :D I have seen some pretty incredible shading experiments for clouds that produce very photograph results in certain situations, but the render times tend to be higher as a result. Finding the tricks and "shortcuts" to get very realistic results at good speed is still the biggest challenge...

- Oshyan

jaf

Quote from: Tangled-Universe on August 31, 2013, 03:50:02 AM
Well Blinkfrog,

It seems you're applying for a position at Planetside ;)

A fresh look/ideas and extra manpower to bump up development speed couldn't hurt TG ;)

Ah, could there be a future plugin for Terragen!
(04Dec20) Ryzen 1800x, 970 EVO 1TB M.2 SSD, Corsair Vengeance 64GB DDR4 3200 Mem,  EVGA GeForce GTX 1080 Ti FTW3 Graphics 457.51 (04Dec20), Win 10 Pro x64, Terragen Pro 4.5.43 Frontier, BenchMark 0:10:02