diff options
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r-- | source/blender/editors/render/render_preview.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 2e3091268a9..c76a6aa175a 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -455,9 +455,18 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty } else { /* use current scene world to light sphere */ - if (mat->pr_type == MA_SPHERE_A) { + if (mat->pr_type == MA_SPHERE_A && sp->pr_method == PR_BUTS_RENDER) { + /* Use current scene world to light sphere. */ sce->world = preview_get_localized_world(sp, scene->world); } + else if (sce->world) { + /* Use a default world color. Using the current + * scene world can be slow if it has big textures. */ + sce->world->use_nodes = false; + sce->world->horr = 0.5f; + sce->world->horg = 0.5f; + sce->world->horb = 0.5f; + } } if (sp->pr_method == PR_ICON_RENDER) { @@ -466,10 +475,6 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty } else { set_preview_layer(view_layer, MA_SPHERE_A); - - /* same as above, use current scene world to light sphere */ - if (BKE_scene_use_new_shading_nodes(scene)) - sce->world = preview_get_localized_world(sp, scene->world); } } else { @@ -569,6 +574,14 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty } else { set_preview_layer(view_layer, MA_LAMP); + + if (sce->world) { + /* Only use lighting from the lamp. */ + sce->world->use_nodes = false; + sce->world->horr = 0.0f; + sce->world->horg = 0.0f; + sce->world->horb = 0.0f; + } } for (Base *base = view_layer->object_bases.first; base; base = base->next) { |