Planetside Software Forums

General => Open Discussion => Topic started by: Daniil on August 30, 2013, 01:10:19 AM

Title: What do you think about the light scattering in these clouds?
Post by: Daniil on August 30, 2013, 01:10:19 AM
What do you think about the light scattering in these clouds? Especially in the cases when the sun is behind the camera?
Title: Re: What do you think about the light scattering in these clouds?
Post by: Dune on August 30, 2013, 04:44:17 AM
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?
Title: Re: What do you think about the light scattering in these clouds?
Post by: TheBadger on August 30, 2013, 04:53:12 AM
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.
Title: Re: What do you think about the light scattering in these clouds?
Post by: Daniil on August 30, 2013, 06:56:23 AM
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.
Title: Re: What do you think about the light scattering in these clouds?
Post by: Matt on August 30, 2013, 08:50:04 AM
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
Title: Re: What do you think about the light scattering in these clouds?
Post by: cyphyr on August 30, 2013, 12:33:31 PM
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
Title: Re: What do you think about the light scattering in these clouds?
Post by: Daniil on August 30, 2013, 04:33:52 PM
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.
Title: Re: What do you think about the light scattering in these clouds?
Post by: Daniil on August 30, 2013, 04:46:07 PM
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.
Title: Re: What do you think about the light scattering in these clouds?
Post by: 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 ;)
Title: Re: What do you think about the light scattering in these clouds?
Post by: pokoy on September 04, 2013, 03:11:57 PM
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!
Title: Re: What do you think about the light scattering in these clouds?
Post by: Daniil on September 05, 2013, 06:59:30 AM
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.
Title: Re: What do you think about the light scattering in these clouds?
Post by: cyphyr on September 05, 2013, 12:13:25 PM
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
Title: Re: What do you think about the light scattering in these clouds?
Post by: Daniil on September 06, 2013, 01:20:54 AM
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.
Title: Re: What do you think about the light scattering in these clouds?
Post by: Oshyan on September 06, 2013, 04:26:23 PM
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
Title: Re: What do you think about the light scattering in these clouds?
Post by: jaf on September 06, 2013, 04:57:55 PM
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!
Title: Re: What do you think about the light scattering in these clouds?
Post by: Daniil on September 07, 2013, 06:42:18 AM
Quote from: Oshyan on September 06, 2013, 04:26:23 PM
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.
Thank you Oshyan. Yes, it seems incorrect to use just one photo for reference. I have seen some nice giant and dense clouds with low sun placed oppositely like in these photos several times in real life, but unfortunately I haven't had a camera with myself at these occasions.

And of course you are right speaking about the need of small rendering times. I'll try to move all calculations except for the first order scattering into GI stage. And although I'll lose quite resolution, on the other hand I'll be able to implement more advanced scattering that was unable to calculate at pixel-based rendering so may be the result will be more realistic. And of course other optimizations are needed too.
Title: Re: What do you think about the light scattering in these clouds?
Post by: Daniil on September 24, 2013, 09:22:37 AM
Transferred all multiple scattering into GI-stage, improved scattering and also some optimizations done.
The sun is located behind the camera at the right side. ac3 - 34 minutes of rendering time, ac4 - 30 minutes.
ac4 - the same as ac3, but camera pitch angle is much less, so it is easy to see that GI-based scattering works bad at the distance due to low resolution and GI blurring. Also there are some need-to-fix bugs in air shadowing by clouds resulting in fake shadows at the lower side of clouds layer. This is due to some optimizations. :)

I'll try to implement "hybrid" algorithm to improve distant clouds view, performing the part of calculations at pixel-based rendering stage.
Title: Re: What do you think about the light scattering in these clouds?
Post by: PabloMack on September 24, 2013, 04:22:20 PM
Quote from: blinkfrog on August 30, 2013, 06:56:23 AM
Well, this isn't Terragen, it is my own engine, so I think "Image Sharing" isn't appropriate.

If you don't mind me asking, are you writing code in an HLL like C++ using OpenGL?
Title: Re: What do you think about the light scattering in these clouds?
Post by: Oshyan on September 24, 2013, 05:37:37 PM
Some interesting stuff here, a few steps forward, a step or two back perhaps. ;) But great to see you continue to experiment with this stuff.

- Oshyan
Title: Re: What do you think about the light scattering in these clouds?
Post by: Daniil on September 25, 2013, 01:35:33 AM
Quote from: PabloMack on September 24, 2013, 04:22:20 PM
If you don't mind me asking, are you writing code in an HLL like C++ using OpenGL?
Yes, it's C++ and OpenGL, how you surmised? But OpenGL used here by accident, as I haven't quick and small template with graphics, so I used my previous experimental project as the base. OpenGL is using here just for plotting graphics to screen. I'll rework it when will starting to sculpt GUI.

