Commit Graph

34056 Commits

Author SHA1 Message Date
Sergey Sharybin
ad15c19ab9 Merging r50573 through r50575 from trunk soc-2011-tomato 2012-09-13 13:53:58 +00:00
Sergey Sharybin
f631ae9f46 Color Management: fix segfault when configuration file is missing
Also don't try to load configuration file from environment variable if
it contains empty string.
2012-09-13 13:08:31 +00:00
Sergey Sharybin
de7a57a242 Merging r50522 through r50572 from trunk into soc-2011-tomato 2012-09-13 11:13:13 +00:00
Jens Verwiebe
4f9ee399c0 Fix typo in blenfont sconscript, broke compile 2012-09-13 08:09:12 +00:00
Sergey Sharybin
a793c5bc4c Color Management: prevent abort when sequencer's color space is not found in OCIO configuration 2012-09-11 18:41:32 +00:00
Sergey Sharybin
445020a153 Color Management: improve compatibility with old files with disabled color management
Still not perfect compatibility, but making it better is a bit tricky now.
2012-09-11 16:28:01 +00:00
Sergey Sharybin
5f512bec47 Sequencer: added option to calculate modifiers in linear space
It was really annoying mistake in original support of logarithmic color space
for sequencer which made adjustment layers be working in linear space. Seems
this was only an issue for modifiers in adjustment effect.

Now all modifiers are applying in sequencer's color space (in fact, this was
fixed in svn rev50275).

To preserve compatibility of Mango grading added this option which probably
wouldn't be used by others.
2012-09-11 12:35:25 +00:00
Sergey Sharybin
20d84be6b5 Color Management: fix for wrong default color space and view 2012-09-11 10:34:19 +00:00
Sergey Sharybin
777a49dfef Merging r50502 through r50521 from trunk into soc-2011-tomato 2012-09-11 09:13:57 +00:00
Sergey Sharybin
07082fb7d0 Color Management: color space cleanup
Hide all meaningless for Blender input color spaces and made naming
for rest of them to match Blender's interface better.

Not sure if we'll need to support logarithmic color space as input.

Renamed P3DCI to DCI-P3 which seems to be more common naming.

Also added Film view for DCI-P3 display.
2012-09-11 09:07:46 +00:00
Sergey Sharybin
96d20fe437 Color Management: added check for invertibility of color spaces
So now non-invertible color spaces can not be used as input color space
for images and as working color space for sequencer.

Currently have got two hard-coded families which are rrt and display.
If color space belong to one of this families, it would be considered
as non-invertible.

Data color spaces are always considered invertible.

If color space has got to_reference transformation, it'll be considered
invertible.
2012-09-11 07:56:47 +00:00
Sergey Sharybin
b4cac859e9 Color management: get rid of hardcoded color space None 2012-09-10 17:38:48 +00:00
Sergey Sharybin
74885d1d84 Color Management: port image stamp to new color management system
Use the same approach as interface does by using default view which
is supposed to be invertible to convert color from display space to
scene linear.
2012-09-10 17:24:48 +00:00
Sergey Sharybin
3e881745e5 Color Management: resolve TODOs related on HSV widgets 2012-09-10 16:30:15 +00:00
Sergey Sharybin
ce3566a4cb Color Management: add View as Render to image datablocks
This is need since some images (like normal maps, textures and so) would
want to be viewed without any tone map applied on them. On the same time
it's possible that some images would want to be affected by tone maps,
and renders would always want to be affected by tone maps.

After long discussion with Brecht we decided less painful and most clear
way would be to simply add "View as Render" option to image datablocks.

If this option is enabled for image, both settings from Display and
Render blocks of color management settings would be applied on display.

If this option is disabled, only display transform with default view and
no exposure/gamma/curves would be applied.

Render result and compositor viewers would always have "View as Render"
enabled.

There's separated setting when image is saving which says whether saved
image should be affected by render part of color management settings.

