├── README.md ├── sepia ├── LICENSE.md ├── README.md ├── after.jpg ├── before.jpg └── sepia.glsl └── vignette ├── LICENSE.md ├── README.md ├── after.jpg ├── before.jpg └── vignette.glsl /README.md: -------------------------------------------------------------------------------- 1 | # Awesome LÖVE Shaders 2 | 3 | This repository is a collection of individual shaders designed to work in the **\*awesome\*** LÖVE game framework. Each shader is individually licensed by their respective author, but all shaders use a permissive license that allows copying, modification, and redistribution. Make sure to read each license for details. 4 | 5 | ## Awesome Lists 6 | 7 | * [awesome-love2d](https://github.com/JanWerder/awesome-love2d) - A list of LÖVE libraries. 8 | * [awesome-lua](https://github.com/LewisJEllis/awesome-lua) - A list Lua libraries. 9 | 10 | Other awesome lists can be found in the [awesome-awesomeness](https://github.com/bayandin/awesome-awesomeness) list. 11 | -------------------------------------------------------------------------------- /sepia/LICENSE.md: -------------------------------------------------------------------------------- 1 | Sepia Shader - A simple sepia shader for LÖVE 2 | 3 | Written in 2015 by Landon Manning 4 | 5 | To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. 6 | 7 | You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see . 8 | -------------------------------------------------------------------------------- /sepia/README.md: -------------------------------------------------------------------------------- 1 | # Sepia Shader 2 | 3 | A simple sepia shader for LÖVE. 4 | 5 | ## Before 6 | 7 | ![](./before.jpg) 8 | 9 | ## After 10 | 11 | ![](./after.jpg) 12 | 13 | ## Usage 14 | 15 | This shader has several variables that you can use to control the final effect. 16 | 17 | | Variable | Type | Default | Description | 18 | |-----------|-------|---------|-------------| 19 | | u_color | int | 0 | Sepia selection (0 to 1) 20 | | u_opacity | float | 0.75 | Opacity of filter 21 | 22 | ## License 23 | 24 | This shader is licensed under the CC0 Public Domain license. See the license file for more information. 25 | -------------------------------------------------------------------------------- /sepia/after.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karai17/awesome-love-shaders/10641213dd51a1ed13abf16fcbbe79faa4aa4e39/sepia/after.jpg -------------------------------------------------------------------------------- /sepia/before.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karai17/awesome-love-shaders/10641213dd51a1ed13abf16fcbbe79faa4aa4e39/sepia/before.jpg -------------------------------------------------------------------------------- /sepia/sepia.glsl: -------------------------------------------------------------------------------- 1 | // Simple sepia shader for LÖVE 2 | // License: CC0 3 | // Version: 1.0 4 | // Author: Landon Manning 5 | // Email: LManning17@gmail.com 6 | 7 | uniform int u_color = 0; 8 | uniform float u_opacity = 0.75; 9 | 10 | const vec3 SEPIA[2] = vec3[2]( 11 | vec3(1.2, 1.0, 0.8), 12 | vec3(1.0, 0.95, 0.82) 13 | ); 14 | 15 | vec4 effect(vec4 color, sampler2D texture, vec2 texCoords, vec2 screenCoords) { 16 | vec4 texColor = texture2D(texture, texCoords); 17 | 18 | // NTSC weights 19 | float grey = dot(texColor.rgb, vec3(0.299, 0.587, 0.114)); 20 | 21 | vec3 sepia = vec3(grey); 22 | 23 | switch (u_color) { 24 | case 0: 25 | sepia *= SEPIA[0]; 26 | break; 27 | case 1: 28 | sepia *= SEPIA[1]; 29 | break; 30 | default: 31 | sepia *= SEPIA[0]; 32 | } 33 | 34 | texColor.rgb = mix( 35 | texColor.rgb, 36 | sepia, 37 | u_opacity 38 | ); 39 | 40 | return texColor * color; 41 | } 42 | -------------------------------------------------------------------------------- /vignette/LICENSE.md: -------------------------------------------------------------------------------- 1 | Vignette Shader - A simple vignette shader for LÖVE 2 | 3 | Written in 2015 by Landon Manning 4 | 5 | To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. 6 | 7 | You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see . 8 | -------------------------------------------------------------------------------- /vignette/README.md: -------------------------------------------------------------------------------- 1 | # Vignette Shader 2 | 3 | A simple vignette shader for LÖVE. 4 | 5 | ## Before 6 | 7 | ![](./before.jpg) 8 | 9 | ## After 10 | 11 | ![](./after.jpg) 12 | 13 | ## Usage 14 | 15 | This shader has several variables that you can use to control the final effect. 16 | 17 | | Variable | Type | Default | Description | 18 | |-----------------|-------|---------|-------------| 19 | | u_correct_ratio | bool | false | Determines if vignette is circular or oblong 20 | | u_radius | float | 0.75 | Radius of vignette relative to screen size 21 | | u_softness | float | 0.45 | Dampens edges 22 | | u_opacity | float | 0.5 | Opacity of vignette 23 | 24 | ## License 25 | 26 | This shader is licensed under the CC0 Public Domain license. See the license file for more information. 27 | -------------------------------------------------------------------------------- /vignette/after.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karai17/awesome-love-shaders/10641213dd51a1ed13abf16fcbbe79faa4aa4e39/vignette/after.jpg -------------------------------------------------------------------------------- /vignette/before.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karai17/awesome-love-shaders/10641213dd51a1ed13abf16fcbbe79faa4aa4e39/vignette/before.jpg -------------------------------------------------------------------------------- /vignette/vignette.glsl: -------------------------------------------------------------------------------- 1 | // Simple vignette shader for LÖVE 2 | // License: CC0 3 | // Version: 1.0 4 | // Author: Landon Manning 5 | // Email: LManning17@gmail.com 6 | 7 | uniform bool u_correct_ratio = false; 8 | uniform float u_radius = 0.75; 9 | uniform float u_softness = 0.45; 10 | uniform float u_opacity = 0.5; 11 | 12 | vec4 effect(vec4 color, sampler2D texture, vec2 texCoords, vec2 screenCoords) { 13 | vec4 texColor = texture2D(texture, texCoords); 14 | vec2 position = (screenCoords.xy / love_ScreenSize.xy) - vec2(0.5); 15 | 16 | if (u_correct_ratio) { 17 | position.x *= love_ScreenSize.x / love_ScreenSize.y; 18 | } 19 | 20 | float vignette = smoothstep( 21 | u_radius, 22 | u_radius - u_softness, 23 | length(position) 24 | ); 25 | 26 | texColor.rgb = mix( 27 | texColor.rgb, 28 | texColor.rgb * vignette, 29 | u_opacity 30 | ); 31 | 32 | return texColor * color; 33 | } 34 | --------------------------------------------------------------------------------