alus21
alus21

Reputation: 9

Alpha compositing with imgui and directx 11

I am currently learning Dear ImGui with Directx 11 and have run into some issues with understanding alpha compositing. The imgui example has a vec4 like this

ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 0.60f);

And a array like this

const float clear_color_with_alpha[4] = { clear_color.x * clear_color.w, clear_color.y * clear_color.w, clear_color.z * clear_color.w, clear_color.w };.

I understand the vec4 which is declaring the rgb intensity and alpha component opacity but how exactly does it work and why is clear_color_with_alpha multiplying the color by the alpha component when we clearly pass it into the array so functions can use it. All I can think of is when we multiply this by the alpha component it just lowers the intensity of the color its multiplying by.

I have tried looking on forums online but couldn't find anything related to imgui and directx 11, then tried asking a ai but it just gave me a different answer every time.

Upvotes: 0

Views: 107

Answers (0)

Related Questions