Skip to content

Commit

Permalink
UPBGE: Fix background color according to color management settings
Browse files Browse the repository at this point in the history
  • Loading branch information
youle31 committed Aug 3, 2017
1 parent d331ff8 commit e8dab53
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions source/gameengine/Ketsji/KX_WorldInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,14 @@ void KX_WorldInfo::RenderBackground(RAS_Rasterizer *rasty)
GPU_material_unbind(gpumat);
}
else {
float srgbcolor[4];
linearrgb_to_srgb_v4(srgbcolor, m_horizoncolor.getValue());
rasty->SetClearColor(srgbcolor[0], srgbcolor[1], srgbcolor[2], srgbcolor[3]);
if (m_do_color_management) {
float srgbcolor[4];
linearrgb_to_srgb_v4(srgbcolor, m_horizoncolor.getValue());
rasty->SetClearColor(srgbcolor[0], srgbcolor[1], srgbcolor[2], srgbcolor[3]);
}
else {
rasty->SetClearColor(m_horizoncolor[0], m_horizoncolor[1], m_horizoncolor[2], m_horizoncolor[3]);
}
rasty->Clear(RAS_Rasterizer::RAS_COLOR_BUFFER_BIT);
}
}
Expand Down

0 comments on commit e8dab53

Please sign in to comment.