[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40973] branches/cycles: Cycles: revert commit that joined surface/ volume socket into a single shader socket,

Brecht Van Lommel brechtvanlommel at pandora.be
Thu Oct 13 01:03:13 CEST 2011


Revision: 40973
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40973
Author:   blendix
Date:     2011-10-12 23:03:12 +0000 (Wed, 12 Oct 2011)
Log Message:
-----------
Cycles: revert commit that joined surface/volume socket into a single shader socket,
on second thought this makes it a bit too difficult to understand what's going on.

Modified Paths:
--------------
    branches/cycles/intern/cycles/blender/addon/ui.py
    branches/cycles/intern/cycles/blender/blender_shader.cpp
    branches/cycles/intern/cycles/kernel/kernel_shader.h
    branches/cycles/intern/cycles/kernel/osl/nodes/CMakeLists.txt
    branches/cycles/intern/cycles/kernel/osl/osl_shader.cpp
    branches/cycles/intern/cycles/kernel/svm/svm.h
    branches/cycles/intern/cycles/kernel/svm/svm_types.h
    branches/cycles/intern/cycles/render/nodes.cpp
    branches/cycles/intern/cycles/render/osl.cpp
    branches/cycles/intern/cycles/render/shader.cpp
    branches/cycles/intern/cycles/render/shader.h
    branches/cycles/intern/cycles/render/svm.cpp
    branches/cycles/intern/cycles/test/models/elephants.xml
    branches/cycles/intern/cycles/test/test_camera/camera_post.xml
    branches/cycles/intern/cycles/test/test_closure/background.xml
    branches/cycles/intern/cycles/test/test_closure/bsdf_add.xml
    branches/cycles/intern/cycles/test/test_closure/bsdf_diffuse.xml
    branches/cycles/intern/cycles/test/test_closure/bsdf_glass.xml
    branches/cycles/intern/cycles/test/test_closure/bsdf_glossy.xml
    branches/cycles/intern/cycles/test/test_closure/bsdf_mix.xml
    branches/cycles/intern/cycles/test/test_closure/bsdf_reflection.xml
    branches/cycles/intern/cycles/test/test_closure/bsdf_refraction.xml
    branches/cycles/intern/cycles/test/test_closure/bsdf_transparent.xml
    branches/cycles/intern/cycles/test/test_closure/bsdf_velvet.xml
    branches/cycles/intern/cycles/test/test_closure/closure_post.xml
    branches/cycles/intern/cycles/test/test_closure/emission.xml
    branches/cycles/intern/cycles/test/test_closure/emission_total.xml
    branches/cycles/intern/cycles/test/test_displace/displace_both.xml
    branches/cycles/intern/cycles/test/test_displace/displace_bump.xml
    branches/cycles/intern/cycles/test/test_displace/displace_bump_attr.xml
    branches/cycles/intern/cycles/test/test_displace/displace_pre.xml
    branches/cycles/intern/cycles/test/test_displace/displace_true.xml
    branches/cycles/intern/cycles/test/test_geom/geom_camera.xml
    branches/cycles/intern/cycles/test/test_geom/geom_generated.xml
    branches/cycles/intern/cycles/test/test_geom/geom_incoming.xml
    branches/cycles/intern/cycles/test/test_geom/geom_normal.xml
    branches/cycles/intern/cycles/test/test_geom/geom_object.xml
    branches/cycles/intern/cycles/test/test_geom/geom_position.xml
    branches/cycles/intern/cycles/test/test_geom/geom_post.xml
    branches/cycles/intern/cycles/test/test_geom/geom_tangent.xml
    branches/cycles/intern/cycles/test/test_geom/geom_true_normal.xml
    branches/cycles/intern/cycles/test/test_geom/geom_uv.xml
    branches/cycles/intern/cycles/test/test_geom/geom_window.xml
    branches/cycles/intern/cycles/test/test_light/light_point.xml
    branches/cycles/intern/cycles/test/test_light/light_post.xml
    branches/cycles/intern/cycles/test/test_light/light_pre.xml
    branches/cycles/intern/cycles/test/test_mesh/mesh_attribute.xml
    branches/cycles/intern/cycles/test/test_mesh/mesh_attribute_convert.xml
    branches/cycles/intern/cycles/test/test_node/node_cycle.xml
    branches/cycles/intern/cycles/test/test_node/node_math.xml
    branches/cycles/intern/cycles/test/test_node/node_mix.xml
    branches/cycles/intern/cycles/test/test_node/node_post.xml
    branches/cycles/intern/cycles/test/test_node/node_vector_math.xml
    branches/cycles/intern/cycles/test/test_subd/subd_one.xml
    branches/cycles/intern/cycles/test/test_texture/tex_blend.xml
    branches/cycles/intern/cycles/test/test_texture/tex_clouds.xml
    branches/cycles/intern/cycles/test/test_texture/tex_distorted_noise.xml
    branches/cycles/intern/cycles/test/test_texture/tex_environment.xml
    branches/cycles/intern/cycles/test/test_texture/tex_image.xml
    branches/cycles/intern/cycles/test/test_texture/tex_magic.xml
    branches/cycles/intern/cycles/test/test_texture/tex_marble.xml
    branches/cycles/intern/cycles/test/test_texture/tex_musgrave.xml
    branches/cycles/intern/cycles/test/test_texture/tex_noise.xml
    branches/cycles/intern/cycles/test/test_texture/tex_post.xml
    branches/cycles/intern/cycles/test/test_texture/tex_sky.xml
    branches/cycles/intern/cycles/test/test_texture/tex_stucci.xml
    branches/cycles/intern/cycles/test/test_texture/tex_voronoi.xml
    branches/cycles/intern/cycles/test/test_texture/tex_wood.xml
    branches/cycles/source/blender/blenloader/intern/readfile.c
    branches/cycles/source/blender/gpu/intern/gpu_shader_material.glsl
    branches/cycles/source/blender/gpu/intern/gpu_shader_material.glsl.c
    branches/cycles/source/blender/nodes/shader/nodes/node_shader_output_lamp.c
    branches/cycles/source/blender/nodes/shader/nodes/node_shader_output_material.c
    branches/cycles/source/blender/nodes/shader/nodes/node_shader_output_world.c

