[246/906] Add multiply fragment shader

Add a fragment shader to blend two textures with multiply blend mode
This commit is contained in:
Filippo Argiolas 2008-10-15 16:14:52 +02:00 committed by Matthew Waters
parent a729d080f4
commit 5f8cc769b7
2 changed files with 11 additions and 0 deletions

View file

@ -294,6 +294,16 @@ const gchar *sum_fragment_source =
" gl_FragColor = alpha * basecolor + beta * blendcolor;"
"}";
const gchar *multiply_fragment_source =
"#extension GL_ARB_texture_rectangle : enable\n"
"uniform sampler2DRect base;"
"uniform sampler2DRect blend;"
"uniform float alpha;"
"void main () {"
" vec4 basecolor = texture2DRect (base, gl_TexCoord[0].st);"
" vec4 blendcolor = texture2DRect (blend, gl_TexCoord[0].st);"
" gl_FragColor = (1 - alpha) * basecolor + alpha * basecolor * blendcolor;"
"}";
/* lut operations, map luma to tex1d, see orange book (chapter 19) */
const gchar *luma_to_curve_fragment_source =

View file

@ -40,5 +40,6 @@ const gchar *sin_fragment_source;
const gchar *interpolate_fragment_source;
const gchar *texture_interp_fragment_source;
const gchar *difference_fragment_source;
const gchar *multiply_fragment_source;
#endif /* __GST_GL_EFFECTS_SOURCES_H__ */