This option is enabled by default for render result/node viewer and
disabled by default for all the rest images. This option wouldn't have
affect when saving to float formats such as EXR.
2012-09-10 14:47:47 +00:00
Sergey Sharybin
b0605eed2c Color Management: finish pipeline changes
This commit hopefully finishes color management pipeline changes, implements
some missed functionality and fixes some bugs.

Mainly changes are related on getting rid of old Color Management flag which
became counter-intuitive in conjunction with OpenColorIO.

Now color management is always assuming to be enabled and non-color managed
pipeline is emulated using display device called None. This display has got
single view which is basically NO-OP (raw) transformation, not applying any
tone curve and displays colors AS-IS. In most cases it behaves the same as
disabling Color Management in shading panel, but there is at least one known
difference in behavior: compositor and sequence editors would output images
in linear space, not in sRGB as it used to be before.

It'll be quite tricky to make this behave in exactly the same way as it
used to, and not sure if we really need to do it.

3D viewport is supposed to be working in sRGB space, no tonemaps would be
applied there. This is another case where compatibility breaks in comparison
with old color management pipeline, but supporting display transformation
would be tricky since it'll also be needed to make GLSL shaders, textures
and so be aware of display transform.

Interface is now aware of display transformation, but it only uses default
display view, no exposure, gamma or curve mapping is supported there.
This is so color widgets could apply display transformation in both
directions. Such behavior is a bit counter-intuitive, but it's currently
the only way to make color picking working smoothly. In theory we'll need
to support color picking color space, but it'll be also a bit tricky since
in Blender display transform is configurable from the interface and could
be used for artistics needs and in such design it's not possible to figure
out invertable color space which could be used for color picking.

In other software it's not so big issue since all color spaces, display
transform and so are strictly defined by pipeline and in this case it is
possible to define color picking space which would be close enough to
display space.

Sequencer's color space now could be configured from the interface --
it's settings are situated in Scene buttons, Color Management panel.
Default space is sRGB. It was made configurable because we used vd16
color space during Mango which was close to Film view used by grading
department.

Sequencer will convert float buffers to this color space before operating
with them hopefully giving better results. Byte buffers wouldn't be
converted to this color space an they'll be handled in their own colors[ace.
Converting them to sequencer's working space would lead to precision loss
without much visible benefits. It shouldn't be an issue since float and
byte images would never be blended together -- byte image would be converted
to float first if it's needed to be blended with float image.

Byte buffers now allowed to be color managed. This was needed to make code
in such areas as baking and rendering don't have hardcoded linear to sRGB
conversions, making things more clear from code point of view.

Input color space is now assigning on image/movie clip load and default
roles are used for this. So for float images default space would be rec709
and for byte images default space would be sRGB.

Added Non-Color color space which is aimed to be used for such things as
normal/heights maps. It's currently the same as raw colorspace, just has
got more clear naming for users. Probably we'll also need to make it not
affected by display transformation.

Think this is all main pipeline-related changes, more details would be there:

http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management

Other changes and fixes:

- Lots of internal code clean up in color management module.

- Made OpenColorIO module using guarded memory allocation. This allowed to
  fix couple of memory leaks and would help preventing leaks in the future.

- Made sure color unpremultiply and dither are supported by all OpenColorIO
  defined color transformations.

- Made compositor's preview images be aware of display transformation.
  Legacy compositor still uses old Color Management flags, but likely we'll
  disable compositor for the release and remove legacy code soon, so don't
  think we'll need to spend time on porting that code to new color management
  system.

- Made OpenGL rendering be aware of display transform when saving render
  result. Now it behaves in the same way as regular rendering.

TODO:

- HSV widgets are using linear rgb/sRGB conversions for single channel,
  not sure how this should be ported to new color pipeline.

- Image stamp would use hardcoded linear rgb to sRGB conversion for
  filling rectangles. Probably it should use default display view
  for this instead, would check this with Brecht.

- Get rid of None color space which was only used for compatibility reasons.

