Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align RGB to grayscale luminance with Blender #2501

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

MoritzBrueckner
Copy link
Collaborator

Fixes #2467.

To convert RGB values to grayscale, Armory used different luma coefficients than Blender which could lead to visible differences between Armory and Blender materials. I wasn't exactly sure where the values come from, so I did some research:

Both sets of coefficients seem to be widely used (Rec. 601 for example is used in some OpenCV and matlab functions), but I guess it only makes sense to use the same in both cases.

Fixes armory3d#2467

To convert RGB values to grayscale, Armory used different luma coefficients than Blender which could lead to visible differences between Armory and Blender materials. I wasn't exactly sure where the values come from, so I did some research:

- Previously, Armory used approximations of values from Rec. 601 (Rec. ITU-R BT.601-7 Section 2.5.1). Similar values (but not the same) were used in older Blender versions (see [this commit](blender/blender@49247f0#diff-577a4d894f44ce57f77a4988305f510e77a95edee5b044c3802a4a9e953cf559L746)).
- Blender uses the [default coefficients from OpenColorIO](https://opencolorio.readthedocs.io/en/latest/guides/authoring/authoring.html#luma) (see https://blender.stackexchange.com/a/112554/58208) which are based on Rec. 709 (Rec. ITU-R BT.709-6 Item 3.3). See [Blender source](https://github.com/blender/blender/blob/594f47ecd2d5367ca936cf6fc6ec8168c2b360d0/source/blender/gpu/shaders/material/gpu_shader_material_rgb_to_bw.glsl).

Both sets of coefficients seem to be widely used (Rec. 601 for example is used in some OpenCV and matlab functions), but I guess it only makes sense to use the same in both cases.
@MoritzBrueckner MoritzBrueckner added the Release Notes: Fixes A pull request that fixes something. Used to generate release notes. label Jun 7, 2022
@luboslenco luboslenco merged commit a1ef22d into armory3d:master Jun 8, 2022
@MoritzBrueckner MoritzBrueckner deleted the fix-rgbtobw branch June 8, 2022 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Notes: Fixes A pull request that fixes something. Used to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Armory Flips RGB channel when using Geometry Node in combination with color ramp
2 participants