UI: Add input descriptions for Shader Nodes and fix Principled BSDF parameters. #119169

Merged
Brecht Van Lommel merged 3 commits from Bartosz-Kosiorek/blender:desc2 into main 2024-03-11 13:19:26 +01:00
6 changed files with 73 additions and 23 deletions

View File

@ -8,8 +8,14 @@ namespace blender::nodes::node_shader_background_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Color").default_value({0.8f, 0.8f, 0.8f, 1.0f});
b.add_input<decl::Float>("Strength").default_value(1.0f).min(0.0f).max(1000000.0f);
b.add_input<decl::Color>("Color")
.default_value({0.8f, 0.8f, 0.8f, 1.0f})
.description("Color of the emitted light");
b.add_input<decl::Float>("Strength")
.default_value(1.0f)
.min(0.0f)
.max(1000000.0f)
.description("Strength of the emitted light");
b.add_input<decl::Float>("Weight").unavailable();
b.add_output<decl::Shader>("Background");
}

View File

@ -52,7 +52,7 @@ static void node_declare(NodeDeclarationBuilder &b)
" (0.0 is a perfect mirror reflection, 1.0 is completely rough)");
#define SOCK_ROUGHNESS_ID 2
b.add_input<decl::Float>("IOR").default_value(1.5f).min(1.0f).max(1000.0f).description(
"Index of refraction for specular reflection and transmission. "
"Index of Refraction (IOR) for specular reflection and transmission. "
Bartosz-Kosiorek marked this conversation as resolved Outdated

"of" should be lower case

"of" should be lower case
"For most materials, the IOR is between 1.0 (vacuum and air) and 4.0 (germanium). "
"The default value of 1.5 is a good approximation for glass");
#define SOCK_IOR_ID 3
@ -106,7 +106,7 @@ static void node_declare(NodeDeclarationBuilder &b)
.max(3.8f)
.subtype(PROP_FACTOR)
.short_label("IOR")
.description("Index of refraction used for rays that enter the subsurface component");
.description("Index of Refraction (IOR) used for rays that enter the subsurface component");
Bartosz-Kosiorek marked this conversation as resolved Outdated

same here, of

same here, of
#define SOCK_SUBSURFACE_IOR_ID 10
sss.add_input<decl::Float>("Subsurface Anisotropy")
.default_value(0.0f)
@ -115,9 +115,9 @@ static void node_declare(NodeDeclarationBuilder &b)
.subtype(PROP_FACTOR)
.short_label("Anisotropy")
.description(
"Directionanltiy of volume scattering within the subsurface medium. "
"Directionality of volume scattering within the subsurface medium. "
"Zero scatters uniformly in all directions, with higher values "
"scattering more strongly forward. For example skin has been measured "
"scattering more strongly forward. For example, skin has been measured "
"to have an anisotropy of 0.8");
#define SOCK_SUBSURFACE_ANISOTROPY_ID 11
@ -135,7 +135,7 @@ static void node_declare(NodeDeclarationBuilder &b)
.subtype(PROP_FACTOR)
.short_label("IOR Level")
.description(
"Adjustment to the IOR to increase or decrease specular intensity "
"Adjustment to the Index of Refraction (IOR) to increase or decrease specular intensity "
Bartosz-Kosiorek marked this conversation as resolved Outdated

Same here.

Same here.
"(0.5 means no adjustment, 0 removes all reflections, 1 doubles them at normal "
"incidence)");
#define SOCK_SPECULAR_ID 12
@ -165,7 +165,7 @@ static void node_declare(NodeDeclarationBuilder &b)
.description("Rotates the direction of anisotropy, with 1.0 going full circle");
#define SOCK_ANISOTROPIC_ROTATION_ID 15
spec.add_input<decl::Vector>("Tangent").hide_value().description(
"Controls the tangent line for the Anisotropic layer");
"Controls the tangent direction for anisotropy");
#define SOCK_TANGENT_ID 16
/* Panel for Transmission settings. */
@ -205,7 +205,7 @@ static void node_declare(NodeDeclarationBuilder &b)
.max(4.0f)
.short_label("IOR")
.description(
"The index of refraction of the coat layer "
"The Index of Refraction (IOR) of the coat layer "
Bartosz-Kosiorek marked this conversation as resolved Outdated

same here

same here
"(affects its reflectivity as well as the falloff of coat tinting)");
#define SOCK_COAT_IOR_ID 20
coat.add_input<decl::Color>("Coat Tint")
@ -255,7 +255,7 @@ static void node_declare(NodeDeclarationBuilder &b)
.max(1000000.0f)
.short_label("Strength")
.description(
"Strength of the emitted light. A value of 1.0 will ensure "
"Strength of the emitted light. A value of 1.0 ensures "
"that the object in the image has the exact same color as the Emission Color");
#define SOCK_EMISSION_STRENGTH_ID 27
}

View File

@ -21,8 +21,16 @@ static void node_declare(NodeDeclarationBuilder &b)
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR);
b.add_input<decl::Float>("Distance").default_value(1.0f).min(0.0f).max(1000.0f);
.subtype(PROP_FACTOR)
.description(
"Strength of the bump mapping effect, interpolating between "
"no bump mapping and full bump mapping");
b.add_input<decl::Float>("Distance")
.default_value(1.0f)
.min(0.0f)
.max(1000.0f)
.description(
"Multiplier for the height value to control the overall distance for bump mapping");
b.add_input<decl::Float>("Height").default_value(1.0f).min(-1000.0f).max(1000.0f).hide_value();
b.add_input<decl::Vector>("Normal").min(-1.0f).max(1.0f).hide_value();
b.add_output<decl::Vector>("Normal");

