26 Commits

Author SHA1 Message Date
Marek Roszko
6188f632b9 Initial implementation of shader translation to cpp at build time 2022-05-12 23:37:44 -04:00
david-beinder
2b4564571c GAL: Tune SMAA to have a conservative and aggressive mode
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8522
Conservative makes SMAA usable in Eeschema through weaker AA.
Aggressive reduces some artifacts compared to the High preset.
Restores the unused Ultra preset in the shader source to its original state.
2021-06-04 17:48:34 +00:00
Hajo Nils Krabbenhöft
937f502158 Improve accelerated supersampling 2x antialiasing
Avoid fractional pixel offsets by forcing integer division of m_screenSize.
Shift rounded lookAtPoint onto OpenGL pixel center to ensure consistent rounding to int.
The pixel 0..1 @ 1x needs to fill the area 0..2 @ 2x so its center moves by 0.5 * (pixel size @ 1x).
2021-06-03 17:53:51 +00:00
Urja Rannikko
aa7ab46a06 GAL: Round the incoming mode parameter in fragment shader
This fixes some letters being randomly boxes and some circles
being randomly triangles on the Mali T760.
2020-07-17 20:24:18 +00:00
Urja Rannikko
65ceeebc71 GAL: Remove dead code regarding SHADER_LINE_B in the fragment shader
The only test for it was only called from a function
that's called if the mode is SHADER_LINE_A, not B.
2020-07-17 20:24:18 +00:00
Jon Evans
a94a81b9a8 GAL: Handle text opacity in OpenGL
Vertex alpha was being dropped in the font shader
2020-07-12 11:16:28 -04:00
Seth Hillbrand
db0523626c GAL: Deal with thick circles
Both Cairo and OpenGL had issues (different, though) with circles that are
thicker in line width than they have radius.  This corrects the OpenGL
implementation (radius is calculated to the outer edge) as well as Cairo
(line width needs to be clamped to twice the radius)

Fixes: lp:1822765
* https://bugs.launchpad.net/kicad/+bug/1822765
2019-04-02 17:19:20 -07:00
Tomasz Włostowski
3b3c674c1a gal: opengl: use correct radius for graphical circles 2019-02-19 01:55:50 +01:00
Tomasz Włostowski
632a619df9 gal: fixed broken lines in flipped board view (pixel alignment regression) 2019-02-18 11:27:12 +01:00
Seth Hillbrand
f1a60832e0 opengl: Handle stroked semi-circles
And filled but we don't use those yet.  No pixel-alignment needed for
stroked semi-circles (I think) as we set the pixel width to be 1
regardless of the zoom level.

Fixes: lp:1816263
* https://bugs.launchpad.net/kicad/+bug/1816263
2019-02-16 19:57:23 -08:00
Tomasz Włostowski
bbee30671a gal: pixel alignment hacks, works for Retina display too now.
gal: pixel alignment for Cairo.
gal: pixel alignment for OpenGL

Cleanup of pixel alignment patches

gal/opengl: more pixel alignment patches:
- works on Retina displays now
- pixel alignment for circles
- correct 1-pixel strokes
- fixed unfinished 1-pixel line ends

GAL: Restore antialiasing options in Cairo
GAL: Fix arc drawing

Removes DrawArcSegment, which drew arcs whose edge was optionally
stroked (a feature that we did not use).  Fixes Cairo arc drawing issue
where arcs were not visible in pcbnew.

gal: further cleanup
gal: removed unused shader parameter
2019-02-16 20:03:13 +01:00
Jeff Young
6a5744adb1 Show compile errors and go back to GLSL V120. 2018-10-13 12:39:53 +01:00
Tomasz Włostowski
711b278248 gal/opengl: handle single-pixel line width clamping in hardware (new shader). Correct grid rendering in GAL for pixel-sized lines 2018-10-12 19:13:54 +02:00
Carsten Schoenert
e81faa2d5f fix misspelled 'allow to' -> 'allow one to' 2018-07-11 10:35:14 -04:00
Carsten Schoenert
9f7109826d fix misspelled 'allows to' -> 'allows one to'
Fixup small grammar issues around used 'allows to ...' almost in
code comments.
2018-07-11 10:35:03 -04:00
Carsten Schoenert
77b3a662fc fix misspelled 'Allows to' -> 'Allows one to' 2018-04-08 13:24:30 -04:00
Carsten Schoenert
1f32f7c55b fix misspelled 'allows to' -> 'allows one to' 2018-04-08 13:24:18 -04:00
Jon Evans
921e68107b OpenGL: Make circle/arc drawing match Cairo for some edge cases 2018-03-08 22:04:33 -05:00
Carsten Schoenert
9679bd55c1 fix misspelled 'streching' -> stretching 2018-02-25 17:10:10 -05:00
Carsten Schoenert
cb14742442 fix misspelled 'accesing' -> 'accessing' 2018-02-25 17:10:10 -05:00
Maciej Suminski
aabf8300c3 Removed non-ASCII characters 2017-01-12 09:20:04 +01:00
Maciej Suminski
da00d64877 OpenGL antialising code clean up & formatting 2017-01-11 16:20:37 +01:00
decimad
e71070fe1b final touch-ups (license information, includes) 2017-01-11 16:20:37 +01:00
decimad
2a8dd508c4 Add smaa (subsample morphological antialiasing) 2017-01-11 16:20:37 +01:00
decimad
afacee5d96 Add supersampling (2x/4x) antialiasing 2017-01-11 16:20:37 +01:00
decimad
77f9cd0cb0 remove custom shader header generation build-step in favor of c++11 raw string literals
rework shader loading code to handle an arbitrary amount of to-be-concatenated strings
2017-01-11 16:20:34 +01:00