- Made it more clear which color spaces could be used as input space.

- There're also some remained TODO's in the code marked as OCIO_TODO,
  but wouldn't consider them as stoppers for at least this commit.
2012-09-10 11:46:15 +00:00
Sergey Sharybin
832841d50f Merging r50484 through r50501 from trunk into soc-2011-tomato 2012-09-10 10:58:59 +00:00
Sergey Sharybin
f1a498acee Merging r50478 through r50483 from trunk into soc-2011-tomato 2012-09-09 08:33:42 +00:00
Sergey Sharybin
37a70492d1 Merging r50470 through r50477 from trunk into soc-2011-tomato 2012-09-08 10:17:42 +00:00
Sergey Sharybin
62076905a3 Merging r50457 through r50469 from trunk into soc-2011-tomato 2012-09-07 12:53:41 +00:00
Sergey Sharybin
a913101b4b Tomato: alignment issue fix
There were alignment issues on 32bit systems caused by 64bit integer
used in Scene.
2012-09-07 09:44:22 +00:00
Sergey Sharybin
8cc17be274 Merging r50450 through r50454 from trunk into soc-2011-tomato 2012-09-06 16:06:55 +00:00
Sergey Sharybin
0b778a9026 Merging r50423 through r50449 from trunk into soc-2011-tomato 2012-09-06 09:44:32 +00:00
Sergey Sharybin
bac6f03e16 Color Management: fix for dereferencing NULL pointer 2012-09-05 16:29:16 +00:00
Sergey Sharybin
4d152140a3 Color Management: exposure is in fact pre-display transfrom 2012-09-05 16:24:33 +00:00
Sergey Sharybin
ee5bf889e9 Color Management: RGB curves transform as a part of display transform
This replaces per-image editor curve mapping which didn't behave properly
(it was possible to open the same image in two image editors and setup
different curves in this editors, but only last changed curve was applied
on image)

After discussion with Brecht decided to have something which works reliable
and predictable and ended up with adding RGB curves as a part of display
transform, which is applied before OCIO processor (to match old behavior).

Setting white/black values from image editor (Ctrl/Shift + LMB) would
affect on scene settings.

This could break compatibility, but there's no reliable way to convert
old semi-working settings into new one.
2012-09-05 16:08:36 +00:00
Sergey Sharybin
7d980ca969 Color Management: don't show input color space for byte images 2012-09-05 14:29:15 +00:00
Sergey Sharybin
16a126622e Merging r50413 through r50422 from trunk into soc-2011-tomato 2012-09-05 14:19:40 +00:00
Sergey Sharybin
196028a99f Color Management: made OpenColorIO transformations aware of color unpremultiply
Mainly behaves in the same way as legacy color transformation, but it'll
give different result on over and under exposured areas.

Not sure if it's indeed issue -- seems this behaves crappy in both of
current stable release and OCIO branch.
2012-09-05 13:58:01 +00:00
Sergey Sharybin
ade9acca41 Color Management: fix for tiled image draw and remove unused code 2012-09-05 12:14:09 +00:00
Sergey Sharybin
201583592f Code cleanup -- remove unneeded changes, synchronize some areas with trunk 2012-09-05 12:00:08 +00:00
Sergey Sharybin
c6599979c7 Sequencer: multi-threaded histogram calculation
This gives some percentage of speedup, which compensates slowdown
caused by converting image buffer into display space.

Used OpenMP for this. Still feel skeptic about this, discussed with
Brecht and we decided this approach actually could be used since
seems all the platforms has got OpenMP issues solved.

Waveform and vector scopes are still single-threaded since they're
a bit tricker to be done multi-threaded and probably not so commonly
used.
2012-09-05 11:43:11 +00:00
Sergey Sharybin
54cf098492 Sequencer: cache currently displaying scopes
This avoids calculation of scopes on every redraw, so such tools as panning
and zoom wouldn't imply re-calculating scopes.

Implemented as a structure inside of SpaceSeq, juts like it's done for clip
and image spaces.

