vurtun / nuklear

A single-header ANSI C gui library
13.67k stars 1.11k forks source link

[Bug] Weird color issue on D3D11 (only on specific targets) #708

Open koemeet opened 6 years ago

koemeet commented 6 years ago

On some d3d11 targets, when I use Nuklear, the colors seem to be a lot more light than they should be. Here an example of the issue I am trying to explain. I ran the same nuklear code on two different d3d11 targets:

Colors used (in order of the squares): rgb(28, 30, 37) rgb(255, 0, 0) rgb(255, 0, 255) rgb(255, 0, 100) rgb(100, 0, 100)

afbeelding

As you can see the last application displays the colors as they should be. But the first d3d11 target seems to make the ending colors way more light than they are in reality. The initial setup of both d3d11 swapchain etc. are different, which is also likely where the issue lies.

It is good to know that the first application is an already existing d3d11 program, which I hook into to provide a GUI on top of this application. Knowing this, what could cause this issue on d3d11?

This is how the demo window looks like on the failing d3d11 target (as you can see its way way to light than it should be): afbeelding

YukinoHayakawa commented 5 years ago

Looks like your application is treating the colors from nuklear as sRGB and trying to convert it to linear RGB.