This commit is contained in:
Бранимир Караџић 2019-01-14 19:08:49 -08:00
parent d7659423fe
commit 0df9a005fa
2 changed files with 29 additions and 56 deletions

View File

@ -528,19 +528,21 @@ public:
ImGui::Checkbox("IBL Diffuse", &m_settings.m_doDiffuseIbl); ImGui::Checkbox("IBL Diffuse", &m_settings.m_doDiffuseIbl);
ImGui::Checkbox("IBL Specular", &m_settings.m_doSpecularIbl); ImGui::Checkbox("IBL Specular", &m_settings.m_doSpecularIbl);
if (ImGui::BeginTabBar("Cubemap", ImGuiTabBarFlags_None) )
{ {
float tabWidth = ImGui::GetContentRegionAvailWidth() / 2.0f; if (ImGui::BeginTabItem("Bolonga") )
if (ImGui::TabButton("Bolonga", tabWidth, m_currentLightProbe == LightProbe::Bolonga) )
{ {
m_currentLightProbe = LightProbe::Bolonga; m_currentLightProbe = LightProbe::Bolonga;
ImGui::EndTabItem();
} }
ImGui::SameLine(0.0f,0.0f); if (ImGui::BeginTabItem("Kyoto") )
if (ImGui::TabButton("Kyoto", tabWidth, m_currentLightProbe == LightProbe::Kyoto) )
{ {
m_currentLightProbe = LightProbe::Kyoto; m_currentLightProbe = LightProbe::Kyoto;
ImGui::EndTabItem();
} }
ImGui::EndTabBar();
} }
ImGui::SliderFloat("Texture LOD", &m_settings.m_lod, 0.0f, 10.1f); ImGui::SliderFloat("Texture LOD", &m_settings.m_lod, 0.0f, 10.1f);
@ -579,41 +581,33 @@ public:
selection = UINT8_C(1); selection = UINT8_C(1);
} }
float tabWidth = ImGui::GetContentRegionAvailWidth() / 3.0f; if (ImGui::BeginTabBar("CubemapSelection", ImGuiTabBarFlags_None) )
if (ImGui::TabButton("Skybox", tabWidth, selection == 0) )
{ {
selection = 0; if (ImGui::BeginTabItem("Radiance") )
} {
selection = 1;
m_settings.m_bgType = 7.0f;
ImGui::SameLine(0.0f,0.0f); ImGui::SliderFloat("Mip level", &m_settings.m_radianceSlider, 1.0f, 6.0f);
if (ImGui::TabButton("Radiance", tabWidth, selection == 1) )
{
selection = 1;
}
ImGui::SameLine(0.0f,0.0f); ImGui::EndTabItem();
if (ImGui::TabButton("Irradiance", tabWidth, selection == 2) ) }
{
selection = 2;
}
if (0 == selection) if (ImGui::BeginTabItem("Irradiance") )
{ {
m_settings.m_bgType = 0.0f; selection = 2;
} m_settings.m_bgType = m_settings.m_radianceSlider;
else if (2 == selection) ImGui::EndTabItem();
{ }
m_settings.m_bgType = 7.0f;
}
else
{
m_settings.m_bgType = m_settings.m_radianceSlider;
}
const bool isRadiance = (selection == 1); if (ImGui::BeginTabItem("Skybox") )
if (isRadiance) {
{ selection = 0;
ImGui::SliderFloat("Mip level", &m_settings.m_radianceSlider, 1.0f, 6.0f); m_settings.m_bgType = 0.0f;
ImGui::EndTabItem();
}
ImGui::EndTabBar();
} }
} }
ImGui::Unindent(); ImGui::Unindent();

View File

@ -108,27 +108,6 @@ namespace ImGui
SetCursorPosY(GetCursorPosY() + GetTextLineHeightWithSpacing() ); SetCursorPosY(GetCursorPosY() + GetTextLineHeightWithSpacing() );
} }
inline bool TabButton(const char* _text, float _width, bool _active)
{
int32_t count = 1;
if (_active)
{
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1.0f, 0.75f, 0.0f, 0.78f) );
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.0f, 0.0f, 0.0f, 1.0f ) );
count = 2;
}
else
{
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.5f, 0.5f, 0.5f, 0.7f) );
}
bool retval = ImGui::Button(_text, ImVec2(_width, 20.0f) );
ImGui::PopStyleColor(count);
return retval;
}
inline bool MouseOverArea() inline bool MouseOverArea()
{ {
return false return false