summaryrefslogtreecommitdiffstats
path: root/res
AgeCommit message (Collapse)Author
2019-04-06Fix warning about inconsistent types in shaderDavid Hotham
2019-02-04Simplify text shaderM. Stoeckl
2019-02-03Remove unused coordinate from rect shaderM. Stoeckl
2018-12-17Add color option to visual bellChristian Duerr
This adds the option to specify the color of the visual bell using the `visual_bell.color` configuration setting. This is done by rendering a big quad over the entire screen, which also opens up options to draw other arbitrary rectangles on the screen in the future.
2017-10-21Fix solid background color opacity (#847)Joe Wilm
Since landing the patch adding transparency support to Alacritty, there's been an issue where othewise solid background cells were also being rendered partially transparent. Now, all filled background cells are rendered fully opaque. Some logic was added to support discarding filled backgrounds which had the same color as the default background. This means that, if the default background is #000 and a cell has that background, it will never be rendered opaque. This may not be correct. Note that many truecolor vim color schemes print spaces for default colored background cells. Performance can be dramatically improved by using ctermbg=NONE guibg=NONE to skip rendering those cells.
2017-08-20Add background_opacity option to set terminal transparency (#331)Gabriel Martinez
The option is an Alpha struct that ensures that the contained float is between 0.0 and 1.0. Background colors are multiplied by the opacity to properly alpha blend them.
2017-05-06Fix glyph offsets in cellJoe Wilm
We previously had a hard-coded value for aligning glyphs within cells. The font descent is now used, and the offset should be correct by default.
2017-02-07Add visual bell supportMark Andrus Roberts
This commit adds support for a visual bell. Although the Handler in src/ansi.rs warns "Hopefully this is never implemented", I wanted to give it a try. A new config option is added, `visual_bell`, which sets the `duration` and `animation` function of the visual bell. The default `duration` is 150 ms, and the default `animation` is `EaseOutExpo`. To disable the visual bell, set its duration to 0. The visual bell is modeled by VisualBell in src/term/mod.rs. It has a method to ring the bell, `ring`, and another method, `intensity`. Both return the "intensity" of the bell, which ramps down from 1.0 to 0.0 at a rate set by `duration` and `animation`. Whether or not the Processor waits for events is now configurable in order to allow for smooth drawing of the visual bell.
2016-10-27Live shader reloading is now a featureJoe Wilm
Which means it can be disabled in release builds. No more working on a renderer feature and actually breaking the Alacritty your editor is running inside.
2016-06-29Add license header to glsl filesJoe Wilm
2016-06-14Add support for macOSJoe Wilm
Alacritty now runs on macOS using CoreText for font rendering. The font rendering subsystems were moved into a separate crate called `font`. The font crate provides a unified (albeit limited) API which wraps CoreText on macOS and FreeType/FontConfig on other platforms. The unified API differed slightly from what the original Rasterizer for freetype implemented, and it was updated accordingly. The cell separation properties (sep_x and sep_y) are now premultiplied into the cell width and height. They were previously passed through as uniforms to the shaders; removing them prevents a lot of redundant work. `libc` has some differences between Linux and macOS. `__errno_location` is not available on macOS, and the `errno` crate was brought in to provide a cross-platform API for dealing with errno. Differences in `openpty` were handled by implementing a macOS specific version. It would be worth investigating a way to unify the implementations at some point. A type mismatch with TIOCSCTTY was resolved with a cast. Differences in libc::passwd struct fields were resolved by using std::mem::uninitialized instead of zeroing the struct ourselves. This has the benefit of being much cleaner. The thread setup had to be changed to support both macOS and Linux. macOS requires that events from the window be handled on the main thread. Failure to do so will prevent the glutin window from even showing up! For this reason, the renderer and parser were moved to their own thread, and the input is received on the main thread. This is essentially reverse the setup prior to this commit. Renderer initialization (and thus font cache initialization) had to be moved to the rendering thread as well since there's no way to make_context(null) with glx on Linux. Trying to just call make_context a second time on the rendering thread had resulted in a panic!.
2016-06-06Add support for drawing background colorsJoe Wilm
2016-06-06Refactor Instanced Drawing to use Vertex ArraysJoe Wilm
Per-instanced data was previously stored in uniforms. This required several OpenGL calls to upload all of the data, and it was more complex to prepare (several vecs vs one). Additionally, drawing APIs are now accessible through a `RenderApi` (obtained through `QuadRenderer::with_api`) which enables some RAII patterns. Specifically, checks for batch flushing are handled in Drop.
2016-06-04Optimize Rendering with batched draw callsJoe Wilm
Draw calls are now batched for performance. Render times on git log at the default size are now ~200usec.
2016-06-04Optimize renderingJoe Wilm
This moves some logic that was previously being done per-character into the vertex shader. At this time, we've traded CPU computation for additional gl::Uniform2f calls. This is only a marginal improvement. However, this patch positions the renderer well for instanced drawing, and that will be a huge performance win.
2016-06-02Initial support for Terminal Emulation (woo!)Joe Wilm
This patch introduces basic support for terminal emulation. Basic means commands that don't use paging and are not full screen applications like vim or tmux. Some paging applications are working properly, such as as `git log`. Other pagers work reasonably well as long as the help menu is not accessed. There is now a central Rgb color type which is shared by the renderer, terminal emulation, and the pty parser. The parser no longer owns a Handler. Instead, a mutable reference to a Handler is provided whenever advancing the parser. This resolved some potential ownership issues (eg parser owning the `Term` type would've been unworkable).
2016-05-20Correct sub-pixel font rendering with OpenGLJoe Wilm
Uses the GL_ARB_blend_func_extended to get single-pass, per-channel alpha blending. gl_generator is now used instead of gl to enable the extension. The background color is removed since that presumably needs to run in a separate pass.
2016-04-11Use subpixel font renderingJoe Wilm
OpenGL only supports shared alpha blending. Subpixel font rendering requires using the font RGB values as alpha masks for the corresponding RGB channels. To support this, blending is implemented in the fragment shader.
2016-02-27Implement per vertex structJoe Wilm
2016-02-24Bit of cleanupJoe Wilm
- Commend vertex slice - Add helper for binding mask texture (and specify that it's a mask) - Prefix uniform members of ShaderProgram with u_. This makes it easy to identify in the rest of code.
2016-02-24Fragment shader supplies color correctlyJoe Wilm
2016-02-23Render the letter JJoe Wilm
This letter brought to you by OpenGL and freetype.