Commit graph

16 commits

Author SHA1 Message Date
Brecht Van Lommel
9183a22fa1 Fix: Cycles: Wrong handling of builtin sRGB colorspaces in standalone
This only affects Cycles standalone, as Blender does not use the auto
colorspace. The matrix multiplication order was inverted and decoding
from sRGB was not implemented properly.

Issue introduced in ca4458f6ea.

Pull Request: https://projects.blender.org/blender/blender/pulls/164212
2026-09-21 22:04:37 +02:00
Brecht Van Lommel
c1d9321304 Fix: Cycles: Linear Rec.709 not detected as scene linear interop ID
This mainly affected precision and performance, as far as I can tell
there was no significant impact on e.g. the texture cache or OSL.

Now Cycles uses the same matrix as Blender (transposed), which was
created from dumping the OpenColorIO matrix so it matches exactly.

Thanks to Sergey for finding this.

Pull Request: https://projects.blender.org/blender/blender/pulls/164197
2026-09-21 15:55:20 +02:00
Brecht Van Lommel
d7746e3300 Color Management: Runtime OpenColorIO config switching
Add core mechanism for switching the active OpenColorIO configuration at
runtime. This will make it possible to add a per project config.

The main difficulty is that ImBuf stores raw ColorSpace pointers
into the active configuration's color space objects. Scene datablocks
store color space names and can be re-resolved, but some data structures
(icons, previews, thumbnails, brush textures) outlive blend files.

The solution is to switch the configuration in-place, and retain color
spaces from previous configs but hide them in the UI.

Ref #163048

Pull Request: https://projects.blender.org/blender/blender/pulls/162196
2026-09-21 12:09:52 +02:00
Brecht Van Lommel
fb5493cacf Fix: Cycles: Mistakes in backwards compatibility for OpenColorIO 2.2
Properly handle missing default colorspaces and use case insensitive
alias comparison to match OpenColorIO.

Issues introduced in 1f55c8eb5c.

Pull Request: https://projects.blender.org/blender/blender/pulls/162433
2026-08-07 13:33:07 +02:00
Sebastian Herholz
1f55c8eb5c Cycles: Making Cycles build against a older OIIO and OpenColorIO versions 2026-08-04 17:41:26 +02:00
Brecht Van Lommel
274afa5e36 Fix: Cycles: Build error without OpenColorIO
Not a required dependency for Cycles standalone yet, even if it is for
Blender.

This issue was introduced in 5d2b8f8a52.

Pull Request: https://projects.blender.org/blender/blender/pulls/159666
2026-06-16 16:24:46 +02:00
Brecht Van Lommel
ec0d32541e Cleanup: Cycles: Avoid potentially dangling XYZ-to-scene-linear reference
It's not really possible in practice for OpenColorIO configs to switch
mid render, but better not to return a reference to something that is
mutex protected.

This issue was introduced in 5d2b8f8a52.

Pull Request: https://projects.blender.org/blender/blender/pulls/159666
2026-06-16 16:24:46 +02:00
Brecht Van Lommel
5d2b8f8a52 Fix #159311: Cycles texture cache issues with different working spaces
The colorspace from the tx file was not properly used, which caused some
wrong colorspace conversions when using working spaces other than Linear
Rec.709.

Pull Request: https://projects.blender.org/blender/blender/pulls/159543
2026-06-04 23:38:56 +02:00
Brecht Van Lommel
512487804e Cleanup: Demote some colorspace messages from info to debug
This is more an implementation detail than important info and
pollutes the texture cache generate logging.

Pull Request: https://projects.blender.org/blender/blender/pulls/158872
2026-05-27 14:48:10 +02:00
Campbell Barton
4df665a2fd Cleanup: blank space around C-style comments
Either use no spaces (common for disabled arguments) `/*arg*/`
or spaces `/* Regular comment. */`

Cleanup lop-sided comments such as `/* X*/` or `/*X */`.

Also use doxy-sections for bmesh_structure.hh,
the ad-hoc section comments had become outdated.

Ref !158467
2026-05-12 16:42:20 +10:00
Brecht Van Lommel
482a0b77ab Cleanup: Fix various clang-tidy warnings
./tools/utils_maintenance/clang_tidy.py fix --config safe intern source

Pull Request: https://projects.blender.org/blender/blender/pulls/157465
2026-04-16 22:03:51 +02:00
Brecht Van Lommel
db9060b4d3 Cycles: Stop using OpenImageIO texture cache for OSL
This will be replaced by the texture cache. Advanced OpenImageIO features
will no longer be available, and texture filtering results will be different.
But performance will be better and there will be consistency with SVM.

OSL specifc image tests were removed as these now match SVM exactly and are
tested by WITH_CYCLES_TEST_OSL.

Pull Request: https://projects.blender.org/blender/blender/pulls/154913
2026-03-27 16:07:05 +01:00
Brecht Van Lommel
680e48669c Fix: Cycles colorspace_interop_id wrong check for unknown colorspace
Did not cause any bugs with current Blender usage.
2026-02-10 17:27:25 +01:00
Brecht Van Lommel
f3c9684fdd Cycles: Automatically guess colorspace based on OpenImageIO and OpenColorIO
For Blender integration we get the colorspace from Blender and this code is not
used. But for standalone this now makes use of interop ID and roles in recent
OpenImageIO and OpenColorIO versions, and fixes some bad guesses.

Pull Request: https://projects.blender.org/blender/blender/pulls/154050
2026-02-09 12:59:52 +01:00
Brecht Van Lommel
c9ee149390 Fix #153513: Cycles not detecting when scene linear color space changes
It would work correctly when rendering the first time, but when rendering
again after changing the workspace it would be wrong.

The code from efc8970015 got lost when merging into the cycles-tx branch,
this just restores it.

Pull Request: https://projects.blender.org/blender/blender/pulls/153565
2026-01-29 11:37:21 +01:00
Brecht Van Lommel
ca4458f6ea Refactor: Cycles: Colorspace changes to prepare for texture cache
* Move code into util/ module to be reused by tx generator.
* Move logic from ShaderManager into colorspace.cpp.
* Improve naming distinction between scene linear and data, and sRGB and
  scene linear compressed as sRGB.
* Use interop ID instead of enum for known scene linear color spaces.
* Support colorspace conversion on image buffers with arbitrary y stride.

Pull Request: https://projects.blender.org/blender/blender/pulls/152665
2026-01-14 17:57:45 +01:00