Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Stockner <lukas.stockner@freenet.de>2020-07-13 02:49:25 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2020-07-13 04:08:11 +0300
commit41e6f9bd437cb5f23dd6a8ad41c6142b0520f65d (patch)
tree6bdc12625e7ed2f47d3ac93fa3362a514abc8d8a /source/blender/blenloader
parente2736afdbefde486bc051627dbedeaa28cdb972e (diff)
Cycles: Add control for sun intensity in Sky Texture and change altitude to km
Differential Revision: https://developer.blender.org/D8091
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_290.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index e608a90aab0..ba92e11cc2a 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -389,5 +389,21 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
*/
{
/* Keep this block, even when empty. */
+
+ /* Initialize additional parameter of the Nishita sky model and change altitude unit. */
+ if (!DNA_struct_elem_find(fd->filesdna, "NodeTexSky", "float", "sun_intensity")) {
+ FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
+ if (ntree->type == NTREE_SHADER) {
+ LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
+ if (node->type == SH_NODE_TEX_SKY && node->storage) {
+ NodeTexSky *tex = (NodeTexSky *)node->storage;
+ tex->sun_intensity = 1.0f;
+ tex->altitude *= 0.001f;
+ }
+ }
+ }
+ }
+ FOREACH_NODETREE_END;
+ }
}
}