View File

@ -22,7 +22,14 @@ namespace blender::nodes::node_shader_color_ramp_cc {
static void sh_node_valtorgb_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Float>("Fac").default_value(0.5f).min(0.0f).max(1.0f).subtype(PROP_FACTOR);
b.add_input<decl::Float>("Fac")
.default_value(0.5f)
Bartosz-Kosiorek marked this conversation as resolved Outdated

Remove period at the end.

Also "The color to map" sounds wrong, since Fac is a number input. Maybe "The input value to map onto the color gradient."

Remove period at the end. Also "The color to map" sounds wrong, since Fac is a number input. Maybe "The input value to map onto the color gradient."
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.description(
"The value used to map onto the color gradient. 0.0 results in the leftmost color, "
"while 1.0 results in the rightmost");
b.add_output<decl::Color>("Color");
b.add_output<decl::Float>("Alpha");
}

View File

@ -8,7 +8,14 @@ namespace blender::nodes::node_shader_mix_shader_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>("Fac").default_value(0.5f).min(0.0f).max(1.0f).subtype(PROP_FACTOR);
b.add_input<decl::Float>("Fac")
.default_value(0.5f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.description(
"Blend weight to use for mixing two shaders. "
"At zero it uses the first shader entirely and at one the second shader");
b.add_input<decl::Shader>("Shader");
b.add_input<decl::Shader>("Shader", "Shader_001");
b.add_output<decl::Shader>("Shader");

View File

@ -28,23 +28,45 @@ static void sh_node_tex_noise_declare(NodeDeclarationBuilder &b)
/* Default to 1 instead of 4, because it is much faster. */
node_storage(node).dimensions = 1;
});
b.add_input<decl::Float>("Scale").min(-1000.0f).max(1000.0f).default_value(5.0f);
b.add_input<decl::Float>("Detail").min(0.0f).max(15.0f).default_value(2.0f);
b.add_input<decl::Float>("Scale").min(-1000.0f).max(1000.0f).default_value(5.0f).description(
"Scale of the base noise octave");
b.add_input<decl::Float>("Detail").min(0.0f).max(15.0f).default_value(2.0f).description(
"The number of noise octaves. Higher values give more detailed noise but increase render "
Bartosz-Kosiorek marked this conversation as resolved Outdated

..give more detailed noise but increase render time.

..give more detailed noise but increase render time.
"time");
b.add_input<decl::Float>("Roughness")
.min(0.0f)
.max(1.0f)
.default_value(0.5f)
.subtype(PROP_FACTOR);
.subtype(PROP_FACTOR)
Bartosz-Kosiorek marked this conversation as resolved Outdated

"Blend factor between an octave and its previous one. A value of zero corresponds to zero detail"
At least this is my understanding, maybe someone could verify this.

"Blend factor between an octave and its previous one. A value of zero corresponds to zero detail" At least this is my understanding, maybe someone could verify this.
.description(
"Blend factor between an octave and its previous one. A value of zero corresponds to "
"zero detail");
b.add_input<decl::Float>("Lacunarity")
.min(0.0f)
Bartosz-Kosiorek marked this conversation as resolved Outdated

This is rather hard to understand. Maybe "The difference in scale between two consecutive octaves. A larger value corresponds to a larger difference".

This is rather hard to understand. Maybe "The difference in scale between two consecutive octaves. A larger value corresponds to a larger difference".
.max(1000.0f)
.default_value(2.0f)
.description("The scale of a Perlin noise octave relative to that of the previous octave");
b.add_input<decl::Float>("Offset").min(-1000.0f).max(1000.0f).default_value(0.0f).make_available(
[](bNode &node) { node_storage(node).type = SHD_NOISE_RIDGED_MULTIFRACTAL; });
b.add_input<decl::Float>("Gain").min(0.0f).max(1000.0f).default_value(1.0f).make_available(
[](bNode &node) { node_storage(node).type = SHD_NOISE_RIDGED_MULTIFRACTAL; });
b.add_input<decl::Float>("Distortion").min(-1000.0f).max(1000.0f).default_value(0.0f);
.description(
"The difference between the scale of each two consecutive octaves. Larger values "
"corresponds to larger scale for higher octaves");
b.add_input<decl::Float>("Offset")
.min(-1000.0f)
.max(1000.0f)
.default_value(0.0f)
.make_available([](bNode &node) { node_storage(node).type = SHD_NOISE_RIDGED_MULTIFRACTAL; })
.description(
"An added offset to each octave, determines the level where the highest octave will "
"appear");
b.add_input<decl::Float>("Gain")
.min(0.0f)
.max(1000.0f)
.default_value(1.0f)
.make_available([](bNode &node) { node_storage(node).type = SHD_NOISE_RIDGED_MULTIFRACTAL; })
.description("An extra multiplier to tune the magnitude of octaves");
b.add_input<decl::Float>("Distortion")
.min(-1000.0f)
.max(1000.0f)
.default_value(0.0f)
.description("Amount of distortion");
b.add_output<decl::Float>("Fac").no_muted_links();
b.add_output<decl::Color>("Color").no_muted_links();
}