Integration procedural GLSL masks

This commit is contained in:
Bruno
2020-12-27 14:05:03 +01:00
parent 69d9d9473b
commit 34c24d99df
20 changed files with 510 additions and 258 deletions

View File

@@ -161,6 +161,7 @@ void ImGuiVisitor::visit(Shader &n)
{
ImGui::PushID(std::to_string(n.id()).c_str());
// Base color
// if (ImGuiToolkit::ButtonIcon(10, 2)) {
// n.blending = Shader::BLEND_OPACITY;
// n.color = glm::vec4(1.f, 1.f, 1.f, 1.f);
@@ -201,29 +202,26 @@ void ImGuiVisitor::visit(Shader &n)
ImGui::PopID();
}
void ImGuiVisitor::visit(ImageShader &n)
{
ImGui::PushID(std::to_string(n.id()).c_str());
// get index of the mask used in this ImageShader
int item_current = n.mask;
// if (ImGuiToolkit::ButtonIcon(10, 3)) n.mask = 0;
// ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
// combo list of masks
if ( ImGui::Combo("Mask", &item_current, ImageShader::mask_names, IM_ARRAYSIZE(ImageShader::mask_names) ) )
{
if (item_current < (int) ImageShader::mask_presets.size())
n.mask = item_current;
else {
// TODO ask for custom mask
}
Action::manager().store("Mask "+ std::string(ImageShader::mask_names[n.mask]), n.id());
}
ImGui::PopID();
}
//void ImGuiVisitor::visit(ImageShader &n)
//{
// ImGui::PushID(std::to_string(n.id()).c_str());
// // get index of the mask used in this ImageShader
// int item_current = n.mask;
//// if (ImGuiToolkit::ButtonIcon(10, 3)) n.mask = 0;
//// ImGui::SameLine(0, 10);
// ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
// // combo list of masks
// if ( ImGui::Combo("Mask", &item_current, ImageShader::mask_names, IM_ARRAYSIZE(ImageShader::mask_names) ) )
// {
// if (item_current < (int) ImageShader::mask_presets.size())
// n.mask = item_current;
// else {
// // TODO ask for custom mask
// }
// Action::manager().store("Mask "+ std::string(ImageShader::mask_names[n.mask]), n.id());
// }
// ImGui::PopID();
//}
void ImGuiVisitor::visit(ImageProcessingShader &n)
{