feat: add simple transparency

This commit is contained in:
2026-10-24 00:36:58 +02:00
parent 0b7cc38543
commit b798ed0378
13 changed files with 488 additions and 18 deletions
@@ -414,6 +414,16 @@ void MeshRendererComponent::DrawMaterialEditor(RenderResources& resources, GameR
changed = finished = true;
}
constexpr std::array<const char*, 2> blendModeNames{"Opaque", "Transparent"};
int blendMode = static_cast<int>(material.blendMode);
if (ImGui::Combo("Blend", &blendMode, blendModeNames.data(), static_cast<int>(blendModeNames.size()))) {
material.blendMode = static_cast<BlendMode>(blendMode);
changed = finished = true;
}
if (material.blendMode == BlendMode::Transparent) {
track(ImGui::SliderFloat("Opacity", &material.opacity, 0.0f, 1.0f));
}
ImGui::SeparatorText("Textures");
for (const TextureSlot& slot : TextureSlots) {
ImGui::PushID(slot.label);