Commit graph

63 commits

Author SHA1 Message Date
Julien Isorce
f639d6096d [481/906] feature checking: error out instead of doing nothing if an OpenGL feature is not present
Fix bug #572767
2014-03-15 18:36:42 +01:00
Filippo Argiolas
00030c2bdd [454/906] blur: fix gaussian kernel computation 2014-03-15 18:36:41 +01:00
Filippo Argiolas
17a33cd19a [453/906] blur: give up some accuracy for speed
Settle with 7x7 gaussian convolution kernels, maybe slightly less
accurate than previous 9x9 but fast enough to be able to use it on i915.
About a 20% percent speed gain (again, roughly measured with
videotestsrc and glimagesink sync=false). No noticeable rendering
difference with current effects.
2014-03-15 18:36:41 +01:00
Filippo Argiolas
a9aa0ab2ee [452/906] sin: get rid of hls conversion code
Get rid of buggy and complicated hls conversion code for the sin effect.
The only thing needed was hue anyway and it is easily calculated using
Preucil formula for rgb to polar coordinates conversion.
Now works on i915 (removed all the IF blocks). Still needs some tuning,
I wonder if it will ever work properly.
2014-03-15 18:36:41 +01:00
Filippo Argiolas
3d14e9684d [449/906] sobel: drop unused single pass sobel shader
Drop unused sobel shader, if anyone still needs it, git log is your
friend.
2014-03-15 18:36:41 +01:00
Filippo Argiolas
c888188422 [448/906] xray: increase edges visibility
Some little fine tuning, still not completely satisfied yet.
2014-03-15 18:36:41 +01:00
Filippo Argiolas
87fda0d867 [447/906] xray: port to the new separable sobel convolution
Port xray effect to use the same sobel convolution just used in
glfiltersobel. Now xray too works on i915 (a bit slow).
2014-03-15 18:36:40 +01:00
Filippo Argiolas
b3c4eb4c61 [442/906] blur: optimize coordinates calculations
Save 28 instructions on i915 (mainly redundant MOVs) and gain a 25%
(roughly measured with videotestsrc and glimagesink sync=false) speed
bump
2014-03-15 18:36:40 +01:00
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
002f069962 [439/906] sobel: get rid of #version 120 dependent array constructors 2014-03-15 18:36:40 +01:00
Julien Isorce
28a11181c8 [436/906] gleffectssources: fix some warnings from msvc9 2014-03-15 18:36:40 +01:00
Filippo Argiolas
0cae67172a [430/906] convolution: save some indirection grouping math and sampling
Thanks to Eric Anholt I've finally understood (at least I hope) how to
count texture indirections and save up some.  Texture sampling dependent
on the result of some math counts as an indirection phase. Grouped
texture lookups with no math involved count as a single indirection.
Math on the coordinates count as indirection.
So the best thing is to group all the math involving coordinates and
then do all the lookups.
This saves enough indirections to make glfilterblur and glow effect
work, albeit a bit slowly, on i915.
2014-03-15 18:36:39 +01:00
Filippo Argiolas
b59d050e84 [427/906] rgb_to_curve: save up a texture indirection
Apparently assigning gl_TexCoord to a temp count as an indirection.
Using it directly avoids it and limits indirections to four not
exceeding i915 limit. Now xpro effect works on i915.
2014-03-15 18:36:39 +01:00
Vinson Lee
f6b0a1db7b [426/906] multiply: fix a compilation error with Apple compiler
Fix multiply_fragment_source to compile with Apple GLSL compiler.

https://bugzilla.gnome.org/show_bug.cgi?id=616748
2014-03-15 18:36:39 +01:00
Filippo Argiolas
7ee7688ae8 [425/906] twirl: get rid of polar coordinates conversion
Get rid of polar coordinates in the twirl effect. The same can be done
using a rotation matrix, saving alu instructions and, most of all,
avoiding the use of the evil atan() function (which uses IF operators).
Calculate rotation angle in a saner, understandable way.
Works on i915! (Hope it still works elsewhere too as I'm not able to
test at the moment)
2014-03-15 18:36:39 +01:00
Filippo Argiolas
797250d9c2 [424/906] tunnel: get rid of polar coordinates conversion
Get rid of polar coordinates in the tunnel effect as the same can easily
be done just clamping the radius and multiplying.
Remove the evil atan() call that uses branching and a lot of unneeded alu
instructions. Now works on i915!
2014-03-15 18:36:39 +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
Filippo Argiolas
e602d818e3 [422/906] convolution: reduce the number of register used
Reduce the number of register calculating texture lookup offset on the
fly. It was just a simple sequence, no need to store it in a array.
Fixes maximum number of registers exceeded error with i915. Still
exceed maximum indirect texture lookups and maximum ALU instructions.
Maybe we should gave up some blur goodness and use lightly more little
kernels.
2014-03-15 18:36:39 +01:00
Filippo Argiolas
a3454365fc [421/906] convolution: don't check kernel[i] to be non zero
Apparently saving up some texture lookup for zero kernel elements is
definitely not worth the use of branching. This way convolution
fragment programs also work where IF operator is not supported (tested
on i915 and nouveau). See also discussion on bug #615696.
Thanks to Eric Anholt for spotting this.
2014-03-15 18:36:39 +01:00
Filippo Argiolas
4ff22b2c67 [418/906] effects: disable gst-indent in the sources
Fix some crazy formatting caused by gst-indent previous runs and disable
the script for this file. The best would be to move shaders into
separate files and load them at runtime or hardcode them at compile
time.
2014-03-15 18:36:39 +01:00
Julien Isorce
8937128d62 [412/906] Cocoa backend: improve support on GNUStep 2014-03-15 18:36:38 +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
Filippo Argiolas
d02a585e7b [395/906] differencematte: fix regressions from gdkpixbuf to libpng migration
The background image needs to be scaled to fit current texture size.
Previously this was done by gdk_pixbuf_scale_simple but that's been
removed.
Create a texture from the background pixbuf with correct dimensions and
use interpolation shader to scale it to the right size. Interpolation
fragment shader doesn't have too much sense if all the textures don't
have the same size so this seemed the most natural place to do the
scaling. It could probably be done with some custom texture mapping
outside the shader but it involved more code.

