Merged revision(s) 57828-57907 from trunk/blender into soc-2013-dingto
[blender.git] / intern / cycles / render / shader.cpp
index 76b5b2baaa62b2dcb932de6d4113f5fe95738d86..72a0645c779eea96d0a67775123e4bf3d8b29dfe 100644 (file)
@@ -16,6 +16,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
+#include "background.h"
 #include "bssrdf.h"
 #include "blackbody.h"
 #include "device.h"
@@ -194,10 +195,10 @@ void ShaderManager::device_update_shaders_used(Scene *scene)
        foreach(Shader *shader, scene->shaders)
                shader->used = false;
 
+       scene->shaders[scene->background->shader]->used = true;
        scene->shaders[scene->default_surface]->used = true;
        scene->shaders[scene->default_light]->used = true;
        scene->shaders[scene->default_background]->used = true;
-       scene->shaders[scene->default_holdout]->used = true;
        scene->shaders[scene->default_empty]->used = true;
 
        foreach(Mesh *mesh, scene->meshes)
@@ -353,22 +354,6 @@ void ShaderManager::add_default(Scene *scene)
                scene->default_background = scene->shaders.size() - 1;
        }
 
-       /* default holdout */
-       {
-               graph = new ShaderGraph();
-
-               closure = graph->add(new HoldoutNode());
-               out = graph->output();
-
-               graph->connect(closure->output("Holdout"), out->input("Surface"));
-
-               shader = new Shader();
-               shader->name = "default_holdout";
-               shader->graph = graph;
-               scene->shaders.push_back(shader);
-               scene->default_holdout = scene->shaders.size() - 1;
-       }
-
        /* default empty */
        {
                graph = new ShaderGraph();