mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 10:41:04 +00:00
[246/906] Add multiply fragment shader
Add a fragment shader to blend two textures with multiply blend mode
This commit is contained in:
parent
a729d080f4
commit
5f8cc769b7
2 changed files with 11 additions and 0 deletions
|
@ -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 =
|
||||
|
|
|
@ -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__ */
|
||||
|
|
Loading…
Reference in a new issue