Fixes bug #599883.
2014-03-15 18:36:37 +01:00
Julien Isorce
9584a5ddfd [318/906] rename GNUmakefile(s) to GNUmakefile(s).gnustep 2014-03-15 18:36:33 +01:00
Julien Isorce
b2143adee3 [315/906] add GNUstep build 2014-03-15 18:36:33 +01:00
David Schleef
d015d5862d [310/906] Global reindent
Indent parameters:
INDENT_PARAMETERS="--braces-on-if-line \
        --case-brace-indentation0 \
        --case-indentation2 \
        --braces-after-struct-decl-line \
        --line-length80 \
        --no-tabs \
        --cuddle-else \
        --dont-line-up-parentheses \
        --honour-newlines \
        --continuation-indentation4 \
        --tab-size8 \
        --indent-level2"
2014-03-15 18:36:33 +01:00
David Schleef
43e574aa8f [298/906] Revert "Fix indention"
This reverts commit 96e4ab18c2cf9876f6c031b9aba6282d0bd45a93.

You should have asked first.  And you would have been told "no",
because it causes people on development branches to do a huge
amount of extra work.
2014-03-15 18:36:32 +01:00
Sebastian Dröge
369b1d4ff2 [295/906] Fix indention 2014-03-15 18:36:32 +01:00
David Schleef
f64da834ab [292/906] Add 'extern' for data symbols in headers 2014-03-15 18:36:31 +01:00
Julien Isorce
25af2c116e [248/906] fix msvc warnings and update CMake build, win32 CodeBlocks build and vs8 build 2014-03-15 18:36:29 +01:00
Filippo Argiolas
0ac54fdc55 [247/906] Import xray effect
Add xray effect. Maps luma to a negative, slightly cyan tinted, curve,
applies some light gaussian blur and multiplies it with its sobel edges. Not
sure about the name, likely to change. Probably still needs some tuning.
2014-03-15 18:36:29 +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
a729d080f4 [245/906] Add invert property to sobel filter
Add an invert property to sobel_fragment_source and Sobel filter. Useful
to have dark edges with white background.
2014-03-15 18:36:29 +01:00
Filippo Argiolas
b9cd64e83c [244/906] Make luma_to_curve non-static
Make luma_to_curve public so that it can be used as a step for more
complex effects.
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
3f3c0e298f [232/906] use texture1 for curve textures 2014-03-15 18:36:28 +01:00
Filippo Argiolas
43e92c4a3f [227/906] explicitly bind the main texture and the curve one to separate units in rgb and luma to curve effects. This should solve the issue pointed in TODO item 21. 2014-03-15 18:36:28 +01:00
Filippo Argiolas
5425839342 [195/906] fix gstgldifferencematte and add an example app to test it dragging an image over the video (works with pixbufoverlay too, see pixbufdrop --help) 2014-03-15 18:36:26 +01:00
Filippo Argiolas
745a078f7f [194/906] another typo, restore old twirl fragment source 2014-03-15 18:36:26 +01:00
Filippo Argiolas
4c907f53be [193/906] fix typos 2014-03-15 18:36:26 +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
unknown
f8f81eae40 [189/906] update vs8 build and fix some warnings that comes from vc8 2014-03-15 18:36:26 +01:00
Filippo Argiolas
30ab0747cc [184/906] add a couple of macros to autotools to compile with uintrepid automake. remove array constructor so we don't have to depend on glsl #version 120. 2014-03-15 18:36:25 +01:00
Filippo Argiolas
fcb1d8a62f [182/906] add a better sepia toning curve 2014-03-15 18:36:25 +01:00
Filippo Argiolas
91006dae09 [179/906] distortion effect cleanup 2014-03-15 18:36:25 +01:00
Filippo Argiolas
35b7b488f3 [176/906] fix a typo 2014-03-15 18:36:25 +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
5db4fa5f1e [173/906] add lumaxpro (desaturate + cross process) effect. nothing too impressive but I like it. 2014-03-15 18:36:25 +01:00