Why Vulkan demo color is diffrent from opengl?
vinsentli opened this issue · 3 comments
more info: @corporateshark
if i force the fragment shader ,use a alpha color , for example :
out_FragColor = vec4(1, 0, 0, 0.5);
and i open the blend mode:
graphicsDesc.targetDesc.colorAttachments[0].blendEnabled = true;
graphicsDesc.targetDesc.colorAttachments[0].srcRGBBlendFactor = igl::BlendFactor::One;
graphicsDesc.targetDesc.colorAttachments[0].srcAlphaBlendFactor = igl::BlendFactor::One;
graphicsDesc.targetDesc.colorAttachments[0].dstRGBBlendFactor = igl::BlendFactor::OneMinusSrcAlpha;
graphicsDesc.targetDesc.colorAttachments[0].dstAlphaBlendFactor = igl::BlendFactor::OneMinusSrcAlpha;
the cube color on vulkan is also different from opengl.
Should be fixed via 813589f.
Hi @vinsentli
so just to explain what this is:
igl::ColorSpace::PASS_THROUGH <-- on vulkan this will communicate with the OS color management to tell it your incoming color space (usually sRGB) and the color management will take care of converting the data from sRGB->Your Display
This feature doesn't seem to exist on OpenGL so using PASS_THROUGH bypasses the color management and pretty much acts like OpenGL which gives them both parity in theiry color output.
On Metal, we've had to do this to achieve the same thing: https://github.com/facebook/igl/blob/main/shell/mac/ViewController.mm#L187
If this doesn't help you, please let me know how you go about running the demo (I'm not very familiar with the open source version) and I'll try to reproduce and see where things aren't the same.