材质表面参数接通:新增 emissiveFactor(无 emissive 贴图时的发光入口,glTF 语义)入 UBO/YAML/缓存键/两 shader;Transmission/Thickness 未勾 Transparent 时禁用编辑(不透明段 shader 不读)
This commit is contained in:
@@ -174,12 +174,23 @@ void MaterialEditorPanel::DrawAssetMode(const EditorContext& ctx)
|
||||
ImGui::DragFloat("Roughness", &p.factors.y, 0.01f, 0.0f, 1.0f));
|
||||
EditParam(ImGui::ColorEdit4("Base Color", &p.baseColor.x));
|
||||
EditParam(ImGui::DragFloat("IOR", &p.surface.x, 0.01f, 1.0f, 3.0f));
|
||||
EditParam(ImGui::DragFloat("Transmission", &p.surface.y, 0.01f, 0.0f,
|
||||
1.0f));
|
||||
// 发光 = emissiveFactor × emissive 贴图 × Strength(Emissive 槽
|
||||
// 兜底贴图恒黑,无贴图时颜色因子是唯一入口)
|
||||
EditParam(ImGui::ColorEdit3("Emissive Color", &p.emissiveFactor.x));
|
||||
EditParam(ImGui::DragFloat("Emissive Strength", &p.surface.z, 0.05f,
|
||||
0.0f, 100.0f));
|
||||
// transmission/thickness 只有不透明段不读——透明 shader 专属
|
||||
//(未勾 Transparent 时禁用编辑,防"拖了没反应"的困惑)
|
||||
ImGui::BeginDisabled(!trans);
|
||||
EditParam(ImGui::DragFloat("Transmission", &p.surface.y, 0.01f, 0.0f,
|
||||
1.0f));
|
||||
EditParam(ImGui::DragFloat("Thickness", &p.surface.w, 0.01f, 0.0f,
|
||||
10.0f));
|
||||
ImGui::EndDisabled();
|
||||
if (!trans)
|
||||
{
|
||||
ImGui::TextDisabled("Transmission/Thickness need Transparent");
|
||||
}
|
||||
|
||||
// ---- 纹理槽(变化 → 落盘 + waitIdle 重建)----
|
||||
ImGui::SeparatorText("Textures");
|
||||
@@ -303,9 +314,16 @@ void MaterialEditorPanel::DrawBuiltinMode(const EditorContext& ctx)
|
||||
ImGui::DragFloat("Roughness", &p.factors.y, 0.01f, 0.0f, 1.0f);
|
||||
ImGui::ColorEdit4("Base Color", &p.baseColor.x);
|
||||
ImGui::DragFloat("IOR", &p.surface.x, 0.01f, 1.0f, 3.0f);
|
||||
ImGui::DragFloat("Transmission", &p.surface.y, 0.01f, 0.0f, 1.0f);
|
||||
ImGui::ColorEdit3("Emissive Color", &p.emissiveFactor.x);
|
||||
ImGui::DragFloat("Emissive Strength", &p.surface.z, 0.05f, 0.0f, 100.0f);
|
||||
ImGui::BeginDisabled(!trans);
|
||||
ImGui::DragFloat("Transmission", &p.surface.y, 0.01f, 0.0f, 1.0f);
|
||||
ImGui::DragFloat("Thickness", &p.surface.w, 0.01f, 0.0f, 10.0f);
|
||||
ImGui::EndDisabled();
|
||||
if (!trans)
|
||||
{
|
||||
ImGui::TextDisabled("Transmission/Thickness need Transparent");
|
||||
}
|
||||
ImGui::SeparatorText("Textures");
|
||||
static constexpr const char* kSlotNames[Engine::Material::kSlotCount] = {
|
||||
"Albedo", "Normal", "MetallicRoughness",
|
||||
|
||||
Reference in New Issue
Block a user