Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blender 2.9] Nishita sky model & (ir)radiance support for all world shaders #2149

Merged
merged 17 commits into from
Apr 3, 2021

Conversation

MoritzBrueckner
Copy link
Collaborator

Part of #2082.

This PR adds an implementation of the Nishita sky model which was introduced in Blender 2.9. It was ported from https://github.com/wwwtyro/glsl-atmosphere which is licensed under the Unlicense.

nishita_cycle_small

  • To make it work fast, I moved the computation of the inner integral to a precalculated 2D LUT texture that only needs to be recalculated if the density parameters change. In the future we could improve things further by (optionally) rendering the sky to a lower resolution texture first, but that's not part of this PR. The LUT also makes it possible to store presets for different atmospheres.

  • Also, I added support for all the node settings such as air, dust and ozone density and a sun disk with limb darkening.

  • For clouds, there is now an option to (artificially) darken them based on the sun direction, this should probably be replaced in the future with a more physically accurate representation (but before the clouds would just remain bright):

    nishita_cycle_clouds_small
    (The artifacts in the clouds are caused by the gif compression)

  • In addition to the new sky model, worlds are now rendered in the background to (ir)radiance maps when no other node already set those maps (environment texture node for example). This takes about ~1s per world on my quite old mid-level machine from 2015, even with very complex node setups because worlds only need one sample. Actually I wanted to implement world caching in this PR, but it turns out to be more complicated than I thought so I will postpone it to a future PR.

  • There is also a new API for setting texture parameters in shaders.py based on Allow to set texture parameters for external texture links iron#118.

@MoritzBrueckner MoritzBrueckner added the Blender 2.93 LTS Issues and PRs linked to Blender 2.93 LTS support label Apr 2, 2021
@luboslenco luboslenco merged commit c9182cc into armory3d:blender2.9 Apr 3, 2021
@luboslenco
Copy link
Member

Wow!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blender 2.93 LTS Issues and PRs linked to Blender 2.93 LTS support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants