diff options
author | OmarSquircleArt <mail@OmarEmara.dev> | 2019-11-27 13:07:20 +0300 |
---|---|---|
committer | OmarSquircleArt <mail@OmarEmara.dev> | 2019-11-27 13:07:20 +0300 |
commit | 1c2f7b022a56b034e3e24d8bd5bf03d3beb5ca94 (patch) | |
tree | c40ab4fb676efce962fe833f858c311af6c0c8e4 /intern/cycles/render/attribute.cpp | |
parent | fc1a073bcdc9d2a9ecd4b765724b0f4f4cab4d46 (diff) |
Cycles: Add Random Per Island attribute.
The Random Per Island attribute is a random float associated with each
connected component (island) of the mesh. It is particularly useful
when artists want to add variations to meshes composed of separate
units. Like tree leaves created using particle systems, wood planks
created using array modifiers, or abstract splines created using AN.
Reviewed By: Sergey Sharybin, Jacques Lucke
Differential Revision: https://developer.blender.org/D6154
Diffstat (limited to 'intern/cycles/render/attribute.cpp')
-rw-r--r-- | intern/cycles/render/attribute.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/intern/cycles/render/attribute.cpp b/intern/cycles/render/attribute.cpp index 0fa1142f354..b65c2faa788 100644 --- a/intern/cycles/render/attribute.cpp +++ b/intern/cycles/render/attribute.cpp @@ -312,6 +312,8 @@ const char *Attribute::standard_name(AttributeStandard std) return "velocity"; case ATTR_STD_POINTINESS: return "pointiness"; + case ATTR_STD_RANDOM_PER_ISLAND: + return "random_per_island"; case ATTR_STD_NOT_FOUND: case ATTR_STD_NONE: case ATTR_STD_NUM: @@ -468,6 +470,9 @@ Attribute *AttributeSet::add(AttributeStandard std, ustring name) case ATTR_STD_POINTINESS: attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VERTEX); break; + case ATTR_STD_RANDOM_PER_ISLAND: + attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_FACE); + break; default: assert(0); break; @@ -496,6 +501,9 @@ Attribute *AttributeSet::add(AttributeStandard std, ustring name) case ATTR_STD_POINTINESS: attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VERTEX); break; + case ATTR_STD_RANDOM_PER_ISLAND: + attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_FACE); + break; default: assert(0); break; |