[Bf-blender-cvs] [2356c3f4cd9] temp-viewport-compositor-merge: Realtime Compositor: Use more consistent names
Omar Emara
noreply at git.blender.org
Tue Jun 28 13:07:12 CEST 2022
Commit: 2356c3f4cd9a530f8812979f375166ea37d08f8a
Author: Omar Emara
Date: Fri Jun 17 10:34:57 2022 +0200
Branches: temp-viewport-compositor-merge
https://developer.blender.org/rB2356c3f4cd9a530f8812979f375166ea37d08f8a
Realtime Compositor: Use more consistent names
===================================================================
M source/blender/nodes/composite/nodes/node_composite_channel_matte.cc
M source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc
M source/blender/nodes/composite/nodes/node_composite_color_matte.cc
M source/blender/nodes/composite/nodes/node_composite_color_spill.cc
M source/blender/nodes/composite/nodes/node_composite_colorbalance.cc
M source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc
M source/blender/nodes/composite/nodes/node_composite_diff_matte.cc
M source/blender/nodes/composite/nodes/node_composite_distance_matte.cc
M source/blender/nodes/composite/nodes/node_composite_luma_matte.cc
M source/blender/nodes/composite/nodes/node_composite_setalpha.cc
===================================================================
diff --git a/source/blender/nodes/composite/nodes/node_composite_channel_matte.cc b/source/blender/nodes/composite/nodes/node_composite_channel_matte.cc
index e17e85f8b87..2f37eba9f2c 100644
--- a/source/blender/nodes/composite/nodes/node_composite_channel_matte.cc
+++ b/source/blender/nodes/composite/nodes/node_composite_channel_matte.cc
@@ -130,7 +130,7 @@ class ChannelMatteShaderNode : public ShaderNode {
return bnode().custom2 - 1;
}
- NodeChroma *get_node_chroma()
+ NodeChroma *get_data()
{
return static_cast<NodeChroma *>(bnode().storage);
}
@@ -138,7 +138,7 @@ class ChannelMatteShaderNode : public ShaderNode {
/* Get the index of the channel used to compute the limit value. */
int get_limit_channel()
{
- return get_node_chroma()->channel - 1;
+ return get_data()->channel - 1;
}
/* Get the indices of the channels used to compute the limit value. We always assume the limit
@@ -146,7 +146,7 @@ class ChannelMatteShaderNode : public ShaderNode {
* the maximum of two identical values is is the same value. */
void get_limit_channels(float limit_channels[2])
{
- if (get_node_chroma()->algorithm) {
+ if (get_data()->algorithm) {
/* If the algorithm is Max, store the indices of the other two channels other than the matte
* channel. */
limit_channels[0] = (get_matte_channel() + 1) % 3;
@@ -161,12 +161,12 @@ class ChannelMatteShaderNode : public ShaderNode {
float get_max_limit()
{
- return get_node_chroma()->t1;
+ return get_data()->t1;
}
float get_min_limit()
{
- return get_node_chroma()->t2;
+ return get_data()->t2;
}
};
diff --git a/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc b/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc
index 9dcd4213949..df74c069b5d 100644
--- a/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc
+++ b/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc
@@ -84,24 +84,24 @@ class ChromaMatteShaderNode : public ShaderNode {
GPU_uniform(&falloff));
}
- NodeChroma *get_node_chroma()
+ NodeChroma *get_data()
{
return static_cast<NodeChroma *>(bnode().storage);
}
float get_acceptance()
{
- return std::tan(get_node_chroma()->t1) / 2.0f;
+ return std::tan(get_data()->t1) / 2.0f;
}
float get_cutoff()
{
- return get_node_chroma()->t2;
+ return get_data()->t2;
}
float get_falloff()
{
- return get_node_chroma()->fstrength;
+ return get_data()->fstrength;
}
};
diff --git a/source/blender/nodes/composite/nodes/node_composite_color_matte.cc b/source/blender/nodes/composite/nodes/node_composite_color_matte.cc
index 5e3aaf512e6..9c20b41460b 100644
--- a/source/blender/nodes/composite/nodes/node_composite_color_matte.cc
+++ b/source/blender/nodes/composite/nodes/node_composite_color_matte.cc
@@ -83,7 +83,7 @@ class ColorMatteShaderNode : public ShaderNode {
GPU_uniform(&value_epsilon));
}
- NodeChroma *get_node_chroma()
+ NodeChroma *get_data()
{
return static_cast<NodeChroma *>(bnode().storage);
}
@@ -91,17 +91,17 @@ class ColorMatteShaderNode : public ShaderNode {
float get_hue_epsilon()
{
/* Divide by 2 because the hue wraps around. */
- return get_node_chroma()->t1 / 2.0f;
+ return get_data()->t1 / 2.0f;
}
float get_saturation_epsilon()
{
- return get_node_chroma()->t2;
+ return get_data()->t2;
}
float get_value_epsilon()
{
- return get_node_chroma()->t3;
+ return get_data()->t3;
}
};
diff --git a/source/blender/nodes/composite/nodes/node_composite_color_spill.cc b/source/blender/nodes/composite/nodes/node_composite_color_spill.cc
index f2c066431b7..f84a6021cf0 100644
--- a/source/blender/nodes/composite/nodes/node_composite_color_spill.cc
+++ b/source/blender/nodes/composite/nodes/node_composite_color_spill.cc
@@ -134,24 +134,24 @@ class ColorSpillShaderNode : public ShaderNode {
return bnode().custom2;
}
- NodeColorspill *get_node_color_spill()
+ NodeColorspill *get_data()
{
return static_cast<NodeColorspill *>(bnode().storage);
}
void get_spill_scale(float spill_scale[3])
{
- const NodeColorspill *node_color_spill = get_node_color_spill();
- if (node_color_spill->unspill == 0) {
+ const NodeColorspill *data = get_data();
+ if (data->unspill == 0) {
spill_scale[0] = 0.0f;
spill_scale[1] = 0.0f;
spill_scale[2] = 0.0f;
spill_scale[get_spill_channel()] = -1.0f;
}
else {
- spill_scale[0] = node_color_spill->uspillr;
- spill_scale[1] = node_color_spill->uspillg;
- spill_scale[2] = node_color_spill->uspillb;
+ spill_scale[0] = data->uspillr;
+ spill_scale[1] = data->uspillg;
+ spill_scale[2] = data->uspillb;
spill_scale[get_spill_channel()] *= -1.0f;
}
}
@@ -159,7 +159,7 @@ class ColorSpillShaderNode : public ShaderNode {
/* Get the index of the channel used for limiting. */
int get_limit_channel()
{
- return get_node_color_spill()->limchan;
+ return get_data()->limchan;
}
/* Get the indices of the channels used to compute the limit value. We always assume the limit
@@ -182,7 +182,7 @@ class ColorSpillShaderNode : public ShaderNode {
float get_limit_scale()
{
- return get_node_color_spill()->limscale;
+ return get_data()->limscale;
}
};
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc b/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc
index 90c5f6b4748..acca02bd606 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc
+++ b/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc
@@ -161,7 +161,7 @@ class ColorBalanceShaderNode : public ShaderNode {
GPUNodeStack *inputs = get_inputs_array();
GPUNodeStack *outputs = get_outputs_array();
- const NodeColorBalance *node_color_balance = get_node_color_balance();
+ const NodeColorBalance *data = get_data();
if (get_color_balance_method() == 0) {
GPU_stack_link(material,
@@ -169,9 +169,9 @@ class ColorBalanceShaderNode : public ShaderNode {
"node_composite_color_balance_lgg",
inputs,
outputs,
- GPU_uniform(node_color_balance->lift),
- GPU_uniform(node_color_balance->gamma),
- GPU_uniform(node_color_balance->gain));
+ GPU_uniform(data->lift),
+ GPU_uniform(data->gamma),
+ GPU_uniform(data->gain));
return;
}
@@ -180,10 +180,10 @@ class ColorBalanceShaderNode : public ShaderNode {
"node_composite_color_balance_asc_cdl",
inputs,
outputs,
- GPU_uniform(node_color_balance->offset),
- GPU_uniform(node_color_balance->power),
- GPU_uniform(node_color_balance->slope),
- GPU_uniform(&node_color_balance->offset_basis));
+ GPU_uniform(data->offset),
+ GPU_uniform(data->power),
+ GPU_uniform(data->slope),
+ GPU_uniform(&data->offset_basis));
}
/* Get color balance method.
@@ -194,7 +194,7 @@ class ColorBalanceShaderNode : public ShaderNode {
return bnode().custom1;
}
- NodeColorBalance *get_node_color_balance()
+ NodeColorBalance *get_data()
{
return static_cast<NodeColorBalance *>(bnode().storage);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc b/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc
index 36e6672ce1c..48d43ba3407 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc
+++ b/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc
@@ -294,7 +294,7 @@ class ColorCorrectionShaderNode : public ShaderNode {
float luminance_coefficients[3];
IMB_colormanagement_get_luminance_coefficients(luminance_coefficients);
- const NodeColorCorrection *node_color_correction = get_node_color_correction();
+ const NodeColorCorrection *data = get_data();
GPU_stack_link(material,
&bnode(),
@@ -302,28 +302,28 @@ class ColorCorrectionShaderNode : public ShaderNode {
inputs,
outputs,
GPU_constant(enabled_channels),
- GPU_uniform(&node_color_correction->startmidtones),
- GPU_uniform(&node_color_correction->endmidtones),
- GPU_uniform(&node_color_correction->master.saturation),
- GPU_uniform(&node_color_correction->master.contrast),
- GPU_uniform(&node_color_correction->master.gamma),
- GPU_uniform(&node_color_correction->master.gain),
- GPU_uniform(&node_color_correction->master.lift),
- GPU_uniform(&node_color_correction->shadows.saturation),
- GPU_uniform(&node_color_correction->shadows.contrast),
- GPU_uniform(&node_color_correction->shadows.gamma),
- GPU_uniform(&node_color_correction->shadows.gain),
- GPU_uniform(&node_color_correction->shadows.lift),
- GPU_uniform(&node_color_correction->midtones.saturation),
- GPU_uniform(&node_color_correction->midtones.contrast),
- GPU_uniform(&node_color_correction->midtones.gamma),
- GPU_uniform(&node_color_correction->midtones.gain),
- GPU_uniform(&node_color_correction->midtones.lift),
- GPU_uniform(&node_color_correction->highlights.saturation),
- GPU_uniform(&node_color_correction->highlights.contrast),
- GPU_uniform(&node_color_correction->highlights.gamma),
- GPU_uniform(&node_color_correction->highlights.gain),
- GPU_uniform(&node_color_correction->highlights.lift),
+ GPU_unif
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list