colors are additive...


I got a discret problem, where I can’t find a solution for.

I just tired to render a simple swapchain. Just made it visible that the swpachain works by pushing constant values into the renderpass.

But I noticed then my colors are additive and not subtractive.

Just can’t work with this color sheme. Could someone tell me please where to fix it?

The structurename or helping links to read about that would be very nice.

I’m less or more lost.

Thank you very much in advance!

It’s traditional. LCD displays being considered additive color devices themselves (black when off).

RGB to CMY conversion formulas
CMY to RGB conversion formulas

Might differ a bit. The RGB might be [0…1] too.

ok, that makes sense. Thank you!

Hello Users,

I found out the reason for my problem.

The mistake happened in the structure: VkSwapchainCreateInfoKHR

This structure contains two parmaters named: imageFormat and imageColorSpace

I had two situations:

  1. imageFormat = VK_FORMAT_B8G8R8A8_UNORM / imageColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR
    -> result: CMY output

  2. imageFormat = VK_FORMAT_B8G8R8A8_SRGB / imageColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR
    -> result: RGBA output

Little difference. Much effect.

Thank’s for listening. Good luck on your projects :wink:

I relay you to wikipedia or whatnot but:

primary colors are a chosen set of colors which create a color space. You can identify a color in the color space by assigning value for mixing to each of the primary colors (components).
Commonly chosen primary colors are [Red, Green, Blue] (RGB – loosely tied to how human eye cone cells work) or [Cyan, Magenta, Yellow] (CMY).
Primary colors may be imaginary/abstract e.g. [Hue, Saturation, Value] (HSV).

Additive (vs subtractive) is how we mix the primary colors.
Additive starts with black, then you add colors (increase the component values). If you max all the values you end up with white. This is how LCD screens work.
Subtractive starts with white; increasing component value means subtracting colors from the white. If you max all the values, you effectively substract all the color and so end up with black. This is how printers work.

This thread in the end doesn’t seem to be about additive vs subtractive colors. AFAIK Vulkan only specifies (additive) RGB color space for swapchain output (and if you want to work with different color spaces you need to perform conversion prior that point). There seem to be some coding mistake.