Added full support for runtime editing of material properties #215

Merged
Pycorax merged 14 commits from SP3-1-MaterialEditSupport into main 2022-11-17 09:22:53 +08:00
1 changed files with 2 additions and 0 deletions
Showing only changes of commit b129a68680 - Show all commits

View File

@ -174,6 +174,7 @@ namespace SHADE
bool shaderChanged = false;
const auto* SHADER_INFO = SHAssetManager::GetData<SHShaderAsset>(currentMatSpec->fragShader);
const std::string SHADER_NAME = SHADER_INFO ? SHADER_INFO->name : "Unknown Shader";
ImGui::BeginDisabled();
isDirty |= SHEditorWidgets::DragDropReadOnlyField<AssetID>
(
"Fragment Shader", SHADER_NAME.data(),
@ -181,6 +182,7 @@ namespace SHADE
[this](const AssetID& id) { currentMatSpec->fragShader = id; },
SHDragDrop::DRAG_RESOURCE
);
ImGui::EndDisabled();
// Load the shader to access it's data
auto fragShader = SHResourceManager::LoadOrGet<SHVkShaderModule>(currentMatSpec->fragShader);