Hi guys. We have make working ACES with Luxcore, so I want to summarize what we have discovered. Maybe it will be helpful for someone.
So we want to make Luxcore work in ACEScg color space. All input color data have to be converted to ACEScg, and than the output has to be converted back to sRGB or some other color space that we like.
Most of the textures that you have (png, jpg, tiff etc) are saved in sRGB color spaces. So you have to convert them from sRGB to ACEScg. For that we use transformation celled: Utility - sRGB - Texture
Code: Select all
scene.textures._61_basecolor.type = "imagemap"
scene.textures._61_basecolor.file = "/mnt/nodeHDD1/cache/Texture/576/17264.jpg"
scene.textures._61_basecolor.mapping.type = "uvmapping2d"
scene.textures._61_basecolor.mapping.rotation = 0
scene.textures._61_basecolor.gamma = 1 //I think this is irrelevant
scene.textures._61_basecolor.mapping.uvscale = 1 1
scene.textures._61_basecolor.colorspace = "opencolorio"
scene.textures._61_basecolor.colorspace.config = "your_path_to_aces/OpenColorIO-Config-ACES-1.2/aces_1.2/config.ocio"
scene.textures._61_basecolor.colorspace.name = "Utility - sRGB - Texture"
If you want a pure color, remember to convert it too:
Code: Select all
scene.materials.79121_100.basecolor = "opencolorio" "your_path_to_aces/OpenColorIO-Config-ACES-1.2/aces_1.2/config.ocio" "Utility - sRGB - Texture" 0.8588235 0.8588235 0.8588235
When you want to import some texture that is not used as color texture but as normalmap, bump etc, we don't want to convert it, as it contains numerical data rather then color. So we have to use Utility - RAW transformation:
Code: Select all
scene.textures._61_bump01_texture1.type = "imagemap"
scene.textures._61_bump01_texture1.file = "/mnt/nodeHDD1/cache/Texture/576/17264.jpg"
scene.textures._61_bump01_texture1.mapping.type = "uvmapping2d"
scene.textures._61_bump01_texture1.mapping.rotation = 0
scene.textures._61_bump01_texture1.gamma = 1
scene.textures._61_bump01_texture1.mapping.uvscale = 1 1
scene.textures._61_bump01_texture1.colorspace = "opencolorio"
scene.textures._61_bump01_texture1.colorspace.config = "your_path_to_aces/OpenColorIO-Config-ACES-1.2/aces_1.2/config.ocio"
scene.textures._61_bump01_texture1.colorspace.name = "Utility - Raw"
At the end we want to output our render so we have to convert it back from ACEScg to sRGB (or other if you want). In case of png or jpg:
Code: Select all
film.imagepipelines.0.0.type = "NOP"
film.imagepipelines.0.1.type = "NOP"
film.imagepipelines.0.2.type = "TONEMAP_LUXLINEAR"
film.imagepipelines.0.2.sensitivity = "100"
film.imagepipelines.0.2.exposure = 0.0025
film.imagepipelines.0.2.fstop = 4
film.imagepipelines.0.8.type = "TONEMAP_OPENCOLORIO"
film.imagepipelines.0.8.mode = "DISPLAY_CONVERSION"
film.imagepipelines.0.8.config = "your_path_to_aces\OpenColorIO-Config-ACES-1.2\aces_1.2\config.ocio"
film.imagepipelines.0.8.src = "ACEScg"
film.imagepipelines.0.8.display = "ACES"
film.imagepipelines.0.8.view = "sRGB"
film.outputs.0.type = "RGB_IMAGEPIPELINE"
film.outputs.0.filename = "out.png"
film.outputs.0.index = 0
It is much more complicated when you want to output exr. The problem with exr is, that it contains linear color space, so to be visualized you have to apply some transformation. If you open exr with Phothshop it applies his own transformation. So you have two possibilities. First solution is to save simply RAW ACEScg and than import ACES ocio file to PS and tell PS to apply correct color space when opening file.
Second solution is to convert ACEScg linear color space to classic linear color space. In this solution (that is better in my case) user does not have to modify anything in PS. To obtain this, you have to apply two transformations. I have found this thanks to this viedeo:
https://www.youtube.com/watch?v=dksSrFWxLr4 (watch whole video as he is showing 2 possibilities and the second one is helpful)
Code: Select all
film.imagepipelines.1.0.type = "NOP"
film.imagepipelines.1.1.type = "NOP"
film.imagepipelines.1.2.type = "TONEMAP_LUXLINEAR"
film.imagepipelines.1.2.sensitivity = "100"
film.imagepipelines.1.2.exposure = 0.0025
film.imagepipelines.1.2.fstop = 4
film.imagepipelines.1.3.type = "TONEMAP_OPENCOLORIO"
film.imagepipelines.1.3.mode = "COLORSPACE_CONVERSION"
film.imagepipelines.1.3.config = "your_path_to_aces\OpenColorIO-Config-ACES-1.2\aces_1.2\config.ocio"
film.imagepipelines.1.3.src = "ACEScg"
film.imagepipelines.1.3.dst = "Output - sRGB"
film.imagepipelines.1.4.type = "TONEMAP_OPENCOLORIO"
film.imagepipelines.1.4.mode = "COLORSPACE_CONVERSION"
film.imagepipelines.1.4.config = "your_path_to_aces\OpenColorIO-Config-ACES-1.2\aces_1.2\config.ocio"
film.imagepipelines.1.4.src = "Utility - sRGB - Texture"
film.imagepipelines.1.4.dst = "Utility - Linear - sRGB"
film.outputs.4.type = "RGB_IMAGEPIPELINE"
film.outputs.4.filename = "2_conversions.exr"
film.outputs.4.index = 1
I still have some problems with HDRI background.
In ACES docummentation I have found that we should use "Output - sRGB" conversion. But this works only for png etc. This is logical as they are saved in sRGB color space. But what about exr? Somebody could help me with this. We are currently using "Utility - Linear - sRGB" but I'm not sure if it is correct.
Code: Select all
scene.lights.92450_BACKGROUND.gain = 16000 16000 16000
scene.lights.92450_BACKGROUND.transformation = -0.8660256 -0.4999998 0 0 -0.4999998 0.8660256 0 0 0 0 1 0 0 0 0 1
scene.lights.92450_BACKGROUND.id = 0
scene.lights.92450_BACKGROUND.temperature = -1
scene.lights.92450_BACKGROUND.temperature.normalize = 0
scene.lights.92450_BACKGROUND.visibility.indirect.diffuse.enable = 1
scene.lights.92450_BACKGROUND.visibility.indirect.glossy.enable = 1
scene.lights.92450_BACKGROUND.visibility.indirect.specular.enable = 1
scene.lights.92450_BACKGROUND.type = "infinite"
scene.lights.92450_BACKGROUND.file = "imagemap-00001.exr"
scene.lights.92450_BACKGROUND.colorspace = "opencolorio"
scene.lights.92450_BACKGROUND.colorspace.config = "your_path_to_aces/OpenColorIO-Config-ACES-1.2/aces_1.2/config.ocio"
scene.lights.92450_BACKGROUND.colorspace.name = "Utility - Linear - sRGB"
scene.lights.92450_BACKGROUND.storage = "float"
scene.lights.92450_BACKGROUND.gamma = 1
scene.lights.92450_BACKGROUND.sampleupperhemisphereonly = 0
scene.lights.92450_BACKGROUND.visibilitymapcache.enable = 0
Last thing. If you want to save the scene that is already in luxcore memory, don't worry when you find everywhere colorspace = "nop". This is because luxcore applies all cororspace conversion, ad if you open textures saved by luxcore, you will noticed, that they are in ACEScg color space.
Hope that this will be helpful for someone.