Color spaces support (aka OpenColorIO v2.0)
Re: Color spaces support (aka OpenColorIO v2.0)
Sorry guys is OCIO 2.0 now available on BlendLuxcore ?
Want to test it.
Want to test it.
Re: Color spaces support (aka OpenColorIO v2.0)
Not exposed yet, no.
- richardbao
- Posts: 17
- Joined: Tue Mar 09, 2021 7:47 am
Re: Color spaces support (aka OpenColorIO v2.0)
any info on the release date>?
v2.6 i guess?
v2.6 i guess?
- richardbao
- Posts: 17
- Joined: Tue Mar 09, 2021 7:47 am
Re: Color spaces support (aka OpenColorIO v2.0)
Dade wrote: ↑Sun Apr 11, 2021 10:21 am Introduction
I have added the support for color spaces to LuxCoreRender v2.6 branch. LuxCore internally works in a linear FP32 color space and any input/output color needs to be converted to/from that color space. There are currently 3 supported input/output color spaces: Nop, LuxCore and OpenColorIO.
Nop color space
This is the internal LuxCore linear FP32 color space so it is effectively a nop conversion (i.e. the color is not modified).
LuxCore color space
This is just a gamma corrected color space so all inputs are reversed gamma corrected and all output are gamma corrected.
OpenColorIO color space
OpenColorIO (https://opencolorio.org) color space supports a wide configurable range of color spaces, including industrial standards like: ACES (https://acescolorspace.com), Filmic (https://sobotka.github.io/filmic-blender), Sony Anim/VFX (https://github.com/imageworks/OpenColorIO-Configs), etc..
What is the problem ?
There was a major problem in LuxCore before the introduction of color spaces: LuxCore applies reverse gamma correction to input images (texture maps, etc.) but not to input colors. This means the color you pick on the screen was not the color you get as output (i.e. it is like if it was gamma corrected 2 times). The difference can be really huge. This is the main reason why you should start to use color spaces even if compatibility with the past is fully maintained.
Compatibility
By default, LuxCore still work exactly as now. All the new color spaces related features are available as an extension and are not breaking the compatibility with the past.
Outputs conversion
New OpenColorIO tone mapper
The first tool to enable the use of color spaces is the new TONEMAP_OPENCOLORIO. It converts the rendering output using OpenColorIO. It supporte 3 working modes:
1) Color space conversion, for instance, this converts from Sony "lnf" color space (LuxCore linear FP32 color space, aka Nop color space) to Sony "vd8" (Sony video 8bit color space):
2) Color space conversion for display:Code: Select all
# From linear FP32 color space to video display 8 bit colorspace film.imagepipelines.0.0.type = TONEMAP_OPENCOLORIO film.imagepipelines.0.0.mode = COLORSPACE_CONVERSION # Use system default OpenColorIO configuration film.imagepipelines.0.0.config = "" film.imagepipelines.0.0.src = lnf film.imagepipelines.0.0.dst = vd8
3) LUT conversion:Code: Select all
# Using a display mode film.imagepipelines.0.0.type = TONEMAP_OPENCOLORIO film.imagepipelines.0.0.mode = DISPLAY_CONVERSION # Use Sony Anim OpenColorIO configuration film.imagepipelines.0.0.config = "deps/opencolorio-configs/spi-anim/config.ocio" film.imagepipelines.0.0.src = lnf film.imagepipelines.0.0.display = sRGB film.imagepipelines.0.0.view = Film
OpenColorIO transformations already include gamma correction, so this tone mapper doesn't require to use the gamma correction plugin.Code: Select all
# Using a custom LUT mode film.imagepipelines.0.0.type = TONEMAP_OPENCOLORIO film.imagepipelines.0.0.mode = LUT_CONVERSION film.imagepipelines.0.0.lutfile = deps/opencolorio-configs/spi-anim/luts/lmf.spi1d
Inputs conversion
Image maps color space support
It is now possible to declare the color space of an image map (used for texture mapping, infinite lights, etc.) in order to have the appropriate conversion to internal LuxCore rnedering color space. For instance, Nop color space:
LuxCore color space:Code: Select all
scene.textures.imgtex.file = scenes/randomizedtiling/pattern-3.jpg scene.textures.imgtex.colorspace = nop
OpenColorIO color space:Code: Select all
scene.textures.imgtex.file = scenes/randomizedtiling/pattern-3.jpg scene.textures.imgtex.colorspace = luxcore scene.textures.imgtex.colorspace.gamma = 2.2
Constant float and float3 textures (aka constant colors)Code: Select all
scene.textures.imgtex.file = scenes/randomizedtiling/pattern-3.jpg scene.textures.imgtex.colorspace = opencolorio # Use system default OpenColorIO configuration scene.textures.imgtex.colorspace.config = "" scene.textures.imgtex.colorspace.name = vd8
It is now possible to declare the color space of a constant color (float and float3), for instance:
Implicit definitions of constant float and float3 textures (aka constant colors)Code: Select all
scene.textures.KhakiCol.type = constfloat3 scene.textures.KhakiCol.value = 1. 0.824176 0.549451 scene.textures.KhakiCol.colorspace = luxcore scene.textures.KhakiCol.colorspace.gamma = 2.2 ## scene.textures.DarkGreenCol.type = constfloat3 scene.textures.DarkGreenCol.value = 0. 0.4 0. scene.textures.DarkGreenCol.colorspace = opencolorio # Use system default OpenColorIO configuration scene.textures.DarkGreenCol.colorspace.config = "" scene.textures.DarkGreenCol.colorspace.name = vd8
LuxCore supports a more compact and inlined definition of constant colors. This syntax has been extended too:
Code: Select all
# Old syntax scene.materials.HalveRed.type = matte scene.materials.HalveRed.kd = 0.70003 0. 0.
Code: Select all
scene.materials.HalveRed.type = matte scene.materials.HalveRed.kd = nop 0.70003 0. 0.
Code: Select all
scene.materials.HalveRed.type = matte scene.materials.HalveRed.kd = luxcore 2.2 0.70003 0. 0.
Materials and Light sources constant colorsCode: Select all
scene.materials.HalveRed.type = matte scene.materials.HalveRed.kd = opencolorio "" vd8 0.70003 0. 0.
The same syntax of implicit definitions of constant float and float3 can be used in all properties of material and light sources. This pretty much cover all possible inputs.
Blender integration
How to integrated this feature in Blender is something still to be defined and it depends in how Blender supports and works with color spaces. The general rule should be to have the possibility to pick a color space every time you select a color or an image. The same for the outputs. Adding this feature may require few iterations.
Hi Dade, any explanation on this mode 2?
film.imagepipelines.0.0.src = lnf
film.imagepipelines.0.0.display = sRGB
film.imagepipelines.0.0.view = Film
i am little confused with the display and view parameters. whats the difference and what are they use for?
Re: Color spaces support (aka OpenColorIO v2.0)
It all really depends on what your OpenColorIO configuration file defines. For instance looks at ACES configuration: https://github.com/imageworks/OpenColor ... g.ocio#L40richardbao wrote: ↑Thu Aug 05, 2021 12:19 pm film.imagepipelines.0.0.src = lnf
film.imagepipelines.0.0.display = sRGB
film.imagepipelines.0.0.view = Film
i am little confused with the display and view parameters. whats the difference and what are they use for?
There you have a "ACES" display and a long list of devices: sRGB, DCDM, DCDM P3 gamut clip, P3-D60, P3-D60 ST2084 1000 nits, P3-D60 ST2084 2000 nits, P3-D60 ST2084 4000 nits, P3-DCI, Rec.2020, Rec.2020 ST2084 1000 nits, Rec.709, Rec.709 D60 sim., sRGB D60 sim., Raw, Log.
The general idea in LuxCore is to have multiple image pipelines with different OCIO settings: one to save on file in a generic color space, one for each display device you are using. This is done with the purpose to obtain the same output on different display devices.
All the tag (i.e. "lnf", "sRGB", "Film") are meaningful only in the context of a specific OCIO configuration, they are just arbitrary names corresponding to some kind of color space transformations defined in the configuration file. I think I used Sony VFX configuration in my example above.
- richardbao
- Posts: 17
- Joined: Tue Mar 09, 2021 7:47 am
Re: Color spaces support (aka OpenColorIO v2.0)
Thanks for replying, Dade.Dade wrote: ↑Thu Aug 05, 2021 9:38 pmIt all really depends on what your OpenColorIO configuration file defines. For instance looks at ACES configuration: https://github.com/imageworks/OpenColor ... g.ocio#L40richardbao wrote: ↑Thu Aug 05, 2021 12:19 pm film.imagepipelines.0.0.src = lnf
film.imagepipelines.0.0.display = sRGB
film.imagepipelines.0.0.view = Film
i am little confused with the display and view parameters. whats the difference and what are they use for?
There you have a "ACES" display and a long list of devices: sRGB, DCDM, DCDM P3 gamut clip, P3-D60, P3-D60 ST2084 1000 nits, P3-D60 ST2084 2000 nits, P3-D60 ST2084 4000 nits, P3-DCI, Rec.2020, Rec.2020 ST2084 1000 nits, Rec.709, Rec.709 D60 sim., sRGB D60 sim., Raw, Log.
The general idea in LuxCore is to have multiple image pipelines with different OCIO settings: one to save on file in a generic color space, one for each display device you are using. This is done with the purpose to obtain the same output on different display devices.
All the tag (i.e. "lnf", "sRGB", "Film") are meaningful only in the context of a specific OCIO configuration, they are just arbitrary names corresponding to some kind of color space transformations defined in the configuration file. I think I used Sony VFX configuration in my example above.
I have been playing with OCIO using filmic OCIO configuration for a while(i copy the filmic config from blender directly)
I also find it pretty difficult to tell if the new OCIO config has been correctly applied. Do you have any suggestions on it?
Besides, I tried the optional config "look" from filmic, seems not working though. is there anything I did wrong? or is it because it's not implemented?
here is my code
ocio_src=Linear
ocio_display=sRGB
ocio_view=Filmic
ocio_look=High Contrast
any suggestion would be appreciated!
- richardbao
- Posts: 17
- Joined: Tue Mar 09, 2021 7:47 am
Re: Color spaces support (aka OpenColorIO v2.0)
Yes, I am testing on our own DCC, so the file format is not the same though.
I think the LuxCore has been implemented the same with cycle, the only difference is cycle enabled "looks" in the filmic OCIO config, which really makes the filmic pop.
here is the look config in the filmic ocio configuration.
Code: Select all
looks:
- !<Look>
name: Very High Contrast
process_space: Filmic Log
transform: !<GroupTransform>
children:
- !<FileTransform> {src: filmic_to_1.20_1-00.spi1d, interpolation: linear}
- !<FileTransform> {src: filmic_to_0-70_1-03.spi1d, interpolation: linear, direction: inverse}
- !<Look>
name: High Contrast
process_space: Filmic Log
transform: !<GroupTransform>
children:
- !<FileTransform> {src: filmic_to_0.99_1-0075.spi1d, interpolation: linear}
- !<FileTransform> {src: filmic_to_0-70_1-03.spi1d, interpolation: linear, direction: inverse}
- !<Look>
name: Medium High Contrast
process_space: Filmic Log
transform: !<GroupTransform>
children:
- !<FileTransform> {src: filmic_to_0-85_1-011.spi1d, interpolation: best}
- !<FileTransform> {src: filmic_to_0-70_1-03.spi1d, interpolation: linear, direction: inverse}
- !<Look>
name: Medium Contrast
process_space: Filmic Log
transform: !<GroupTransform>
children:
- !<Look>
name: Medium Low Contrast
process_space: Filmic Log
transform: !<GroupTransform>
children:
- !<FileTransform> {src: filmic_to_0-60_1-04.spi1d, interpolation: linear}
- !<FileTransform> {src: filmic_to_0-70_1-03.spi1d, interpolation: linear, direction: inverse}
- !<Look>
name: Low Contrast
process_space: Filmic Log
transform: !<GroupTransform>
children:
- !<FileTransform> {src: filmic_to_0-48_1-09.spi1d, interpolation: linear}
- !<FileTransform> {src: filmic_to_0-70_1-03.spi1d, interpolation: linear, direction: inverse}
- !<Look>
name: Very Low Contrast
process_space: Filmic Log
transform: !<GroupTransform>
children:
- !<FileTransform> {src: filmic_to_0-35_1-30.spi1d, interpolation: linear}
- !<FileTransform> {src: filmic_to_0-70_1-03.spi1d, interpolation: linear, direction: inverse}
here are all the different looks that the filmic config offers this is the direct output using filmic with no look here is a demo of using filmic with "high contrast" look
As you can see, the "looks" really make filmic looks more pleasent depending on different result.
So, do we have "looks" implemented already? or will we?
Re: Color spaces support (aka OpenColorIO v2.0)
I'm trying to do a quick implementation for OCIO in 3dsmax and blender and i want to know if i get the idea correctly.
Here is what i have in mind.
Add color space rollout In the camera option section below the LUT. Add color space node in the material editor, so it can be used for textures and other nodes. I'm not sure if this is a good approach so i will appreciate any suggestions here.
Here is what i have in mind.
Add color space rollout In the camera option section below the LUT. Add color space node in the material editor, so it can be used for textures and other nodes. I'm not sure if this is a good approach so i will appreciate any suggestions here.
Omid Ghotbi (TAO)
Last update information
viewtopic.php?p=34390#p34390
My Artstation https://www.artstation.com/omidghotbi
My Instagram https://www.instagram.com/omid.ghotbi
Last update information
viewtopic.php?p=34390#p34390
My Artstation https://www.artstation.com/omidghotbi
My Instagram https://www.instagram.com/omid.ghotbi
Re: Color spaces support (aka OpenColorIO v2.0)
OCIO "Looks" are something similar to a macro: you can get the same result by using/chaining other OCIO tools. However it can get quite complicated so I'm adding the direct support for looks.