Quote from: Oshyan on September 24, 2013, 05:37:37 PM
Some interesting stuff here, a few steps forward, a step or two back perhaps. ;) But great to see you continue to experiment with this stuff.
Yes, I'll try to rewalk the "steps back" again before I'll go further :)
Title: Re: What do you think about the light scattering in these clouds?
Post by: Hannes on September 25, 2013, 10:26:20 AM
Very interesting! I like the second one of your first set of images most. First I thought it's a reference image.
The latter one looks kind of cool, but reminds me of molten styrofoam. As Oshyan said, it's maybe not the ideal reference image.
Anyway I'm looking forward to your progress!
Title: Re: What do you think about the light scattering in these clouds?
Post by: Daniil on October 01, 2013, 09:19:17 AM
Quote from: Hannes on September 25, 2013, 10:26:20 AM
Very interesting! I like the second one of your first set of images most. First I thought it's a reference image.
The latter one looks kind of cool, but reminds me of molten styrofoam. As Oshyan said, it's maybe not the ideal reference image.
Anyway I'm looking forward to your progress!
Thank you. Although the 20km view can't show the features of my engine because the sun is located in front of camera, and the first order scattering in the clouds is most prominent. I think the most renderers can render the clouds in this case similar to my picture.

The higher camera-sun angles are the cases when my engine starts to show its special features. Various renderers do various approaches to render these cases and so mine.

For example, in this case you can see various orders of scattering together.
I made two versions of image, one is colored with various colors for various scattering orders: red is first order scattering, green is second and blue are third+ orders of scattering. Also some gray-blue comes from skylight.

Edit: BTW I fixed the air shadowing bugs. And also rendering time of that was 17 minutes.
Title: Re: What do you think about the light scattering in these clouds?
Post by: Hannes on October 01, 2013, 04:14:28 PM
Wow, this looks incredibly good!
Title: Re: What do you think about the light scattering in these clouds?
Post by: AP on October 01, 2013, 10:06:29 PM
The lighting and scattering is very nice. I like what you are doing. It would be great to see this coded into Terragen.
Title: Re: What do you think about the light scattering in these clouds?
Post by: AP on October 04, 2015, 07:02:42 PM
I know you are busy with the erosion plugin but might there be any more work on this because i still think certain aspects of the clouds are very nice and still shows much potential.
Title: Re: What do you think about the light scattering in these clouds?
Post by: Daniil on October 05, 2015, 04:03:17 AM
I plan to return to my clouds shading experiments in the future (very likely in a form of plugin for Terragen).
Title: Re: What do you think about the light scattering in these clouds?
Post by: Dune on October 05, 2015, 04:42:43 AM
 :)
Title: Re: What do you think about the light scattering in these clouds?
Post by: AP on October 05, 2015, 05:23:50 AM
That is just great to hear. I still admire the internal light scattering of the lighting and certain fractal aspects of the clouds look rather interesting as well.
Title: Re: What do you think about the light scattering in these clouds?
Post by: Hannes on October 05, 2015, 05:35:10 AM
Ah, I almost forgot that! Yes, please return to your clouds!!!! They look so great!
Title: Re: What do you think about the light scattering in these clouds?
Post by: Tangled-Universe on October 05, 2015, 07:16:02 AM
Definitely a big +1.

I think Matt would be interested to see your approach on light scattering :)
Title: Re: What do you think about the light scattering in these clouds?
Post by: Kadri on October 05, 2015, 12:50:30 PM

We will need a "third party tools" section in the forum soon as it looks.Nice :)
Title: Re: What do you think about the light scattering in these clouds?
Post by: Oshyan on October 05, 2015, 03:24:36 PM
Quote from: Kadri on October 05, 2015, 12:50:30 PM

We will need a "third party tools" section in the forum soon as it looks.Nice :)

Yes Kadri, that's the hope! Daniil has been the big pioneer with the SDK so far, but we're working on getting others going as well. Once we have had a chance to shake out the bugs and finalize the SDK we'll be making it more widely available and then the Plugin Development section will return! Hopefully it will be vibrant and full of interesting plugins. :)

- Oshyan
Title: Re: What do you think about the light scattering in these clouds?
Post by: Kadri on October 05, 2015, 03:36:05 PM

Oshyan as always it is probably hard to say when the SDK will be ready,
but could you say just roughly as percentage how much it is done? Curious :)
Title: Re: What do you think about the light scattering in these clouds?
Post by: Oshyan on October 05, 2015, 04:00:50 PM
Hmm... Well, keeping in mind the 90/90 rule (https://en.wikipedia.org/wiki/Ninety-ninety_rule) (90% of the coding takes 90% of the time, the remaining 10% takes the other 90% of the time :D), I believe it's fair to say it's 90% done. But the time to complete and tidy up the remaining 10% is the question, of course. Unfortunately that I can't answer, but it really is just about "feature complete" at this point, and the number of bugs is so far small. We will probably see more things to fix up once it reaches a wider audience.

- Oshyan
Title: Re: What do you think about the light scattering in these clouds?
Post by: Kadri on October 05, 2015, 04:06:56 PM

That is enough for me thanks :)
Title: Re: What do you think about the light scattering in these clouds?
Post by: TheBadger on October 05, 2015, 04:22:45 PM
sounds great!
Title: Re: What do you think about the light scattering in these clouds?
Post by: pokoy on October 05, 2015, 04:26:05 PM
Very excited to see this. An improved cloud and light scattering model would be by far #1 on my list of things I'd love to see. The examples posted here are beautiful so good to hear the SDK is almost there. Good news!!