diff options
author | OmarSquircleArt <omar.squircleart@gmail.com> | 2019-08-21 21:04:09 +0300 |
---|---|---|
committer | OmarSquircleArt <omar.squircleart@gmail.com> | 2019-08-21 21:04:09 +0300 |
commit | 133dfdd704b6a2a4d46337696773b331a44304ea (patch) | |
tree | e7465681db5a8783614fa2617ecb2455f1bef623 /source/blender/makesrna | |
parent | 7f4a2fc437cf9a6decbda152bd7d36ce7a08929f (diff) |
Shading: Add White Noise node.
The White Noise node hashes the input and returns a random number in the
range [0, 1]. The input can be a 1D, 2D, 3D, or a 4D vector.
Reviewers: brecht, JacquesLucke
Differential Revision: https://developer.blender.org/D5550
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index f377ae9a84f..b7a2dd9a185 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -170,6 +170,14 @@ const EnumPropertyItem rna_enum_node_vec_math_items[] = { {0, NULL, 0, NULL, NULL}, }; +const EnumPropertyItem rna_enum_node_tex_dimensions_items[] = { + {1, "1D", 0, "1D", "Use the scalar value W as input"}, + {2, "2D", 0, "2D", "Use the 2D vector (x, y) as input. The z component is ignored"}, + {3, "3D", 0, "3D", "Use the 3D vector Vector as input"}, + {4, "4D", 0, "4D", "Use the 4D vector (x, y, z, w) as input"}, + {0, NULL, 0, NULL, NULL}, +}; + const EnumPropertyItem rna_enum_node_filter_items[] = { {0, "SOFTEN", 0, "Soften", ""}, {1, "SHARPEN", 0, "Sharpen", ""}, @@ -4497,6 +4505,18 @@ static void def_sh_tex_wave(StructRNA *srna) RNA_def_property_update(prop, 0, "rna_Node_update"); } +static void def_sh_tex_white_noise(StructRNA *srna) +{ + PropertyRNA *prop; + + prop = RNA_def_property(srna, "dimensions", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom1"); + RNA_def_property_enum_items(prop, rna_enum_node_tex_dimensions_items); + RNA_def_property_ui_text( + prop, "Dimensions", "The number of dimensions to evaluate the noise in"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNode_socket_update"); +} + static void def_sh_tex_coord(StructRNA *srna) { PropertyRNA *prop; |