Fix T57689: world nodes / texture not updating for Eevee.

Only do GPU material updates through depsgraph evaluation now. This was
already happening for material, just missing for the world.
This commit is contained in:
2018-11-08 15:56:56 +01:00
parent d4370e2e00
commit 11a53ec28a
7 changed files with 32 additions and 44 deletions

View File

@@ -975,17 +975,20 @@ void DepsgraphNodeBuilder::build_world(World *world)
if (built_map_.checkIsBuiltAndTag(world)) {
return;
}
/* Animation. */
build_animdata(&world->id);
/* world itself */
/* World itself. */
add_id_node(&world->id);
World *world_cow = get_cow_datablock(world);
/* Shading update. */
add_operation_node(&world->id,
DEG_NODE_TYPE_SHADING,
NULL,
function_bind(BKE_world_eval,
_1,
world_cow),
DEG_OPCODE_WORLD_UPDATE);
/* world's nodetree */
if (world->nodetree != NULL) {
build_nodetree(world->nodetree);
}
/* Animation. */
build_animdata(&world->id);
/* World's nodetree. */
build_nodetree(world->nodetree);
}
/* Rigidbody Simulation - Scene Level */

View File

@@ -1510,14 +1510,18 @@ void DepsgraphRelationBuilder::build_world(World *world)
if (built_map_.checkIsBuiltAndTag(world)) {
return;
}
/* animation */
build_animdata(&world->id);
/* TODO: other settings? */
/* world's nodetree */
if (world->nodetree != NULL) {
build_nodetree(world->nodetree);
ComponentKey ntree_key(&world->nodetree->id, DEG_NODE_TYPE_SHADING);
ComponentKey world_key(&world->id, DEG_NODE_TYPE_SHADING);
add_relation(ntree_key, world_key, "NTree->World Shading Update");
OperationKey ntree_key(&world->nodetree->id,
DEG_NODE_TYPE_SHADING,
DEG_OPCODE_MATERIAL_UPDATE);
OperationKey world_key(&world->id,
DEG_NODE_TYPE_SHADING,
DEG_OPCODE_MATERIAL_UPDATE);
add_relation(ntree_key, world_key, "World's NTree");
build_nested_nodetree(&world->id, world->nodetree);
}
}

View File

@@ -270,7 +270,9 @@ void flush_editors_id_update(Main *bmain,
* TODO: image datablocks do not use COW, so might not be detected
* correctly. */
if (deg_copy_on_write_is_expanded(id_cow)) {
deg_editors_id_update(update_ctx, id_orig);
if (graph->is_active) {
deg_editors_id_update(update_ctx, id_orig);
}
/* ID may need to get its auto-override operations refreshed. */
if (ID_IS_STATIC_OVERRIDE_AUTO(id_orig)) {
id_orig->tag |= LIB_TAG_OVERRIDESTATIC_AUTOREFRESH;