Commit graph

19 commits

Author SHA1 Message Date
Filippo Argiolas
5fd66383ab [441/906] sobel: convolve only luma
Rework Sobel a little bit again making it work as the old one:
1. desaturate input texture
2. calculate horizontal convolution for x gradient and vertical
   convolution for y gradient at the same time (halves the number of
   needed texture lookups)
3. store results in a single texture (red and green channel)
4. calculate remaining convolution (same as above switching vertical and
   horizontal)
5. calculate length of gradient using red and green as x and y
   components.
Optimize wherever possible, store kernels as constants in the shaders,
remove unneeded uniforms. Restore invert property carefully avoiding
using IF.
Still not sure if "full color" convolution will be needed, glfiltersobel
is to be intended as a demo filter and xray, the only effect which uses
sobel only needs edge intensity. Dropping it for now.
2014-03-15 18:36:40 +01:00
Filippo Argiolas
49df4dca3c [440/906] sobel: implement sobel filter using separable kernels
Reimplement sobel in a multipass fully separated convolution:
- calculate x gradient map convolving first horizontally with blurring
  kernel and then vertically with differentiating kernel
- calculate y gradient map convolving first vertically with blurring
  kernel and then horizonally with differentiating kernel
- calculate length of the gradient vector
Particular care was needed with normalization of the blurring kernel and
with grey level offset of the differentiating one to prevent overflow of
rgb values from the [0.0,1.0] range in intermediate passes.
Now works on i915.
2014-03-15 18:36:40 +01:00
Filippo Argiolas
98752e51da [423/906] convolution: generate gaussian kernel on the fly
Generate a normalized gaussian kernel with given size and standard
deviation on the fly.
Remove "norm_const" uniform from convolution shaders and provide a
normalized kernel instead. Remove norm_offset uniform as it was always
zero, will reintroduce it if really needed in the future. Thanks to Eric
Anholt for suggesting it.
Save some ALU instruction calculating directly the coordinate for
texture lookup instead of summing an offset.
Still exceed maximum indirect texture lookups on i915, the only solution
I see is using a 3x3 kernel.
2014-03-15 18:36:39 +01:00
Julien Isorce
e002f92e6d [408/906] gleffects: start to make it compatible with OpenGL ES 2.0
For now only identity, mirror and squeeze effects are available.
Maybe some factorization is needed about compilation shader
before to put the other effects since only a copy/past is needed,
at least until effect number 9: heat.
The effects from 10:sepia to 15:glow require more work.
2014-03-15 18:36:38 +01:00
David Schleef
f64da834ab [292/906] Add 'extern' for data symbols in headers 2014-03-15 18:36:31 +01:00
Filippo Argiolas
5f8cc769b7 [246/906] Add multiply fragment shader
Add a fragment shader to blend two textures with multiply blend mode
2014-03-15 18:36:29 +01:00
Filippo Argiolas
a80fecd888 [236/906] import sobel edge detector from cvs branch 2014-03-15 18:36:28 +01:00
Filippo Argiolas
8024aa7483 [192/906] complete differencematte filter.. I did it quickly, probably still needs some work 2014-03-15 18:36:26 +01:00
Filippo Argiolas
3faa943819 [191/906] little cleanup. add first draft of gstgldifferencematte. still doesn't work 2014-03-15 18:36:26 +01:00
Filippo Argiolas
85502ef8cd [175/906] add sin effect (desaturate everything but red shades). still needs some tuning. 2014-03-15 18:36:25 +01:00
Filippo Argiolas
c87eb37c32 [169/906] import remaining distortion effects from cvs branch (fisheye, twirl, bulge, tunnel, square) 2014-03-15 18:36:25 +01:00
Filippo Argiolas
5b1f62a079 [166/906] add rgb_to_luma_fragment source and correspondent effect. use the latter for a cross processing effect. 2014-03-15 18:36:24 +01:00
Filippo Argiolas
e009d7b400 [165/906] import luma_to_curve effects (Sepia, Heat) from cvs branch with better texture memory handling (teximage curves only once). Sepia curve still needs some love. 2014-03-15 18:36:24 +01:00
Filippo Argiolas
c5bd6fdbc5 [164/906] rename blend_fragment_source to sum_fragment_source and add uniform blending parameters 2014-03-15 18:36:24 +01:00
Filippo Argiolas
aa7e3867ac [163/906] import glow effect (maybe the most tricky) from cvs branch 2014-03-15 18:36:24 +01:00
Filippo Argiolas
e8d27cadf7 [162/906] import stretch effect from cvs 2014-03-15 18:36:24 +01:00
Filippo Argiolas
ebde5b5501 [161/906] import squeeze effect from cvs 2014-03-15 18:36:24 +01:00
Filippo Argiolas
77fc214670 [159/906] still some source tree reorganize, fixed some issue with headers and ifdefs, moved identity into effects dir 2014-03-15 18:36:24 +01:00
Filippo Argiolas
7bbdcce721 [158/906] still working on mergin gstgleffects, add mirror effect. reorganize source tree. 2014-03-15 18:36:24 +01:00