Add refraction to material_sandbox
This commit is contained in:
@@ -284,7 +284,7 @@ static void gui(filament::Engine* engine, filament::View*) {
|
||||
|
||||
if (params.currentMaterialModel == MATERIAL_MODEL_LIT) {
|
||||
ImGui::Combo("blending", ¶ms.currentBlending,
|
||||
"opaque\0transparent\0fade\0\0");
|
||||
"opaque\0transparent\0fade\0thin refraction\0solid refraction\0\0");
|
||||
}
|
||||
|
||||
ImGui::ColorEdit3("baseColor", ¶ms.color.r);
|
||||
@@ -320,6 +320,15 @@ static void gui(filament::Engine* engine, filament::View*) {
|
||||
ImGui::ColorEdit3("sheenColor", ¶ms.sheenColor.r);
|
||||
ImGui::ColorEdit3("subsurfaceColor", ¶ms.subsurfaceColor.r);
|
||||
}
|
||||
|
||||
bool hasRefraction = params.currentBlending == BLENDING_THIN_REFRACTION ||
|
||||
params.currentBlending == BLENDING_SOLID_REFRACTION;
|
||||
if (hasRefraction) {
|
||||
ImGui::SliderFloat("ior", ¶ms.ior, 1.0f, 3.0f);
|
||||
ImGui::SliderFloat("transmission", ¶ms.transmission, 0.0f, 1.0f);
|
||||
ImGui::SliderFloat("thickness", ¶ms.thickness, 0.0f, 1.0f);
|
||||
ImGui::ColorEdit3("absorption", ¶ms.absorption.r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user