Another Sky Texture

This is still in designing stage

Design

We are still investigating ways to implement a new Multiple Scattering based sky texture in Blender.

28 Likes

The only measurable part of the sky atmosphere that absorbs light is due to the Ozone layer, and it is already being calculated in the actual Nishita single scattering sky model.

but [Nishita] was never meant to be final as it is based on Single Scattering and so doesn’t take into account the Multiple Scattering that light in real life presents, this is why I would like to implement another (and hopefully final) Sky Texture.

Hi Nacioss,

I know this is early stage, but what would be the advantages of having a Multiple Scattering model versus Single Scattering ?

Is it more “real” or have better lighting/color ?

Thx for your work btw, this is such an awesome contribution to Blender.

Nature is surely multiple scattering as light bounces an infinite number of times between surfaces and particles, so since single scattering means 1 bounce then that is a huge approximation of the real world, on the other hand multiple scattering means 2 and above number of bounces and that would lead to closer and closer results to real life. The only problem is that multiple bounces cost performance.

2 Likes

Any chance for a complementary haze/fog output for a volumetric scatter node?

1 Like

Not sure what you mean by that, this is meant to be a texture (a 2D procedural image).

Hm,if you remember,i had ask you the same question ,like Atair,to your first sky texture before.And i was hopeing,that with the new Sky Texture project,you work on a “real” multiscatter shader,that works with mie haze/fog and a rayleigh scatter.Beside a optical improvement to your “old” Sky tex (which would be nice though),i dont see a need for this.

Like sayed,i guess many artist would see a volumetric atmospheric shader,To get the real depth in the renderscene.Even unreal as a game engine has a sky model implemented.

The thing is,even if you are make the new sky texture,then the artist have to fiddle with mist passes and volumetric scatter boxes to simulating a fog/sky with its scattering to get the depth.

1 Like

So you mean a shader, a Volume Scatter shader is already available in Cycles and it makes use of the Henyey Greenstein phase function (the same as the Mie Scattering phase function), so just use it with a high Volume light bounces number. Rayleigh is a bit different and has a different phase function, that could be implemented as a separate Volume Scatter but it’s beyond the scope of this thread and I haven’t the skills and passion right now to implement something like that.

Yes,there are many small codes to calculating this in the net,i is not very different to your texture code,but is implemeted as a scatter shader.Its sad to hear that its not a scatter shader you are working on.
However good luck to your new project.

Here my volumetric sky test i made yesterday.It is a 8k8k8k blender unit box,with a 8000m falloff rayleigh scattercoef.and 1200m mie scatter haze/fog falloff.Lit by one sun light.
This kind of shader with the correct rayleigh calculation,done.

2 Likes

Good work, the general problem though is that your bounces are taking into account light that is made of RGB primaries and not wavelengths (the actual Nishita Sky Texture makes use of 21 wavelengths of the spectrum), and if the concept of this new sky works then we could potentially sample whatever wavelength is requested by the sampler (with the upcoming spectral branch this is going to be integrated well). Difference between RGB and Spectrum for particles composed medium makes a lot of difference.

1 Like

Thanks,yes its how the scatter shader works now.For this reason we need a rayleigh scatter shader.

Sure with/for the spectral branch it makes sence to improve the sky texture.

edit,I tyred to combine the sky texture with a volumetric mie/fog scatter.For this render i used only the sky tex as light source and set the dust to 0,and left air and ozone at 1.
Then i added volumetric scatter shader, from the render i posted before,for a fog scatter in a 8k blender unit cube with a falloff height of 1.2km.one wind turbine has a height of 120m,like a real one.

2 Likes

any chance you can share the shader setup?
I mostly throw absorption/scatter nodes together till it looks halfway correct… would be nice to see a ‘proper’ setup.

Here the fog scatter material.Important is,that you have to set the location of the box for the scatter material, at z world height of 0.Otherwise the material z position height is wrong.And all scaleings should be applyed too ofc.

5 Likes

May someone with raytracing skills point me on the right way here?

https://github.com/marcopavanello/sky-generator/tree/multiple-scattering
This is still not working but I would like to understand if the multiple scattering algorithm is correct.

4 Likes

Could you consider adding control of the height of the horizon? Because sometimes when using sky texture the horizon might not match the ground and that looks strange, I used to have a mapping node connected to the vector to fix it, but Nishita had a patch to remove the vector input when sun disk is on so it is not an option anymore. Would it be hard to have a horizon control on this new sky?

Here is an example of the problem:

The short answer is no. That’s because of how the sun sampling works internally, the sun needs to be in known location, and to do soo only the elevation and rotation of the sun can give that specific position in the sky.

So how should I fix this problem then? Because of this problem, shooting from a higher angle is kind of not ideal, and I can only shoot from very low on the floor to prevent this. This really is a problem.

by either not having a perfectly flat plane stretching to infinity or having a apparently but not actually flat plane stretching to infinity.

Here I subdivided a plane with two edge cuts in each direction, made the outer edge rotate upwards by 0.5°, beveled a the inner edges to smooth it out, scaled it up by a factor of 1000, and manually set the normal to point straight up as if it was a perfectly flat plane.

(I had to also increase the draw distance to 1000 to make this work)

That said, I’d also recommend you look into the various blender splash screen scenes. In particular the ones of Blender 2.91 and 2.92 - both have some neat advanced tricks to deal with far distance background detail Demo Files — blender.org

4 Likes

I would like to pay a developer (with volume scattering skills) to implement this new Sky Texture.

4 Likes

Thanks to the amazing @lukasstockner97 we have an initial beginning of something :slight_smile: .
https://github.com/marcopavanello/blender/tree/new-sky
Here is the code. As of now the implementation is just a starting point and any help is accepted to further improve it.
So it’s brute force ray tracing multiple scattering, and as such the results are noisy and slow. Doing some tests as of now the precomputation of the sky image requires at least 1:10 minutes for a 512*128 pixels resolution with 5 bounces and 256 samples (these are the internal variables that could be changed in the future to get the best performance/noise balance).
Any idea to denoise the final precomputed image is welcome, using cubic interpolation seems to help somehow, but it’s far from perfect denoising.

Left: Single Scattering, Right: Multiple Scattering

11 Likes