Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2011-12-02 01:46:10 +0400
committerDalai Felinto <dfelinto@gmail.com>2011-12-02 01:46:10 +0400
commit4db4a0933f8cef74a27561fa26e79ceab9021d67 (patch)
treedc641c5e8b4ab74fbdd51b13d6b115be2b7d5142 /intern/cycles/kernel/osl
parentb7db2587fb839ff8586ca377c8cc93175e38f470 (diff)
SeparateRGB and CombineRGB nodes for Cycles materials
reviewed and approved by Brecht my first OpenCL code \o/
Diffstat (limited to 'intern/cycles/kernel/osl')
-rw-r--r--intern/cycles/kernel/osl/nodes/CMakeLists.txt1
-rw-r--r--intern/cycles/kernel/osl/nodes/node_sepcomb_rgb.osl40
2 files changed, 41 insertions, 0 deletions
diff --git a/intern/cycles/kernel/osl/nodes/CMakeLists.txt b/intern/cycles/kernel/osl/nodes/CMakeLists.txt
index 1b8b81eb6f6..34729145f28 100644
--- a/intern/cycles/kernel/osl/nodes/CMakeLists.txt
+++ b/intern/cycles/kernel/osl/nodes/CMakeLists.txt
@@ -35,6 +35,7 @@ set(SRC_OSL
node_output_displacement.osl
node_output_surface.osl
node_output_volume.osl
+ node_sepcomb_rgb.osl
node_sky_texture.osl
node_stucci_texture.osl
node_texture_coordinate.osl
diff --git a/intern/cycles/kernel/osl/nodes/node_sepcomb_rgb.osl b/intern/cycles/kernel/osl/nodes/node_sepcomb_rgb.osl
new file mode 100644
index 00000000000..a02f31f4b07
--- /dev/null
+++ b/intern/cycles/kernel/osl/nodes/node_sepcomb_rgb.osl
@@ -0,0 +1,40 @@
+/*
+ * 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"
+
+shader node_separate_rgb(
+ color Image = color(0.8, 0.8, 0.8),
+ output float R = 0.0,
+ output float G = 0.0,
+ output float B = 0.0)
+{
+ R = Image[0];
+ G = Image[1];
+ B = Image[2];
+}
+
+shader node_combine_rgb(
+ float R = 0.0,
+ float G = 0.0,
+ float B = 0.0,
+ output color Image = color(0.8, 0.8, 0.8)
+{
+ Image = color(R, G, B)
+}
+