-
Notifications
You must be signed in to change notification settings - Fork 324
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
luboslenco
merged 17 commits into
armory3d:blender2.9
from
MoritzBrueckner:2.9-NishitaSky
Apr 3, 2021
Merged
[Blender 2.9] Nishita sky model & (ir)radiance support for all world shaders #2149
luboslenco
merged 17 commits into
armory3d:blender2.9
from
MoritzBrueckner:2.9-NishitaSky
Apr 3, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The scale was changed in recent Blender builds
See write_sky_irradiance() for reference
MoritzBrueckner
added
the
Blender 2.93 LTS
Issues and PRs linked to Blender 2.93 LTS support
label
Apr 2, 2021
Wow! |
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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):
(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.