Added Paths:
-----------
    branches/cycles/intern/cycles/kernel/osl/nodes/node_output_surface.osl
    branches/cycles/intern/cycles/kernel/osl/nodes/node_output_volume.osl

Removed Paths:
-------------
    branches/cycles/intern/cycles/kernel/osl/nodes/node_output_closure.osl

Modified: branches/cycles/intern/cycles/blender/addon/ui.py
===================================================================
--- branches/cycles/intern/cycles/blender/addon/ui.py	2011-10-12 22:46:51 UTC (rev 40972)
+++ branches/cycles/intern/cycles/blender/addon/ui.py	2011-10-12 23:03:12 UTC (rev 40973)
@@ -228,7 +228,7 @@
         sub.prop(ccam, "aperture_rotation", text="Rotation")
 
 class Cycles_PT_context_material(CyclesButtonsPanel, Panel):
-    bl_label = ""
+    bl_label = "Surface"
     bl_context = "material"
     bl_options = {'HIDE_HEADER'}
 
@@ -400,8 +400,8 @@
         elif lamp.type == 'HEMI':
             layout.label(text="Not supported, interpreted as sun lamp.")
    
-class CyclesLamp_PT_shader(CyclesButtonsPanel, Panel):
-    bl_label = "Shader"
+class CyclesLamp_PT_nodes(CyclesButtonsPanel, Panel):
+    bl_label = "Nodes"
     bl_context = "data"
 
     @classmethod
@@ -412,10 +412,10 @@
         layout = self.layout
 
         mat = context.lamp
-        panel_node_draw(layout, mat, 'OUTPUT_LAMP', 'Shader')
+        panel_node_draw(layout, mat, 'OUTPUT_LAMP', 'Surface')
 
-class CyclesWorld_PT_shader(CyclesButtonsPanel, Panel):
-    bl_label = "Shader"
+class CyclesWorld_PT_surface(CyclesButtonsPanel, Panel):
+    bl_label = "Surface"
     bl_context = "world"
 
     @classmethod
