diff options
author | Matt Ebb <matt@mke3.net> | 2009-07-17 06:43:15 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2009-07-17 06:43:15 +0400 |
commit | 1ef729358517248888073be71ba5d3b6e3d723ee (patch) | |
tree | dfa33f083ac1afd500e76dcf4bc581394637d0dd /source/blender/blenlib/intern | |
parent | 70f6255433fcb1f5551199ef7a285a9ab80a3318 (diff) |
Colour Management
- 1st stage: Linear Workflow
This implements automatic linear workflow in Blender's renderer. With the
new Colour Management option on in the Render buttons, all inputs to the
renderer and compositor are converted to linear colour space before
rendering, and gamma corrected afterwards. In essence, this makes all
manual gamma correction with nodes, etc unnecessary, since it's done
automatically through the pipeline.
It's all explained much better in the notes/doc here, so please have a look:
http://wiki.blender.org/index.php/Dev:Source/Blender/Architecture/Colour_Management
And an example of the sort of difference it makes:
http://mke3.net/blender/devel/rendering/b25_colormanagement_test01.jpg
This also enables Colour Management in the default B.blend, and changes the
default lamp falloff to inverse square, which is more correct, and much
easier to use now it's all gamma corrected properly.
Next step is to look into profiles/soft proofing for the compositor.
Thanks to brecht for reviewing and fixing some oversights!
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/arithb.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index f111e94a141..03be10dd0b1 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -3542,33 +3542,10 @@ int constrain_rgb(float *r, float *g, float *b) if (w > 0) { *r += w; *g += w; *b += w; - return 1; /* Colour modified to fit RGB gamut */ + return 1; /* Color modified to fit RGB gamut */ } - return 0; /* Colour within RGB gamut */ -} - -/*Transform linear RGB values to nonlinear RGB values. Rec. - 709 is ITU-R Recommendation BT. 709 (1990) ``Basic - Parameter Values for the HDTV Standard for the Studio and - for International Programme Exchange'', formerly CCIR Rec. - 709.*/ -static void gamma_correct(float *c) -{ - /* Rec. 709 gamma correction. */ - float cc = 0.018f; - - if (*c < cc) - *c *= ((1.099f * (float)pow(cc, 0.45)) - 0.099f) / cc; - else - *c = (1.099f * (float)pow(*c, 0.45)) - 0.099f; -} - -void gamma_correct_rgb(float *r, float *g, float *b) -{ - gamma_correct(r); - gamma_correct(g); - gamma_correct(b); + return 0; /* Color within RGB gamut */ } |