Page MenuHome

Add fast linear light -> srgb conversion path
Closed, ArchivedPublicPATCH

Description

Hi,

Rendering in the interface is currently slowed down quiet a lot by conversions
from linear to srgb (if color management is enabled).

The attached patch implements a LUT to speed it up.

Rendering the default cube in 4096x2048 took 8.4sec before the patch
and 3.3sec afterwards.

till then, David.

Event Timeline

Updated patch moves dithering logic into math_color.c

This simplifies render_internal.c, while exposing more
conversion functions in math_color.h.

I think this is fantastic. However, given the migration path to OCIO I'd love to see this done without the hard coded sRGB LUT.

Is it possible you have the ability to contribute to the OCIO migration David? Xavier was working on a branch at GitHub. Most of the infrastructure is in place already.

https://github.com/thmxv/blender-ocio

When/If OCIO is integrated all this would need to be replaced anyway. I agree, that would be nice but I also feel that it would be a
much larger project. This patch, as it stands, is rather simple and I think would be of great value for the meantime.

I haven't yet taken a closer look at that branch, so I might be overestimating the complexity of integrating OCIO.
I will look at it soon to see if I can help out in some way.

Attached updated patch for current trunk.

I am wondering if it might be possible to use a real LUT here to control chromacity in addition to simply gamma. It would allow one to use a properly calibrated display at D65 and get correct white at D50.

Patch committed, thanks!

Did some minor code style changes, and fixed one issue with variable "initialized" not being initialized to 0.

Brecht Van Lommel (brecht) changed the task status from Unknown Status to Unknown Status.Jan 8 2012, 2:57 PM