Fixed normal TBN matrix

This commit is contained in:
antopilo
2025-01-04 21:39:46 -05:00
parent 1471c2849d
commit 3d5ad2e131
3 changed files with 68 additions and 11 deletions

View File

@@ -89,13 +89,15 @@ void MaterialEditor::Draw(Ref<Nuake::Material> material)
{
ImGui::BeginChild("##albedo", TexturePanelSize, true);
{
uint32_t textureID = 0;
ImTextureID textureID = 0;
if (material->HasAlbedo())
{
textureID = material->m_Albedo->GetID();
auto vkTexture = GPUResources::Get().GetTexture(material->AlbedoImage);
textureID = (ImTextureID)vkTexture->GetImGuiDescriptorSet();
}
if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#image1"), (void*)textureID, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1)))
if (ImGui::ImageButtonEx(ImGui::GetCurrentWindow()->GetID("#image1"), (ImTextureID)textureID, ImVec2(80, 80), ImVec2(0, 1), ImVec2(1, 0), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1)))
{
std::string texture = FileDialog::OpenFile("*.png | *.jpg");
if (texture != "")