diff options
author | Thomas Dinges <blender@dingto.org> | 2014-06-13 23:44:48 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2014-06-13 23:59:14 +0400 |
commit | 3de3987ea190415d0d088c3917b45f44afb43840 (patch) | |
tree | 35577ec3798ee74ee4c37821ec74981b3c9d7342 /intern/cycles/kernel/shaders | |
parent | 49df707496e505c8a8b21c1ea36b479e950cc66c (diff) |
Cycles: Add dedicated nodes to split/combine vectors.
This was already possible via the RGB nodes, but that seems weird.
Diffstat (limited to 'intern/cycles/kernel/shaders')
-rw-r--r-- | intern/cycles/kernel/shaders/CMakeLists.txt | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/shaders/node_combine_xyz.osl | 27 | ||||
-rw-r--r-- | intern/cycles/kernel/shaders/node_separate_xyz.osl | 28 |
3 files changed, 57 insertions, 0 deletions
diff --git a/intern/cycles/kernel/shaders/CMakeLists.txt b/intern/cycles/kernel/shaders/CMakeLists.txt index 5518d652bf9..b164c2a03f7 100644 --- a/intern/cycles/kernel/shaders/CMakeLists.txt +++ b/intern/cycles/kernel/shaders/CMakeLists.txt @@ -13,6 +13,7 @@ set(SRC_OSL node_checker_texture.osl node_combine_rgb.osl node_combine_hsv.osl + node_combine_xyz.osl node_convert_from_color.osl node_convert_from_float.osl node_convert_from_int.osl @@ -57,6 +58,7 @@ set(SRC_OSL node_rgb_ramp.osl node_separate_rgb.osl node_separate_hsv.osl + node_separate_xyz.osl node_set_normal.osl node_sky_texture.osl node_subsurface_scattering.osl diff --git a/intern/cycles/kernel/shaders/node_combine_xyz.osl b/intern/cycles/kernel/shaders/node_combine_xyz.osl new file mode 100644 index 00000000000..933dee5bd78 --- /dev/null +++ b/intern/cycles/kernel/shaders/node_combine_xyz.osl @@ -0,0 +1,27 @@ +/* + * Copyright 2011-2014 Blender Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +#include "stdosl.h" + +shader node_combine_xyz( + float X = 0.0, + float Y = 0.0, + float Z = 0.0, + output vector Vector = 0.8) +{ + Vector = vector(X, Y, Z); +} + diff --git a/intern/cycles/kernel/shaders/node_separate_xyz.osl b/intern/cycles/kernel/shaders/node_separate_xyz.osl new file mode 100644 index 00000000000..63725cb9995 --- /dev/null +++ b/intern/cycles/kernel/shaders/node_separate_xyz.osl @@ -0,0 +1,28 @@ +/* + * Copyright 2011-2013 Blender Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +#include "stdosl.h" + +shader node_separate_xyz( + vector Vector = 0.8, + output float X = 0.0, + output float Y = 0.0, + output float Z = 0.0) +{ + X = Vector[0]; + Y = Vector[1]; + Z = Vector[2]; +} |