BlendLuxCore icon indicating copy to clipboard operation
BlendLuxCore copied to clipboard

Exposing OpenColorIO in Blendluxcore

Open EgertKanep opened this issue 10 months ago • 1 comments

EDIT. Some extra info. I worked with the default colormanagment that comes with Blender for this. Meaning by default Blender assumes rendered image in Linear Rec.709.

Here is my proposed plan how to expose the already existing OpenColorIO functionality in BlendLuxCore

  1. The benefit. I think it can be argued, that for casual users there is not much to gain and the target users have some specific need for it. In some cases simple reverse gamma might not be enough to properly handle textures.

  2. Adding use ocio.config to extension settings as a boolean toggle to use opencolorio and a path to config file.

Image

An example from Guerilla Render where user can select their ocio.config. It has more settings to choose from but we can ignore exposing those. Image

  1. Changes to imagemap node. If opencolorio is enabled from addon settings, the nodes could default to opencolorio mode. It gives user a dropdown to select from a variety of different input colorspaces. We should also remove the normalmap toggle and expose the dedicated normalmap node to streamline this workflow as well. It feels unintuitive to use the whole list of avaiable color transforms present se we could perhaps take a hint from https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES/releases

Image

Important ones to have are - ACEScg, Linear Rec.709 (sRGB), sRGB Encoded Rec.709 (sRGB), Data

Image

  1. Constant colors pose one question, but I feel like in the end users have to be vary of how it works. Currently whatever color is defined in constant color gets sent to LuxCore as it is and I don't think there should be any changes to that. Looking at the screenshot from Guerilla, there is a place for colorpicking colorspace and that can be relevant in some cases, but I think it is better to ignore in Blender.

Currently when you pick a color inside blender, what the colorpicker registers, gets sent to rgb values, When we define a colorpicker colorspace, it will apply additional conversion after registering the values. For example users pick a color 0.5 on all RGB and we assume that colorpicker should register values from Output-sRGB, the values get applied a reverse gamma. This is a problem inside blender as when you import an image, for example a texture for cloth and colorpick it, since blender's colormanagment already applied reverse gamma on this image, you would get double the amount.

When I inspect my texture in blender, which has been defined as sRGB texture, image editor color inspector (i inspect the white tile) shows me the original file value, before applying the conversion. When I colorpick it from LuxCore constant color I get a different value, which is the value I get when we remove the sRGB curve and make the image linear. So in reality we already end up with the correct value in our constant color.

Image

EgertKanep avatar Apr 03 '25 07:04 EgertKanep