Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2019-11-01 14:09:55 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2019-11-27 18:05:54 +0300
commit2e6159a4948cd0f4e0b636734bfe506796bd87f2 (patch)
treefb04244033e45a69c514ec9a0ac6aa6fd28d5a33 /intern/opencolorio
parent6992fc0b3bf85e985169157b2e7ced1e1ed7fcdf (diff)
Curve: CurveMapping Extend Option
Extend options are currently stored per curve. This was not clearly communicated to the user and they expected this to be a setting per CurveMapping. This change will move the option from `Curve` to `CurveMapping`. In order to support this the API had to be changed. BPY: CurveMap.evaluate is also moved to CurveMapping.evaluate what breaks Python API. Cycles has been updated but other add-ons have not. After release of 2.81 we can merge this to master and adapt the add-ons. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D6169
Diffstat (limited to 'intern/opencolorio')
-rw-r--r--intern/opencolorio/gpu_shader_display_transform.glsl10
-rw-r--r--intern/opencolorio/ocio_capi.h6
-rw-r--r--intern/opencolorio/ocio_impl_glsl.cc4
3 files changed, 10 insertions, 10 deletions
diff --git a/intern/opencolorio/gpu_shader_display_transform.glsl b/intern/opencolorio/gpu_shader_display_transform.glsl
index 04e96e8ed3c..9787398e2ae 100644
--- a/intern/opencolorio/gpu_shader_display_transform.glsl
+++ b/intern/opencolorio/gpu_shader_display_transform.glsl
@@ -16,7 +16,7 @@ out vec4 fragColor;
*/
uniform sampler1D curve_mapping_texture;
uniform int curve_mapping_lut_size;
-uniform ivec4 use_curve_mapping_extend_extrapolate;
+uniform int use_curve_mapping_extend_extrapolate;
uniform vec4 curve_mapping_mintable;
uniform vec4 curve_mapping_range;
uniform vec4 curve_mapping_ext_in_x;
@@ -42,8 +42,8 @@ float read_curve_mapping(int table, int index)
float curvemap_calc_extend(int table, float x, vec2 first, vec2 last)
{
if (x <= first[0]) {
- if (use_curve_mapping_extend_extrapolate[table] == 0) {
- /* no extrapolate */
+ if (use_curve_mapping_extend_extrapolate == 0) {
+ /* horizontal extrapolation */
return first[1];
}
else {
@@ -55,8 +55,8 @@ float curvemap_calc_extend(int table, float x, vec2 first, vec2 last)
}
}
else if (x >= last[0]) {
- if (use_curve_mapping_extend_extrapolate[table] == 0) {
- /* no extrapolate */
+ if (use_curve_mapping_extend_extrapolate == 0) {
+ /* horizontal extrapolation */
return last[1];
}
else {
diff --git a/intern/opencolorio/ocio_capi.h b/intern/opencolorio/ocio_capi.h
index 9ba2d8fb8f9..5670b37f892 100644
--- a/intern/opencolorio/ocio_capi.h
+++ b/intern/opencolorio/ocio_capi.h
@@ -73,10 +73,10 @@ typedef struct OCIO_CurveMappingSettings {
int lut_size;
/* Extend extrapolation flags for all the tables.
- * if use_extend_extrapolate[T] != 0 means extrapolation for
- * table T is needed.
+ * if use_extend_extrapolate != 0 means extrapolation for
+ * curve.
*/
- int use_extend_extrapolate[4];
+ int use_extend_extrapolate;
/* Minimal X value of the curve mapping tables. */
float mintable[4];
diff --git a/intern/opencolorio/ocio_impl_glsl.cc b/intern/opencolorio/ocio_impl_glsl.cc
index 99d59c8d989..a80e29a2dec 100644
--- a/intern/opencolorio/ocio_impl_glsl.cc
+++ b/intern/opencolorio/ocio_impl_glsl.cc
@@ -499,8 +499,8 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r,
if (use_curve_mapping) {
immUniform1i("curve_mapping_texture", 2);
immUniform1i("curve_mapping_lut_size", curve_mapping_settings->lut_size);
- immUniform4iv("use_curve_mapping_extend_extrapolate",
- curve_mapping_settings->use_extend_extrapolate);
+ immUniform1i("use_curve_mapping_extend_extrapolate",
+ curve_mapping_settings->use_extend_extrapolate);
immUniform4fv("curve_mapping_mintable", curve_mapping_settings->mintable);
immUniform4fv("curve_mapping_range", curve_mapping_settings->range);
immUniform4fv("curve_mapping_ext_in_x", curve_mapping_settings->ext_in_x);