Also fixed zebra display to work in display space.
2012-09-05 11:43:05 +00:00
Sergey Sharybin
f4817e316e Color Management: sequencer's scopes now works in display space
Added utility function to apply display transformation on image buffer's
float array which is currently only used by sequencer's scopes.

This function is multithreaded, but scopes should be improved further
since currently they're being recalculated from scratch on every draw.
2012-09-05 11:42:57 +00:00
Sergey Sharybin
3963425006 Merging r50374 through r50412 from trunk into soc-2011-tomato 2012-09-05 11:42:20 +00:00
Sergey Sharybin
8dff07ef9a Color Management: fix for color sample information line
- Color managed RGB values wouldn't be displayed anymore for
  byte images (which are currently unsupported to be managed).

- Color rectangle would now be color managed

- Sequencer was passing non-linear float to information line,
  now it'll pass linear float.
2012-09-04 12:32:32 +00:00
Sergey Sharybin
1508f62169 Color Management: fix for view/display settings validation
It was a misusage of LinkData and actual data leading to wrong
string comparsion and possible wrong memory access.
2012-09-04 12:32:18 +00:00
Sergey Sharybin
3b9c3604c6 Color Management: remove hardcoded ACES ODT tonemap
This tonemap was added as a temporary option only and if it'll be
needed again, it'll be better to implement is as either a spline
in OCIO or as a film response curve (as some of such curves were
added as a presets for RGB curves in Mango production SVN).

Also revert changes made to IMB_buffer_byte_from_float since it's
not actually needed anymore and makes it's clearer changes against
trunk.
2012-09-04 12:32:12 +00:00
Sergey Sharybin
e15f352831 Merging r50265 through r50373 from trunk into soc-2011-tomato 2012-09-04 09:06:37 +00:00
Sergey Sharybin
86ff6cc346 Color Management: fix compilation error when OCIO is disabled 2012-09-03 10:08:55 +00:00
Thomas Dinges
6acb586c95 Cycles / Brick Texture:
* Added GLSL stub for the Brick texture, fixes an error in the console when switching to Material Shading in the 3D View.
2012-08-30 20:45:01 +00:00
Sergey Sharybin
70301f431c Color management: make it behave closer to trunk
Avoid using tricks with ibuf->profile to check whether image buffer is
in sequencer or linear space. Assume the whole sequencer works in non
linear float space and do transformation to linear where it;s needed
only.

This removes confusion from the code, fixes wrong behavior of some
effects.
2012-08-30 13:40:31 +00:00
Sergey Sharybin
63197444b4 Color management: some parts of previous commit were incorrect merged from WIP patch 2012-08-29 18:11:51 +00:00
Sergey Sharybin
2e1568d64e Color management: fix for wrong view being used as default in configuration file check
Also marked Jpeg2K as non-float format.
2012-08-29 18:08:34 +00:00
Sergey Sharybin
d6a617ff06 Merging r50248 through r50264 from trunk into soc-2011-tomato 2012-08-29 12:49:10 +00:00
Sergey Sharybin
7a13bc2196 Fix wrong user counter in world node trees
World is being localized without increasing ID users, so no need
to decrease ID users on localized world free.
2012-08-29 12:47:42 +00:00
Campbell Barton
635db3b306 code cleanup: add utility function BLI_path_is_rel() 2012-08-29 10:32:38 +00:00
Campbell Barton
1d9eaad73a code cleanup: replace term 'alpha' with '64' in makesdna, this was historic that dec-alpha was the first 64bit system blender was ported for, but now its not helpful to call it this way. 2012-08-29 09:51:38 +00:00
Campbell Barton
0bd759fddd new image operator now allows color grid (before was only grid on/off) 2012-08-29 08:17:38 +00:00
Campbell Barton
78ded61065 texture curves were not initialized (causing crash), own regression from moving curve initialization outside evaluation. 2012-08-29 07:58:36 +00:00