Added GBuffer

This commit is contained in:
antopilo
2021-08-31 23:27:19 -04:00
parent 1b916993e0
commit 54a138c044
19 changed files with 178 additions and 591 deletions

View File

@@ -131,17 +131,42 @@ namespace Nuake {
if (m_IsEntitySelected)
{
//if (ImGui::Begin("CSM"))
//{
// if (m_SelectedEntity.HasComponent<LightComponent>())
// {
// ImVec2 regionAvail = ImGui::GetContentRegionAvail();
// glm::vec2 viewportPanelSize = glm::vec2(regionAvail.x, regionAvail.y);
// Ref<Texture> texture = m_SelectedEntity.GetComponent<LightComponent>().m_Framebuffers[0]->GetTexture(GL_DEPTH_ATTACHMENT);
// ImGui::Image((void*)texture->GetID(), regionAvail, ImVec2(0, 1), ImVec2(1, 0));
// }
//}
//ImGui::End();
if (ImGui::Begin("GBUFFER"))
{
ImVec2 regionAvail = ImGui::GetContentRegionAvail();
glm::vec2 viewportPanelSize = glm::vec2(regionAvail.x, regionAvail.y);
Ref<Texture> texture = Engine::GetCurrentWindow()->GetGBuffer()->GetTexture(GL_DEPTH_ATTACHMENT);
ImGui::Image((void*)texture->GetID(), regionAvail, ImVec2(0, 1), ImVec2(1, 0));
}
ImGui::End();
if (ImGui::Begin("GBUFFER2"))
{
ImVec2 regionAvail = ImGui::GetContentRegionAvail();
glm::vec2 viewportPanelSize = glm::vec2(regionAvail.x, regionAvail.y);
Ref<Texture> texture = Engine::GetCurrentWindow()->GetGBuffer()->GetTexture(GL_COLOR_ATTACHMENT0);
ImGui::Image((void*)texture->GetID(), regionAvail, ImVec2(0, 1), ImVec2(1, 0));
}
ImGui::End();
if (ImGui::Begin("GBUFFER3"))
{
ImVec2 regionAvail = ImGui::GetContentRegionAvail();
glm::vec2 viewportPanelSize = glm::vec2(regionAvail.x, regionAvail.y);
Ref<Texture> texture = Engine::GetCurrentWindow()->GetGBuffer()->GetTexture(GL_COLOR_ATTACHMENT1);
ImGui::Image((void*)texture->GetID(), regionAvail, ImVec2(0, 1), ImVec2(1, 0));
}
ImGui::End();
if (ImGui::Begin("GBUFFER4"))
{
ImVec2 regionAvail = ImGui::GetContentRegionAvail();
glm::vec2 viewportPanelSize = glm::vec2(regionAvail.x, regionAvail.y);
Ref<Texture> texture = Engine::GetCurrentWindow()->GetGBuffer()->GetTexture(GL_COLOR_ATTACHMENT2);
ImGui::Image((void*)texture->GetID(), regionAvail, ImVec2(0, 1), ImVec2(1, 0));
}
ImGui::End();
//
//if (ImGui::Begin("CSM 2"))
//{