[164/906] rename blend_fragment_source to sum_fragment_source and add uniform blending parameters
This commit is contained in:
parent
aa7e3867ac
commit
c5bd6fdbc5
@ -145,7 +145,7 @@ gst_gl_effects_glow_step_four (gint width, gint height, guint texture, gpointer
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_return_if_fail (
|
g_return_if_fail (
|
||||||
gst_gl_shader_compile_and_check (shader, blend_fragment_source,
|
gst_gl_shader_compile_and_check (shader, sum_fragment_source,
|
||||||
GST_GL_SHADER_FRAGMENT_SOURCE));
|
GST_GL_SHADER_FRAGMENT_SOURCE));
|
||||||
|
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
@ -158,6 +158,7 @@ gst_gl_effects_glow_step_four (gint width, gint height, guint texture, gpointer
|
|||||||
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, effects->intexture);
|
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, effects->intexture);
|
||||||
glDisable(GL_TEXTURE_RECTANGLE_ARB);
|
glDisable(GL_TEXTURE_RECTANGLE_ARB);
|
||||||
|
|
||||||
|
gst_gl_shader_set_uniform_1f (shader, "alpha", 1.0);
|
||||||
gst_gl_shader_set_uniform_1i (shader, "base", 2);
|
gst_gl_shader_set_uniform_1i (shader, "base", 2);
|
||||||
|
|
||||||
glActiveTexture (GL_TEXTURE1);
|
glActiveTexture (GL_TEXTURE1);
|
||||||
@ -165,6 +166,7 @@ gst_gl_effects_glow_step_four (gint width, gint height, guint texture, gpointer
|
|||||||
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, texture);
|
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, texture);
|
||||||
glDisable(GL_TEXTURE_RECTANGLE_ARB);
|
glDisable(GL_TEXTURE_RECTANGLE_ARB);
|
||||||
|
|
||||||
|
gst_gl_shader_set_uniform_1f (shader, "beta", 1/3.5);
|
||||||
gst_gl_shader_set_uniform_1i (shader, "blend", 1);
|
gst_gl_shader_set_uniform_1i (shader, "blend", 1);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture);
|
||||||
|
@ -132,12 +132,14 @@ const gchar *vconv9_fragment_source =
|
|||||||
"}";
|
"}";
|
||||||
|
|
||||||
/* TODO: support several blend modes */
|
/* TODO: support several blend modes */
|
||||||
const gchar *blend_fragment_source =
|
const gchar *sum_fragment_source =
|
||||||
"#extension GL_ARB_texture_rectangle : enable\n"
|
"#extension GL_ARB_texture_rectangle : enable\n"
|
||||||
"uniform sampler2DRect base;"
|
"uniform sampler2DRect base;"
|
||||||
"uniform sampler2DRect blend;"
|
"uniform sampler2DRect blend;"
|
||||||
|
"uniform float alpha;"
|
||||||
|
"uniform float beta;"
|
||||||
"void main () {"
|
"void main () {"
|
||||||
" vec4 basecolor = texture2DRect (base, gl_TexCoord[0].st);"
|
" vec4 basecolor = texture2DRect (base, gl_TexCoord[0].st);"
|
||||||
" vec4 blendcolor = texture2DRect (blend, gl_TexCoord[0].st);"
|
" vec4 blendcolor = texture2DRect (blend, gl_TexCoord[0].st);"
|
||||||
" gl_FragColor = basecolor + blendcolor / 3.5;"
|
" gl_FragColor = alpha * basecolor + beta * blendcolor;"
|
||||||
"}";
|
"}";
|
||||||
|
@ -29,6 +29,6 @@ const gchar *stretch_fragment_source;
|
|||||||
const gchar *luma_threshold_fragment_source;
|
const gchar *luma_threshold_fragment_source;
|
||||||
const gchar *hconv9_fragment_source;
|
const gchar *hconv9_fragment_source;
|
||||||
const gchar *vconv9_fragment_source;
|
const gchar *vconv9_fragment_source;
|
||||||
const gchar *blend_fragment_source;
|
const gchar *sum_fragment_source;
|
||||||
|
|
||||||
#endif /* __GST_GL_EFFECTS_SOURCES_H__ */
|
#endif /* __GST_GL_EFFECTS_SOURCES_H__ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user