[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40959] branches/cycles: Cycles: replace surface/volume sockets in output nodes with a single shader socket ,
Brecht Van Lommel
brechtvanlommel at pandora.be
Wed Oct 12 17:42:36 CEST 2011
Revision: 40959
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40959
Author: blendix
Date: 2011-10-12 15:42:35 +0000 (Wed, 12 Oct 2011)
Log Message:
-----------
Cycles: replace surface/volume sockets in output nodes with a single shader socket,
decided it's better to render objects as either surface or volume.
This may break the volume rendering patch, but shaders with volume closures still
get tagged as having volume closures, so it should be fixable without too many
changes.
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_closure.osl
Removed Paths:
-------------
branches/cycles/intern/cycles/kernel/osl/nodes/node_output_surface.osl
branches/cycles/intern/cycles/kernel/osl/nodes/node_output_volume.osl
Modified: branches/cycles/intern/cycles/blender/addon/ui.py
===================================================================
--- branches/cycles/intern/cycles/blender/addon/ui.py 2011-10-12 14:16:05 UTC (rev 40958)
+++ branches/cycles/intern/cycles/blender/addon/ui.py 2011-10-12 15:42:35 UTC (rev 40959)
@@ -228,7 +228,7 @@
sub.prop(ccam, "aperture_rotation", text="Rotation")
class Cycles_PT_context_material(CyclesButtonsPanel, Panel):
- bl_label = "Surface"
+ bl_label = ""
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_nodes(CyclesButtonsPanel, Panel):
- bl_label = "Nodes"
+class CyclesLamp_PT_shader(CyclesButtonsPanel, Panel):
+ bl_label = "Shader"
bl_context = "data"
@classmethod
@@ -412,10 +412,10 @@
layout = self.layout
mat = context.lamp
- panel_node_draw(layout, mat, 'OUTPUT_LAMP', 'Surface')
+ panel_node_draw(layout, mat, 'OUTPUT_LAMP', 'Shader')
-class CyclesWorld_PT_surface(CyclesButtonsPanel, Panel):
- bl_label = "Surface"
+class CyclesWorld_PT_shader(CyclesButtonsPanel, Panel):
+ bl_label = "Shader"
bl_context = "world"
@classmethod
@@ -426,25 +426,10 @@
layout = self.layout
mat = context.world
- panel_node_draw(layout, mat, 'OUTPUT_WORLD', 'Surface')
+ panel_node_draw(layout, mat, 'OUTPUT_WORLD', '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"
+class CyclesMaterial_PT_shader(CyclesButtonsPanel, Panel):
+ bl_label = "Shader"
bl_context = "material"
@classmethod
@@ -455,27 +440,8 @@
layout = self.layout
mat = context.material
- panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Surface')
+ panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Shader')
-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 14:16:05 UTC (rev 40958)
+++ branches/cycles/intern/cycles/blender/blender_shader.cpp 2011-10-12 15:42:35 UTC (rev 40959)
@@ -584,7 +584,7 @@
closure->input("Color")->value = get_float3(b_mat->diffuse_color());
out = graph->output();
- graph->connect(closure->output("BSDF"), out->input("Surface"));
+ graph->connect(closure->output("BSDF"), out->input("Closure"));
}
/* settings */
@@ -625,7 +625,7 @@
closure->input("Color")->value = get_float3(b_world.horizon_color());
out = graph->output();
- graph->connect(closure->output("Background"), out->input("Surface"));
+ graph->connect(closure->output("Background"), out->input("Closure"));
}
shader->set_graph(graph);
@@ -675,7 +675,7 @@
closure->input("Strength")->value.x = b_lamp->energy()*10.0f;
out = graph->output();
- graph->connect(closure->output("Emission"), out->input("Surface"));
+ graph->connect(closure->output("Emission"), out->input("Closure"));
}
shader->set_graph(graph);
Modified: branches/cycles/intern/cycles/kernel/kernel_shader.h
===================================================================
--- branches/cycles/intern/cycles/kernel/kernel_shader.h 2011-10-12 14:16:05 UTC (rev 40958)
+++ branches/cycles/intern/cycles/kernel/kernel_shader.h 2011-10-12 15:42:35 UTC (rev 40959)
@@ -482,7 +482,7 @@
#else
#ifdef __SVM__
- svm_eval_nodes(kg, sd, SHADER_TYPE_SURFACE, randb, path_flag);
+ svm_eval_nodes(kg, sd, SHADER_TYPE_CLOSURE, 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_SURFACE, 0.0f, path_flag);
+ svm_eval_nodes(kg, sd, SHADER_TYPE_CLOSURE, 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_VOLUME, randb, path_flag);
+ svm_eval_nodes(kg, sd, SHADER_TYPE_CLOSURE, 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 14:16:05 UTC (rev 40958)
+++ branches/cycles/intern/cycles/kernel/osl/nodes/CMakeLists.txt 2011-10-12 15:42:35 UTC (rev 40959)
@@ -32,9 +32,8 @@
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
Copied: branches/cycles/intern/cycles/kernel/osl/nodes/node_output_closure.osl (from rev 40934, branches/cycles/intern/cycles/kernel/osl/nodes/node_output_surface.osl)
===================================================================
--- branches/cycles/intern/cycles/kernel/osl/nodes/node_output_closure.osl (rev 0)
+++ branches/cycles/intern/cycles/kernel/osl/nodes/node_output_closure.osl 2011-10-12 15:42:35 UTC (rev 40959)
@@ -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 Closure = background())
+{
+ Ci = Closure;
+}
+
Deleted: branches/cycles/intern/cycles/kernel/osl/nodes/node_output_surface.osl
===================================================================
--- branches/cycles/intern/cycles/kernel/osl/nodes/node_output_surface.osl 2011-10-12 14:16:05 UTC (rev 40958)
+++ branches/cycles/intern/cycles/kernel/osl/nodes/node_output_surface.osl 2011-10-12 15:42:35 UTC (rev 40959)
@@ -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 Surface = background())
-{
- Ci = Surface;
-}
-
Deleted: branches/cycles/intern/cycles/kernel/osl/nodes/node_output_volume.osl
===================================================================
--- branches/cycles/intern/cycles/kernel/osl/nodes/node_output_volume.osl 2011-10-12 14:16:05 UTC (rev 40958)
+++ branches/cycles/intern/cycles/kernel/osl/nodes/node_output_volume.osl 2011-10-12 15:42:35 UTC (rev 40959)
@@ -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"
-
-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 14:16:05 UTC (rev 40958)
+++ branches/cycles/intern/cycles/kernel/osl/osl_shader.cpp 2011-10-12 15:42:35 UTC (rev 40959)
@@ -218,8 +218,8 @@
/* execute shader for this point */
int shader = sd->shader & SHADER_MASK;
- if(kg->osl.surface_state[shader])
- ctx->execute(OSL::pvt::ShadUseSurface, *(kg->osl.surface_state[shader]), *globals);
+ if(kg->osl.state[shader])
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list