Commit 18a1fbb6 authored by Felix-León Schröder's avatar Felix-León Schröder

Merge branch 'presentation' into 'master'

Little fixes in the presentation branch

See merge request CVFP_DF18/Framework!20
parents 44de5429 480394ab
......@@ -64,5 +64,5 @@
"shadowType": 2
}
],
"skyBoxPath": "../resources\\textures/spruit_sunrise_8k.hdr/hdr/"
"skyBoxPath": "D:\\BenediktKraus\\Framework\\resources\\textures\\indoor"
}
\ No newline at end of file
......@@ -747,6 +747,30 @@ void Editor::drawRenderingTab()
ImGui::EndPopup();
}
ImGui::Spring();
ImGui::SameLine();
if(ImGui::Button(ICON_MDI_CLOUD_SYNC " Load SkyBox"))
{
const std::filesystem::path p = "./../resources/textures/";
auto native = absolute(p).make_preferred();
const char* folderPath = tinyfd_selectFolderDialog("Load Skybox", native.string().c_str());
if(folderPath)
{
auto filename =
std::filesystem::path(*(std::filesystem::directory_iterator(folderPath)));
if(m_renderer->getSkyBox().generateCubeMap(folderPath, filename.extension().string()))
{
m_renderer->getSkyBox().getTexture().bind(5);
m_renderer->getSkyBox().setFolderPath(folderPath);
}
else
{
tinyfd_notifyPopup("Load SkyBox",
"Selected files cannot be parsed as a valid SkyBox.",
"error");
}
}
}
ImGui::EndHorizontal();
// Render + dragging
......@@ -1425,6 +1449,8 @@ void Editor::loadScene()
light = light->deserialize(l);
m_renderer->addLight(light);
}
for(const auto& p : m_renderer->getLights())
m_allLightIds.push_back(p.first);
std::string folderPath = j["skyBoxPath"];
if(folderPath.c_str())
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment