mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
cleanup image processing shader
This commit is contained in:
@@ -149,9 +149,13 @@ void ImGuiVisitor::visit(ImageShader &n)
|
||||
ImGui::SameLine(0, 10);
|
||||
ImGui::SetNextItemWidth(RIGHT_ALIGN);
|
||||
// combo list of masks
|
||||
if ( ImGui::Combo("Mask", &item_current, ImageShader::mask_names, ImageShader::mask_presets.size()) )
|
||||
if ( ImGui::Combo("Mask", &item_current, ImageShader::mask_names, ImageShader::mask_presets.size()+1 ) )
|
||||
{
|
||||
if (item_current < ImageShader::mask_presets.size())
|
||||
n.mask = ImageShader::mask_presets[item_current];
|
||||
else {
|
||||
// TODO ask for custom mask
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::PopID();
|
||||
|
||||
@@ -16,7 +16,6 @@ void ImageProcessingShader::use()
|
||||
Shader::use();
|
||||
|
||||
// program_->setUniform("iChannelResolution[0]", iChannelResolution[0].x, iChannelResolution[0].y, iChannelResolution[0].z);
|
||||
// program_->setUniform("iChannelResolution[1]", iChannelResolution[1].x, iChannelResolution[1].y, iChannelResolution[1].z);
|
||||
|
||||
program_->setUniform("brightness", brightness);
|
||||
program_->setUniform("contrast", contrast);
|
||||
@@ -43,7 +42,6 @@ void ImageProcessingShader::reset()
|
||||
|
||||
// // no texture resolution yet
|
||||
// iChannelResolution[0] = glm::vec3(1.f);
|
||||
// iChannelResolution[1] = glm::vec3(1.f);
|
||||
|
||||
// default values for image processing
|
||||
brightness = 0.f;
|
||||
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
void accept(Visitor& v) override;
|
||||
|
||||
// // textures resolution
|
||||
// glm::vec3 iChannelResolution[2];
|
||||
// glm::vec3 iChannelResolution[1];
|
||||
|
||||
// color effects
|
||||
float brightness; // [-1 1]
|
||||
|
||||
2
main.cpp
2
main.cpp
@@ -120,7 +120,7 @@ int main(int, char**)
|
||||
/// GStreamer
|
||||
///
|
||||
#ifndef NDEBUG
|
||||
gst_debug_set_default_threshold (GST_LEVEL_WARNING);
|
||||
gst_debug_set_default_threshold (GST_LEVEL_ERROR);
|
||||
gst_debug_set_active(TRUE);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -30,8 +30,7 @@ uniform vec4 color;
|
||||
|
||||
// image processing specific
|
||||
uniform sampler2D iChannel0; // input channel (texture id).
|
||||
uniform sampler2D iChannel1;
|
||||
//uniform vec3 iChannelResolution[2]; // input channel resolution (in pixels)
|
||||
//uniform vec3 iChannelResolution[1]; // replaced by textureSize(iChannel0, 0);
|
||||
uniform vec3 iResolution; // viewport resolution (in pixels)
|
||||
|
||||
uniform float contrast;
|
||||
|
||||
Reference in New Issue
Block a user