cleanup image processing shader

This commit is contained in:
brunoherbelin
2020-04-27 19:56:30 +02:00
parent 6b30674254
commit 7282760f69
5 changed files with 9 additions and 8 deletions

View File

@@ -149,9 +149,13 @@ void ImGuiVisitor::visit(ImageShader &n)
ImGui::SameLine(0, 10); ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(RIGHT_ALIGN); ImGui::SetNextItemWidth(RIGHT_ALIGN);
// combo list of masks // 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 ) )
{ {
n.mask = ImageShader::mask_presets[item_current]; if (item_current < ImageShader::mask_presets.size())
n.mask = ImageShader::mask_presets[item_current];
else {
// TODO ask for custom mask
}
} }
ImGui::PopID(); ImGui::PopID();

View File

@@ -16,7 +16,6 @@ void ImageProcessingShader::use()
Shader::use(); Shader::use();
// program_->setUniform("iChannelResolution[0]", iChannelResolution[0].x, iChannelResolution[0].y, iChannelResolution[0].z); // 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("brightness", brightness);
program_->setUniform("contrast", contrast); program_->setUniform("contrast", contrast);
@@ -43,7 +42,6 @@ void ImageProcessingShader::reset()
// // no texture resolution yet // // no texture resolution yet
// iChannelResolution[0] = glm::vec3(1.f); // iChannelResolution[0] = glm::vec3(1.f);
// iChannelResolution[1] = glm::vec3(1.f);
// default values for image processing // default values for image processing
brightness = 0.f; brightness = 0.f;

View File

@@ -17,7 +17,7 @@ public:
void accept(Visitor& v) override; void accept(Visitor& v) override;
// // textures resolution // // textures resolution
// glm::vec3 iChannelResolution[2]; // glm::vec3 iChannelResolution[1];
// color effects // color effects
float brightness; // [-1 1] float brightness; // [-1 1]

View File

@@ -120,7 +120,7 @@ int main(int, char**)
/// GStreamer /// GStreamer
/// ///
#ifndef NDEBUG #ifndef NDEBUG
gst_debug_set_default_threshold (GST_LEVEL_WARNING); gst_debug_set_default_threshold (GST_LEVEL_ERROR);
gst_debug_set_active(TRUE); gst_debug_set_active(TRUE);
#endif #endif

View File

@@ -30,8 +30,7 @@ uniform vec4 color;
// image processing specific // image processing specific
uniform sampler2D iChannel0; // input channel (texture id). uniform sampler2D iChannel0; // input channel (texture id).
uniform sampler2D iChannel1; //uniform vec3 iChannelResolution[1]; // replaced by textureSize(iChannel0, 0);
//uniform vec3 iChannelResolution[2]; // input channel resolution (in pixels)
uniform vec3 iResolution; // viewport resolution (in pixels) uniform vec3 iResolution; // viewport resolution (in pixels)
uniform float contrast; uniform float contrast;