diff options
author | OmarSquircleArt <omar.squircleart@gmail.com> | 2019-09-12 18:42:13 +0300 |
---|---|---|
committer | OmarSquircleArt <omar.squircleart@gmail.com> | 2019-09-12 18:42:13 +0300 |
commit | 2ea82e86ca60c1c268c6074ecba10524cebd97ed (patch) | |
tree | bf355c2a930f584685f68a833ce620ad15e63a70 /intern/cycles/render/mesh.cpp | |
parent | f80018b5f7497d7ed0fe79783c4cd76f05ec1c7c (diff) |
Shading: Add Vertex Color node.
This patch adds a new Vertex Color node. The node also returns the alpha
of the vertex color layer as an output.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D5767
Diffstat (limited to 'intern/cycles/render/mesh.cpp')
-rw-r--r-- | intern/cycles/render/mesh.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp index 3d2cc98d38b..9be078b6fca 100644 --- a/intern/cycles/render/mesh.cpp +++ b/intern/cycles/render/mesh.cpp @@ -1223,6 +1223,8 @@ void MeshManager::update_osl_attributes(Device *device, osl_attr.type = TypeDesc::TypeMatrix; else if (req.triangle_type == TypeFloat2) osl_attr.type = TypeFloat2; + else if (req.triangle_type == TypeRGBA) + osl_attr.type = TypeRGBA; else osl_attr.type = TypeDesc::TypeColor; @@ -1246,6 +1248,8 @@ void MeshManager::update_osl_attributes(Device *device, osl_attr.type = TypeDesc::TypeMatrix; else if (req.curve_type == TypeFloat2) osl_attr.type = TypeFloat2; + else if (req.curve_type == TypeRGBA) + osl_attr.type = TypeRGBA; else osl_attr.type = TypeDesc::TypeColor; @@ -1269,6 +1273,8 @@ void MeshManager::update_osl_attributes(Device *device, osl_attr.type = TypeDesc::TypeMatrix; else if (req.subd_type == TypeFloat2) osl_attr.type = TypeFloat2; + else if (req.subd_type == TypeRGBA) + osl_attr.type = TypeRGBA; else osl_attr.type = TypeDesc::TypeColor; @@ -1341,6 +1347,8 @@ void MeshManager::update_svm_attributes(Device *, attr_map[index].w = NODE_ATTR_MATRIX; else if (req.triangle_type == TypeFloat2) attr_map[index].w = NODE_ATTR_FLOAT2; + else if (req.triangle_type == TypeRGBA) + attr_map[index].w = NODE_ATTR_RGBA; else attr_map[index].w = NODE_ATTR_FLOAT3; @@ -1379,6 +1387,8 @@ void MeshManager::update_svm_attributes(Device *, attr_map[index].w = NODE_ATTR_MATRIX; else if (req.subd_type == TypeFloat2) attr_map[index].w = NODE_ATTR_FLOAT2; + else if (req.triangle_type == TypeRGBA) + attr_map[index].w = NODE_ATTR_RGBA; else attr_map[index].w = NODE_ATTR_FLOAT3; |