Inverting a 3D LUT


Doug Walker
 

> How is this overridden with an environment variable?

 

Check out OCIO_OPTIMIZATION_FLAGS_ENVVAR in OpenColorTypes.h.

 

> If I do getDefaultCPUProcessor(), it's always the same as getOptimizedCPUProcessor(OPTIMIZATION_DEFAULT).

 

Yes, that is expected.  But if that env var was set, both of those would be overridden by the env var.

 

Doug



 


Brendan Bolles
 

On Mon, May 11, 2020 at 03:02 PM, Doug Walker wrote:
But note that (as with a number of other OCIO features) it is also possible for users to override the optimization setting via an environment variable.  So even if apps don't provide a UI, that may provide an alternative for power users.
How is this overridden with an environment variable? If I do getDefaultCPUProcessor(), it's always the same as getOptimizedCPUProcessor(OPTIMIZATION_DEFAULT).

Brendan


Doug Walker
 

>I guess there have been some changes in this area. So I take it OPTIMIZATION_LUT_INV_FAST has now taken

> taken the place of not using FINALIZATION_EXACT. And the exact mode is used if you don't include the flag?

Yes, the finalization options were merged into the optimization options since there was so much overlap.

 

And yes, the exact mode is used if that bit of the optimization settings is zero.

 

But just to be clear for others, the default settting (OPTIMIZATION_DEFAULT) does include OPTIMIZATION_LUT_INV_FAST, so the exact mode is actually not the default.  (This was the preference of the group when it was discussed at one of the v2 working group meetings.)


> What sort of UI for this quality stuff are we expecting to present to the user?

> ... should OCIO apps now give a general Draft/Best option for all OCIO operations?

 

It's a good question Brendan.  For now, there is no guidance and it is up to the apps to decide if the feature is useful for their users or not.  In my opinion, OPTIMIZATION_DEFAULT will cover the vast majority of use-cases.  So my view is that the UI for "average users" should not present this as an option as it will likely cause needless worry and confusion.

 

But note that (as with a number of other OCIO features) it is also possible for users to override the optimization setting via an environment variable.  So even if apps don't provide a UI, that may provide an alternative for power users.

 

It might be useful to work on some user interface guidelines that could cover topics like this.  If anyone is interested in helping draft something like that, please reach out to me or another TSC member.

 

Doug

 


Brendan Bolles
 

I guess there have been some changes in this area. So I take it OPTIMIZATION_LUT_INV_FAST has now taken taken the place of not using FINALIZATION_EXACT. And the exact mode is used if you don't include the flag?

What sort of UI for this quality stuff are we expecting to present to the user? I see that OPTIMIZATION_DEFAULT = OPTIMIZATION_VERY_GOOD, which includes OPTIMIZATION_LUT_INV_FAST. And there's OPTIMIZATION_LOSSLESS, which does not and has other flags as well.

I currently provide a back door to doing the exact LUT invert, but should OCIO apps now give a general Draft/Best option for all OCIO operations?


Brendan


Patrick Hodoul
 

Hi Brendan,

The pull request is now alive (refer to 769).

To select the 'fast' or 'exact' mode, there is an enumeration 'FinalizationFlags' (in 'include/OpenColorIO/OpenColorTypes.h') used by the method 'Processor::getOptmizedCPUProcessor()' (in 'include/OpenColorIO/openColorIO.h').

Please let me know if you have any questions.

Regards,
Patrick


Brendan Bolles
 

Ahh, OK, thanks for the info, Doug.

I guess I'll be submitting another pull request soon to get my v2 plug-ins in there.


Doug Walker
 

Hi Brendan,

 

Thanks, glad you like it!   Your understanding of Fast vs. Exact is correct. 

 

Regarding the ability to control this from the public API, we have a PR in progress that will allow you to do that.  We discussed this during the April OCIO v2 working group Zoom meeting (let me know if you'd like to join the v2 working group), but in summary the fast/exact control will be one of the "finalization" options that may be controlled from the public API.  There will also be more control provided over the "optimization" options which control to what degree consecutive ops are merged, etc.  Patrick will be posting a PR for review in another week or so.

 

(BTW, you had asked last week about the Photoshop/AE plugin bullet point from last year's SIGGRAPH presentation.  I was hoping someone else might jump in on that, but I'm guessing that it was referring to your PR 514, not sure what else it would have been referring to.)

 

best,

 

Doug

 

From: <ocio-dev@...> on behalf of "brendan@..." <brendan@...>
Reply-To: "ocio-dev@..." <ocio-dev@...>
Date: Monday, May 20, 2019 at 2:25 PM
To: "ocio-dev@..." <ocio-dev@...>
Subject: [ocio-dev] Inverting a 3D LUT

 

I see that v2 has the ability to invert 3D LUTs, very cool!

I also see that you can use Fast or Exact mode for rendering. I guess Fast mode samples a new inverted 3D LUT and renders from that, while Exact mode runs the inversion on each pixel? In my tests I couldn't tell the difference visually.

I don't see a place in the public API to set LutInversionQuality though…

_._,_._,_


Brendan Bolles
 

I see that v2 has the ability to invert 3D LUTs, very cool!

I also see that you can use Fast or Exact mode for rendering. I guess Fast mode samples a new inverted 3D LUT and renders from that, while Exact mode runs the inversion on each pixel? In my tests I couldn't tell the difference visually.

I don't see a place in the public API to set LutInversionQuality though…