diff options
author | Matt Ebb <matt@mke3.net> | 2009-12-02 10:56:34 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2009-12-02 10:56:34 +0300 |
commit | b89138564eee9b576263518df0ed5dc045668f75 (patch) | |
tree | 234313b65a3715b5589f50d34aa6c6534a406d30 /source/blender/makesrna/intern | |
parent | c758f6589e5d91e9fa2086a7db744282f2ea1e55 (diff) |
Changes to Color Management
After testing and feedback, I've decided to slightly modify the way color
management works internally. While the previous method worked well for
rendering, was a smaller transition and had some advantages over this
new method, it was a bit more ambiguous, and was making things difficult
for other areas such as compositing.
This implementation now considers all color data (with only a couple of
exceptions such as brush colors) to be stored in linear RGB color space,
rather than sRGB as previously. This brings it in line with Nuke, which also
operates this way, quite successfully. Color swatches, pickers, color ramp
display are now gamma corrected to display gamma so you can see what
you're doing, but the numbers themselves are considered linear. This
makes understanding blending modes more clear (a 0.5 value on overlay
will not change the result now) as well as making color swatches act more
predictably in the compositor, however bringing over color values from
applications like photoshop or gimp, that operate in a gamma space,
will give identical results.
This commit will convert over existing files saved by earlier 2.5 versions to
work generally the same, though there may be some slight differences with
things like textures. Now that we're set on changing other areas of shading,
this won't be too disruptive overall.
I've made a diagram explaining the pipeline here:
http://mke3.net/blender/devel/2.5/25_linear_workflow_pipeline.png
and some docs here:
http://www.blender.org/development/release-logs/blender-250/color-management/
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_color.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 3d4e128c3ac..543e1f3ecc0 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1430,7 +1430,7 @@ static const char *rna_property_subtypename(PropertyType type) case PROP_VELOCITY: return "PROP_VELOCITY"; case PROP_ACCELERATION: return "PROP_ACCELERATION"; case PROP_XYZ: return "PROP_XYZ"; - case PROP_RGB: return "PROP_RGB"; + case PROP_COLOR_GAMMA: return "PROP_COLOR_GAMMA"; case PROP_LAYER: return "PROP_LAYER"; case PROP_LAYER_MEMBER: return "PROP_LAYER_MEMBER"; default: { diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 6c0a3c57f65..5ee811d4c46 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -693,7 +693,7 @@ char RNA_property_array_item_char(PropertyRNA *prop, int index) return quatitem[index]; else if((index < 4) && ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION)) return vectoritem[index]; - else if ((index < 4) && ELEM(subtype, PROP_COLOR, PROP_RGB)) + else if ((index < 4) && ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA)) return coloritem[index]; return '\0'; @@ -731,7 +731,7 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name) return 3; } } - else if (ELEM(subtype, PROP_COLOR, PROP_RGB)) { + else if (ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA)) { switch (name) { case 'R': return 0; diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index e9744c7f5ed..28f546c07f1 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -203,7 +203,7 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Rate", "Number of paints per second for Airbrush."); RNA_def_property_update(prop, 0, "rna_Brush_update"); - prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); + prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "rgb"); RNA_def_property_ui_text(prop, "Color", ""); RNA_def_property_update(prop, 0, "rna_Brush_update"); diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 2a97eb78382..c4edd00045b 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -216,13 +216,13 @@ static void rna_def_curvemapping(BlenderRNA *brna) RNA_def_property_struct_type(prop, "CurveMap"); RNA_def_property_ui_text(prop, "Curves", ""); - prop= RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_RGB); + prop= RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "black"); RNA_def_property_range(prop, -1000.0f, 1000.0f); RNA_def_property_ui_text(prop, "Black Level", "For RGB curves, the color that black is mapped to"); RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_black_level_set", NULL); - prop= RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_RGB); + prop= RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "white"); RNA_def_property_range(prop, -1000.0f, 1000.0f); RNA_def_property_ui_text(prop, "White Level", "For RGB curves, the color that white is mapped to"); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 5ff8bffe715..85007482dc4 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -1239,7 +1239,7 @@ static void rna_def_material_sss(BlenderRNA *brna) RNA_def_struct_nested(brna, srna, "Material"); RNA_def_struct_ui_text(srna, "Material Subsurface Scattering", "Diffuse subsurface scattering settings for a Material datablock."); - prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_RGB|PROP_UNIT_LENGTH); + prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_COLOR|PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "sss_radius"); RNA_def_property_range(prop, 0.001, FLT_MAX); RNA_def_property_ui_range(prop, 0.001, 10000, 1, 3); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index f8adb1a79d8..5997867030d 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -869,7 +869,7 @@ static void rna_def_property(BlenderRNA *brna) {PROP_EULER, "EULER", 0, "Euler", ""}, {PROP_QUATERNION, "QUATERNION", 0, "Quaternion", ""}, {PROP_XYZ, "XYZ", 0, "XYZ", ""}, - {PROP_RGB, "RGB", 0, "RGB", ""}, + {PROP_COLOR_GAMMA, "COLOR_GAMMA", 0, "Gamma Corrected Color", ""}, {PROP_LAYER, "LAYER", 0, "Layer", ""}, {PROP_LAYER_MEMBER, "LAYER_MEMBERSHIP", 0, "Layer Membership", ""}, {0, NULL, 0, NULL, NULL}}; |