@@ -426,10 +426,25 @@
         layout = self.layout
 
         mat = context.world
-        panel_node_draw(layout, mat, 'OUTPUT_WORLD', 'Shader')
+        panel_node_draw(layout, mat, 'OUTPUT_WORLD', 'Surface')
 
-class CyclesMaterial_PT_shader(CyclesButtonsPanel, Panel):
-    bl_label = "Shader"
+class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel):
+    bl_label = "Volume"
+    bl_context = "world"
+
+    @classmethod
+    def poll(cls, context):
+        return context.world and CyclesButtonsPanel.poll(context)
+
+    def draw(self, context):
+        layout = self.layout
+        layout.active = False
+
+        world = context.world
+        panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Volume')
+
+class CyclesMaterial_PT_surface(CyclesButtonsPanel, Panel):
+    bl_label = "Surface"
     bl_context = "material"
 
     @classmethod
@@ -440,8 +455,27 @@
         layout = self.layout
 
         mat = context.material
-        panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Shader')
+        panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Surface')
 
+class CyclesMaterial_PT_volume(CyclesButtonsPanel, Panel):
+    bl_label = "Volume"
+    bl_context = "material"
+
+    @classmethod
+    def poll(cls, context):
+        return context.material and CyclesButtonsPanel.poll(context)
+
+    def draw(self, context):
+        layout = self.layout
+        layout.active = False
+
+        mat = context.material
+        cmat = mat.cycles
+
+        panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Volume')
+
+        layout.prop(cmat, "homogeneous_volume")
+
 class CyclesMaterial_PT_displacement(CyclesButtonsPanel, Panel):
     bl_label = "Displacement"
     bl_context = "material"

Modified: branches/cycles/intern/cycles/blender/blender_shader.cpp
===================================================================
--- branches/cycles/intern/cycles/blender/blender_shader.cpp	2011-10-12 22:46:51 UTC (rev 40972)
+++ branches/cycles/intern/cycles/blender/blender_shader.cpp	2011-10-12 23:03:12 UTC (rev 40973)
@@ -607,7 +607,7 @@
 				closure->input("Color")->value = get_float3(b_mat->diffuse_color());
 				out = graph->output();
 
-				graph->connect(closure->output("BSDF"), out->input("Closure"));
+				graph->connect(closure->output("BSDF"), out->input("Surface"));
 			}
 
 			/* settings */
@@ -648,7 +648,7 @@
 			closure->input("Color")->value = get_float3(b_world.horizon_color());
 			out = graph->output();
 
-			graph->connect(closure->output("Background"), out->input("Closure"));
+			graph->connect(closure->output("Background"), out->input("Surface"));
 		}
 
 		shader->set_graph(graph);
@@ -698,7 +698,7 @@
 				closure->input("Strength")->value.x = b_lamp->energy()*10.0f;
 				out = graph->output();
 
-				graph->connect(closure->output("Emission"), out->input("Closure"));
+				graph->connect(closure->output("Emission"), out->input("Surface"));
 			}
 
 			shader->set_graph(graph);

Modified: branches/cycles/intern/cycles/kernel/kernel_shader.h
===================================================================
--- branches/cycles/intern/cycles/kernel/kernel_shader.h	2011-10-12 22:46:51 UTC (rev 40972)
+++ branches/cycles/intern/cycles/kernel/kernel_shader.h	2011-10-12 23:03:12 UTC (rev 40973)
@@ -482,7 +482,7 @@
 #else
 
 #ifdef __SVM__
-	svm_eval_nodes(kg, sd, SHADER_TYPE_CLOSURE, randb, path_flag);
+	svm_eval_nodes(kg, sd, SHADER_TYPE_SURFACE, randb, path_flag);
 #else
 	bsdf_diffuse_setup(sd, &sd->closure);
 	sd->closure.weight = make_float3(0.8f, 0.8f, 0.8f);
@@ -500,7 +500,7 @@
 #else
 
 #ifdef __SVM__
