Commit Graph

90 Commits

Author SHA1 Message Date
Kovid Goyal
444d9536a7 Graphics programs should generate pre-multipled colors in interleaved mode
Also fix a few OpenGL state initialization issues.
2017-12-01 12:16:15 +05:30
Kovid Goyal
ffff343e3d Work on rendering to FBO 2017-12-01 12:16:15 +05:30
Kovid Goyal
f85c050235 Get background_opacity working, at the cost of breaking negative z-index image rendering.
Image rendering will need to use an FBO since OpenGL cannot do proper alpha compositing.
As a first step, the interleaved shaders now generate premultiplied colors as opengl can only alpha blend pre-multipled colors
2017-12-01 12:16:14 +05:30
Kovid Goyal
d9b0b5c08f oops, forgot one place to enable GL_BLEND 2017-12-01 12:16:14 +05:30
Kovid Goyal
a561697f04 No need for GL_BLEND while drawing background colors 2017-12-01 12:16:14 +05:30
Kovid Goyal
bbc140e020 Only enable GL_BLEND when actually needed 2017-12-01 12:16:14 +05:30
Kovid Goyal
2bcbcfff44 Start work on background opacity 2017-12-01 12:16:14 +05:30
Kovid Goyal
1fb81d2265 Fix incorrect blending of foreground and background colors when negative z-index images are present
Also optimize the blending calculation a bit by using the mix() function
and just adding the text and strike alphas.
2017-12-01 12:16:14 +05:30
Kovid Goyal
3b4a242e26 Fix sprites uniform not being initialized when using layered rendering
Had no actual bad effects since it is initialized to zero anyway
2017-12-01 12:16:14 +05:30
Kovid Goyal
d7ea28f8e7 Fix sprite texture not initially bound for new OSWindow 2017-12-01 12:15:35 +05:30
Kovid Goyal
2b988b01c6 Get rid of the needs_render tracking as it was too fragile. 2017-12-01 12:15:34 +05:30
Kovid Goyal
82d17c8a59 DRYer 2017-12-01 12:15:32 +05:30
Kovid Goyal
598f08e222 Avoid unneccessary roundtrip through python to create VAOs 2017-12-01 12:15:32 +05:30
Kovid Goyal
49be779982 Port drawing of borders 2017-12-01 12:15:32 +05:30
Kovid Goyal
2ac8ad39c9 Implement destruction of OS windows 2017-12-01 12:15:32 +05:30
Kovid Goyal
e11a50ae83 Work on migrating the code needed for application startup 2017-12-01 12:15:32 +05:30
Kovid Goyal
141a08ec7c Migrate child-monitor.c to use OSWindow 2017-12-01 12:15:31 +05:30
Kovid Goyal
ace91f04af More appropriate location for function definition 2017-11-09 17:04:31 +05:30
Kovid Goyal
934d21ac30 Wire up a few remaining pieces 2017-11-09 16:55:46 +05:30
Kovid Goyal
79d8c04b00 Hook up render_line 2017-11-09 16:55:45 +05:30
Kovid Goyal
7d7d82a68d Start working on actually rendering lines of text 2017-11-09 16:55:38 +05:30
Kovid Goyal
f25d2ea540 Rip out the old sprite update code 2017-11-09 16:45:45 +05:30
Kovid Goyal
8431eef970 Get rid of no longer needed GPU function indirection 2017-11-09 16:45:02 +05:30
Kovid Goyal
7941ac1810 Remove no longer needed mac specific OpenGL extensions check 2017-11-08 15:59:55 +05:30
Kovid Goyal
7ed272e971 Use the glad provided facility for debugging OpenGL 2017-11-08 15:40:07 +05:30
Kovid Goyal
6362499fc2 Switch to using glad instead of glew 2017-11-08 15:15:25 +05:30
Kovid Goyal
e43a26d64c Better error message when GLEW initialization fails 2017-10-25 14:32:44 +05:30
Kovid Goyal
66803e6873 Workaround to get graphics working on Apple's buggy products
Apparently some macOS OpenGL drivers cannot handle using a VAO with
attributes that have different divisors/apply to different shaders. So
use a separate VAO for graphics rendering. This is a small performance hit,
but is the price of supporting substandard computers.
2017-10-17 12:15:52 +05:30
Kovid Goyal
02dc637ed0 Use the correct blend function for text 2017-10-17 09:51:21 +05:30
Kovid Goyal
090ee5b846 Disable graphics on older macOS machines
I give up, trying to work around Apple's buggy drivers without even
having a machine to test my workarounds on is too hard. Simply disable
graphics on macOS < 10.13

Fixes #141
2017-10-16 21:23:29 +05:30
Kovid Goyal
e679fa9a1c Possible fix for #141
Presumably on older macOS versions the Apple OpenGL drivers cannot handle both
non-sequential and non-zero based binding locations. Sigh.
2017-10-16 18:39:49 +05:30
Kovid Goyal
3f8b2184a6 Add a sanity check to ensure the attribute location binding worked 2017-10-13 10:06:12 +05:30
Kovid Goyal
d5088a3e5b Do image clipping using OpenGL rather than on the CPU 2017-10-07 10:08:26 +05:30
Kovid Goyal
a4e7985fb0 Condition on negative refs as well as in the future we will use interleaved drawing for background opacity as well 2017-10-05 18:21:29 +05:30
Kovid Goyal
75244b1416 ... 2017-10-04 23:07:59 +05:30
Kovid Goyal
952f0ad98c Accommodate the underpowered Apple lineup
macOS is missing glDrawArraysInstancedBaseInstance
2017-10-04 22:44:03 +05:30
Kovid Goyal
e9bc64205e Code (not working) to draw graphics 2017-10-04 18:29:48 +05:30
Kovid Goyal
8f05f752af Code to update graphics buffer 2017-10-04 17:41:11 +05:30
Kovid Goyal
138a37ccac Start work on the graphics program 2017-10-04 17:22:00 +05:30
Kovid Goyal
e1650d5df7 Implement interleaved drawing of cells 2017-10-04 16:11:20 +05:30
Kovid Goyal
3f615666df Call grman_update_layers 2017-10-04 15:39:31 +05:30
Kovid Goyal
96a9d64bcb A spot of refactoring 2017-10-04 15:34:54 +05:30
Kovid Goyal
bd09e2ebf1 Allow re-using VAO objects between different types of cell program 2017-10-04 15:33:15 +05:30
Kovid Goyal
ad040271b9 Initialize uniforms for all cell program variants 2017-10-04 14:46:36 +05:30
Kovid Goyal
ead73c8209 Prepare for two stage rendering of cells 2017-10-04 14:15:51 +05:30
Kovid Goyal
b032130a20 A spot of refactoring 2017-10-04 10:56:44 +05:30
Kovid Goyal
3cbc20005b Implement sending of image data to GPU 2017-10-01 09:04:46 +05:30
Kovid Goyal
710d00674a Export the free texture function 2017-09-30 13:51:52 +05:30
Kovid Goyal
b5b9a7ba6d Fix compilation with clang 2017-09-30 11:56:30 +05:30
Kovid Goyal
2909fddaa2 Split out GL API wrapping code into its own header 2017-09-30 11:48:52 +05:30