feat: add simple transparency
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user