-	svm_eval_nodes(kg, sd, SHADER_TYPE_CLOSURE, 0.0f, path_flag);
+	svm_eval_nodes(kg, sd, SHADER_TYPE_SURFACE, 0.0f, path_flag);
 
 #ifdef __MULTI_CLOSURE__
 	float3 eval = make_float3(0.0f, 0.0f, 0.0f);
@@ -562,7 +562,7 @@
 #ifdef __OSL__
 	OSLShader::eval_volume(kg, sd, randb, path_flag);
 #else
-	svm_eval_nodes(kg, sd, SHADER_TYPE_CLOSURE, randb, path_flag);
+	svm_eval_nodes(kg, sd, SHADER_TYPE_VOLUME, randb, path_flag);
 #endif
 #endif
 }

Modified: branches/cycles/intern/cycles/kernel/osl/nodes/CMakeLists.txt
===================================================================
--- branches/cycles/intern/cycles/kernel/osl/nodes/CMakeLists.txt	2011-10-12 22:46:51 UTC (rev 40972)
+++ branches/cycles/intern/cycles/kernel/osl/nodes/CMakeLists.txt	2011-10-12 23:03:12 UTC (rev 40973)
@@ -32,8 +32,9 @@
 	node_musgrave_texture.osl
 	node_blend_weight_texture.osl
 	node_noise_texture.osl
-	node_output_closure.osl
 	node_output_displacement.osl
+	node_output_surface.osl
+	node_output_volume.osl
 	node_sky_texture.osl
 	node_stucci_texture.osl
 	node_texture_coordinate.osl

Deleted: branches/cycles/intern/cycles/kernel/osl/nodes/node_output_closure.osl
===================================================================
--- branches/cycles/intern/cycles/kernel/osl/nodes/node_output_closure.osl	2011-10-12 22:46:51 UTC (rev 40972)
+++ branches/cycles/intern/cycles/kernel/osl/nodes/node_output_closure.osl	2011-10-12 23:03:12 UTC (rev 40973)
@@ -1,25 +0,0 @@
-/*
- * Copyright 2011, Blender Foundation.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "stdosl.h"
-
-surface node_output_surface(closure color Closure = background())
-{
-	Ci = Closure;
-}
-

Copied: branches/cycles/intern/cycles/kernel/osl/nodes/node_output_surface.osl (from rev 40958, branches/cycles/intern/cycles/kernel/osl/nodes/node_output_surface.osl)
===================================================================
--- branches/cycles/intern/cycles/kernel/osl/nodes/node_output_surface.osl	                        (rev 0)
+++ branches/cycles/intern/cycles/kernel/osl/nodes/node_output_surface.osl	2011-10-12 23:03:12 UTC (rev 40973)
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "stdosl.h"
+
+surface node_output_surface(closure color Surface = background())
+{
+	Ci = Surface;
+}
+

Copied: branches/cycles/intern/cycles/kernel/osl/nodes/node_output_volume.osl (from rev 40958, branches/cycles/intern/cycles/kernel/osl/nodes/node_output_volume.osl)
===================================================================
--- branches/cycles/intern/cycles/kernel/osl/nodes/node_output_volume.osl	                        (rev 0)
+++ branches/cycles/intern/cycles/kernel/osl/nodes/node_output_volume.osl	2011-10-12 23:03:12 UTC (rev 40973)
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "stdosl.h"
+
+volume node_output_volume(closure color Volume = background())
+{
+	Ci = Volume;
+}
+

Modified: branches/cycles/intern/cycles/kernel/osl/osl_shader.cpp
===================================================================
--- branches/cycles/intern/cycles/kernel/osl/osl_shader.cpp	2011-10-12 22:46:51 UTC (rev 40972)
+++ branches/cycles/intern/cycles/kernel/osl/osl_shader.cpp	2011-10-12 23:03:12 UTC (rev 40973)
@@ -218,8 +218,8 @@
 	/* execute shader for this point */
 	int shader = sd->shader & SHADER_MASK;
 
-	if(kg->osl.state[shader])

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list