mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-12 10:49:59 +01:00
New blending: hard light
This commit is contained in:
@@ -171,7 +171,8 @@ void ImGuiVisitor::visit(Shader &n)
|
|||||||
// ImGui::SameLine(0, 5);
|
// ImGui::SameLine(0, 5);
|
||||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||||
int mode = n.blending;
|
int mode = n.blending;
|
||||||
if (ImGui::Combo("Blending", &mode, "Normal\0Screen\0Subtract\0Multiply\0Soft light\0Soft subtract\0Lighten only\0None\0") ) {
|
if (ImGui::Combo("Blending", &mode, "Normal\0Screen\0Subtract\0Multiply\0Soft light"
|
||||||
|
"\0Hard light\0Soft subtract\0Lighten only\0") ) {
|
||||||
n.blending = Shader::BlendMode(mode);
|
n.blending = Shader::BlendMode(mode);
|
||||||
|
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
@@ -189,6 +190,9 @@ void ImGuiVisitor::visit(Shader &n)
|
|||||||
case Shader::BLEND_MULTIPLY:
|
case Shader::BLEND_MULTIPLY:
|
||||||
oss<<"Multiply";
|
oss<<"Multiply";
|
||||||
break;
|
break;
|
||||||
|
case Shader::BLEND_HARD_LIGHT:
|
||||||
|
oss<<"Hard light";
|
||||||
|
break;
|
||||||
case Shader::BLEND_SOFT_LIGHT:
|
case Shader::BLEND_SOFT_LIGHT:
|
||||||
oss<<"Soft light";
|
oss<<"Soft light";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -24,27 +24,30 @@ ShadingProgram *ShadingProgram::currentProgram_ = nullptr;
|
|||||||
ShadingProgram simpleShadingProgram("shaders/simple.vs", "shaders/simple.fs");
|
ShadingProgram simpleShadingProgram("shaders/simple.vs", "shaders/simple.fs");
|
||||||
|
|
||||||
// Blending presets for matching with Shader::BlendModes:
|
// Blending presets for matching with Shader::BlendModes:
|
||||||
GLenum blending_equation[8] = { GL_FUNC_ADD, // normal
|
GLenum blending_equation[9] = { GL_FUNC_ADD, // normal
|
||||||
GL_FUNC_ADD, // screen
|
GL_FUNC_ADD, // screen
|
||||||
GL_FUNC_REVERSE_SUBTRACT, // subtract
|
GL_FUNC_REVERSE_SUBTRACT, // subtract
|
||||||
GL_FUNC_ADD, // multiply
|
GL_FUNC_ADD, // multiply
|
||||||
GL_FUNC_ADD, // soft light
|
GL_FUNC_ADD, // soft light
|
||||||
|
GL_FUNC_ADD, // hard light
|
||||||
GL_FUNC_REVERSE_SUBTRACT, // soft subtract
|
GL_FUNC_REVERSE_SUBTRACT, // soft subtract
|
||||||
GL_MAX, // lighten only
|
GL_MAX, // lighten only
|
||||||
GL_FUNC_ADD};
|
GL_FUNC_ADD};
|
||||||
GLenum blending_source_function[8] = { GL_ONE, // normal
|
GLenum blending_source_function[9] = { GL_ONE, // normal
|
||||||
GL_ONE, // screen
|
GL_ONE, // screen
|
||||||
GL_SRC_COLOR, // subtract (can be GL_ONE)
|
GL_SRC_COLOR, // subtract (can be GL_ONE)
|
||||||
GL_DST_COLOR, // multiply : src x dst color
|
GL_DST_COLOR, // multiply : src x dst color
|
||||||
GL_DST_COLOR, // soft light : src x dst color
|
GL_DST_COLOR, // soft light : src x dst color
|
||||||
|
GL_SRC_COLOR, // hard light : src x src color
|
||||||
GL_DST_COLOR, // soft subtract
|
GL_DST_COLOR, // soft subtract
|
||||||
GL_ONE, // lighten only
|
GL_ONE, // lighten only
|
||||||
GL_ONE};
|
GL_ONE};
|
||||||
GLenum blending_destination_function[8] = {GL_ONE_MINUS_SRC_ALPHA,// normal
|
GLenum blending_destination_function[9] = {GL_ONE_MINUS_SRC_ALPHA,// normal
|
||||||
GL_ONE, // screen
|
GL_ONE, // screen
|
||||||
GL_ONE, // subtract
|
GL_ONE, // subtract
|
||||||
GL_ONE_MINUS_SRC_ALPHA, // multiply
|
GL_ONE_MINUS_SRC_ALPHA, // multiply
|
||||||
GL_ONE, // soft light
|
GL_ONE, // soft light
|
||||||
|
GL_ONE, // hard light
|
||||||
GL_ONE, // soft subtract
|
GL_ONE, // soft subtract
|
||||||
GL_ONE, // lighten only
|
GL_ONE, // lighten only
|
||||||
GL_ZERO};
|
GL_ZERO};
|
||||||
|
|||||||
Reference in New Issue
Block a user