forked from bartvdbraak/blender
Color management: added view transforms form nuke-default and spi-vfx
- Added some extra view transforms to play with. It's not absolutely correct in terms this views were changed to use aces space as input. This gives exactly the same result as if using stand-alone spi-vfx and nuke-default configuration, but for real merge of this configs it'll be needed to add extra input spaces and transformations between them. - Replaced hard-coded aces input color space with default ocio linear space which makes it easier to play with different configurations. - Fixed SCons installation of color management configuration which used to skip copying LUTs when there was "luts" folder in install destination. - Print whether OCIO was enabled when building with CMake. Could be helpful due to OCIO is being automatically disabled if needed libraries are missed.
This commit is contained in:
parent
0aeb5fc6df
commit
6952d77262
@ -1841,6 +1841,7 @@ if(FIRST_RUN)
|
||||
info_cfg_option(WITH_INTERNATIONAL)
|
||||
info_cfg_option(WITH_INPUT_NDOF)
|
||||
info_cfg_option(WITH_CYCLES)
|
||||
info_cfg_option(WITH_OPENCOLORIO)
|
||||
|
||||
info_cfg_text("Compiler Options:")
|
||||
info_cfg_option(WITH_BUILDINFO)
|
||||
|
22
SConstruct
22
SConstruct
@ -611,11 +611,23 @@ if env['OURPLATFORM']!='darwin':
|
||||
scriptinstall.append(env.Install(dir=dir,source=cubin_file))
|
||||
|
||||
if env['WITH_BF_OCIO']:
|
||||
dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'datafiles', 'colormanagement')
|
||||
source=os.listdir('release/datafiles/colormanagement')
|
||||
if '.svn' in source: source.remove('.svn')
|
||||
if '_svn' in source: source.remove('_svn')
|
||||
source=['release/datafiles/colormanagement/'+s for s in source]
|
||||
colormanagement = os.path.join('release', 'datafiles', 'colormanagement')
|
||||
|
||||
for dp, dn, df in os.walk(colormanagement):
|
||||
if '.svn' in dn:
|
||||
dn.remove('.svn')
|
||||
if '_svn' in dn:
|
||||
dn.remove('_svn')
|
||||
|
||||
dir = os.path.join(env['BF_INSTALLDIR'], VERSION, 'datafiles')
|
||||
dir += os.sep + os.path.basename(colormanagement) + dp[len(colormanagement):]
|
||||
|
||||
source = [os.path.join(dp, f) for f in df if not f.endswith(".pyc")]
|
||||
|
||||
# To ensure empty dirs are created too
|
||||
if len(source) == 0:
|
||||
env.Execute(Mkdir(dir))
|
||||
|
||||
scriptinstall.append(env.Install(dir=dir,source=source))
|
||||
|
||||
if env['WITH_BF_INTERNATIONAL']:
|
||||
|
@ -26,13 +26,16 @@ displays:
|
||||
- !<View> {name: Raw, colorspace: raw}
|
||||
- !<View> {name: Log, colorspace: adx10}
|
||||
- !<View> {name: RRT, colorspace: rrt_srgb}
|
||||
- !<View> {name: SPI Film, colorspace: srgb8}
|
||||
- !<View> {name: SPI Log, colorspace: lg10}
|
||||
- !<View> {name: Nuke rec709, colorspace: rec709}
|
||||
xyz:
|
||||
- !<View> {name: Raw, colorspace: raw}
|
||||
- !<View> {name: Log, colorspace: adx10}
|
||||
- !<View> {name: RRT, colorspace: rrt_xyz}
|
||||
|
||||
active_displays: [sRGB, p3dci, xyz]
|
||||
active_views: [RRT, Log, Raw]
|
||||
active_views: [RRT, Log, SPI Film, SPI Log, Raw]
|
||||
|
||||
colorspaces:
|
||||
- !<ColorSpace>
|
||||
@ -241,3 +244,43 @@ colorspaces:
|
||||
- !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
|
||||
- !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
|
||||
- !<FileTransform> {src: rrt_ut33_dcdm.spi3d, interpolation: tetrahedral}
|
||||
|
||||
# spi-vfx
|
||||
|
||||
- !<ColorSpace>
|
||||
name: lg10
|
||||
family: lg
|
||||
equalitygroup:
|
||||
bitdepth: 10ui
|
||||
description: |
|
||||
lg10 : conversion from film log
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
to_reference: !<FileTransform> {src: lg10.spi1d, interpolation: nearest}
|
||||
|
||||
- !<ColorSpace>
|
||||
name: srgb8
|
||||
family: srgb
|
||||
equalitygroup:
|
||||
bitdepth: 8ui
|
||||
description: |
|
||||
srgb8 :rgb display space for the srgb standard.
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
from_reference: !<GroupTransform>
|
||||
children:
|
||||
- !<ColorSpaceTransform> {src: aces, dst: lg10}
|
||||
- !<FileTransform> {src: spi_ocio_srgb_test.spi3d, interpolation: linear}
|
||||
|
||||
# nuke-default
|
||||
- !<ColorSpace>
|
||||
name: rec709
|
||||
family: ""
|
||||
equalitygroup: ""
|
||||
bitdepth: 32f
|
||||
description: |
|
||||
Rec. 709 (Full Range) Display Space
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
allocationvars: [-0.125, 1.125]
|
||||
to_reference: !<FileTransform> {src: rec709.spi1d, interpolation: linear}
|
||||
|
2054
release/datafiles/colormanagement/luts/lg10.spi1d
Normal file
2054
release/datafiles/colormanagement/luts/lg10.spi1d
Normal file
File diff suppressed because it is too large
Load Diff
4107
release/datafiles/colormanagement/luts/rec709.spi1d
Normal file
4107
release/datafiles/colormanagement/luts/rec709.spi1d
Normal file
File diff suppressed because it is too large
Load Diff
32771
release/datafiles/colormanagement/luts/spi_ocio_srgb_test.spi3d
Normal file
32771
release/datafiles/colormanagement/luts/spi_ocio_srgb_test.spi3d
Normal file
File diff suppressed because it is too large
Load Diff
@ -67,6 +67,11 @@
|
||||
/* ** list of all supported color spaces, displays and views */
|
||||
#ifdef WITH_OCIO
|
||||
static ListBase global_colorspaces = {NULL};
|
||||
|
||||
static char global_role_linear[64];
|
||||
static char global_role_color_picking[64];
|
||||
static char global_role_texture_painting[64];
|
||||
|
||||
#endif
|
||||
|
||||
static ListBase global_displays = {NULL};
|
||||
@ -343,12 +348,40 @@ static void colormanage_cache_handle_release(void *cache_handle)
|
||||
/*********************** Initialization / De-initialization *************************/
|
||||
|
||||
#ifdef WITH_OCIO
|
||||
static void colormanage_role_color_space_name_get(ConstConfigRcPtr *config, char *colorspace_name, int max_colorspace_name,
|
||||
const char *role, const char *role_name)
|
||||
{
|
||||
ConstColorSpaceRcPtr *ociocs;
|
||||
|
||||
ociocs = OCIO_configGetColorSpace(config, role);
|
||||
|
||||
if (ociocs) {
|
||||
const char *name = OCIO_colorSpaceGetName(ociocs);
|
||||
|
||||
BLI_strncpy(colorspace_name, name, max_colorspace_name);
|
||||
OCIO_colorSpaceRelease(ociocs);
|
||||
}
|
||||
else {
|
||||
printf("Blender color management: Error could not find %s role.\n", role_name);
|
||||
}
|
||||
}
|
||||
|
||||
static void colormanage_load_config(ConstConfigRcPtr *config)
|
||||
{
|
||||
ConstColorSpaceRcPtr *ociocs;
|
||||
int tot_colorspace, tot_display, tot_display_view, index, viewindex, viewindex2;
|
||||
const char *name;
|
||||
|
||||
/* get roles */
|
||||
colormanage_role_color_space_name_get(config, global_role_linear, sizeof(global_role_linear),
|
||||
OCIO_ROLE_SCENE_LINEAR, "scene linear");
|
||||
|
||||
colormanage_role_color_space_name_get(config, global_role_color_picking, sizeof(global_role_color_picking),
|
||||
OCIO_ROLE_COLOR_PICKING, "color picking");
|
||||
|
||||
colormanage_role_color_space_name_get(config, global_role_texture_painting, sizeof(global_role_texture_painting),
|
||||
OCIO_ROLE_TEXTURE_PAINT, "texture_painting");
|
||||
|
||||
/* load colorspaces */
|
||||
tot_colorspace = OCIO_configGetNumColorSpaces(config);
|
||||
for (index = 0 ; index < tot_colorspace; index++) {
|
||||
@ -639,8 +672,8 @@ static ConstProcessorRcPtr *create_display_buffer_processor(const char *view_tra
|
||||
|
||||
dt = OCIO_createDisplayTransform();
|
||||
|
||||
/* OCIO_TODO: get rid of hardcoded input and display spaces */
|
||||
OCIO_displayTransformSetInputColorSpaceName(dt, "aces");
|
||||
/* OCIO_TODO: get rid of hardcoded input space */
|
||||
OCIO_displayTransformSetInputColorSpaceName(dt, global_role_linear);
|
||||
|
||||
OCIO_displayTransformSetView(dt, view_transform);
|
||||
OCIO_displayTransformSetDisplay(dt, display);
|
||||
|
Loading…
Reference in New Issue
Block a user