-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from nikp123/unstable
Update to 0.7.1.0
- Loading branch information
Showing
53 changed files
with
1,373 additions
and
755 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[submodule "lib/iniparser"] | ||
path = lib/iniparser | ||
url = https://github.com/ndevilla/iniparser | ||
[submodule "lib/efsw"] | ||
path = lib/efsw | ||
url = https://github.com/SpartanJ/efsw | ||
[submodule "lib/x-watcher"] | ||
path = lib/x-watcher | ||
url = https://github.com/nikp123/x-watcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,6 @@ a fork of [Karl Stavestrand's](mailto:[email protected]) [C.A.V.A.](https://gi | |
- [Vsync](#vsync) | ||
- [Bars](#bars) | ||
- [Colors and gradients](#colors-and-gradients) | ||
- [Shadow](#shadow) | ||
- [Accent colors](#accent-colors) | ||
- [Additional options](#additional-options) | ||
- [Contribution](#contribution) | ||
|
@@ -684,19 +683,6 @@ enable them by changing: | |
... | ||
|
||
|
||
### Shadow | ||
|
||
XAVA can render shadows around the bars so to make the | ||
visualizer look like it's floating on your desktop. | ||
In the ``shadow`` section you'll find these two options: | ||
|
||
size = *in pixels* | ||
color = *hex color string in the following format '#aarrggbb'* | ||
|
||
You need to be running the "supported" mode and a shader that supports shadows | ||
for this to work (by default, the shaders do support shadows). | ||
|
||
|
||
### Additional options | ||
|
||
XAVA still has plenty to offer, just look up all of the options in the config | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,34 @@ | ||
#ifdef GL_ES | ||
precision mediump float; | ||
#endif | ||
#version 420 core | ||
|
||
varying vec2 v_texCoord; | ||
in vec2 texCoord; | ||
|
||
uniform sampler2D s_texture; | ||
uniform sampler2D s_depth; | ||
uniform sampler2D color_texture; | ||
uniform sampler2D depth_texture; | ||
|
||
uniform vec4 shadow_color; | ||
uniform vec2 shadow_offset; | ||
uniform vec4 background_color; | ||
|
||
uniform vec4 bgcolor; | ||
layout(location=0) out vec4 FragColor; | ||
|
||
// Credit: https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/5.glsl | ||
vec4 blur5(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) { | ||
vec4 color = vec4(0.0); | ||
vec2 off1 = vec2(1.3333333333333333) * direction; | ||
color += texture2D(image, uv) * 0.29411764705882354; | ||
color += texture2D(image, uv + (off1 / resolution)) * 0.35294117647058826; | ||
color += texture2D(image, uv - (off1 / resolution)) * 0.35294117647058826; | ||
return color; | ||
vec4 correctForAlphaBlend(vec4 color) { | ||
return vec4(color.rgb*color.a, color.a); | ||
} | ||
|
||
vec4 append_color_properly(vec4 source, vec4 target) { | ||
target.rgb += source.rgb*source.a; | ||
target.a = max(source.a, target.a); | ||
return target; | ||
} | ||
|
||
void main() { | ||
vec4 depth = texture2D(s_depth, v_texCoord); | ||
vec4 depth = texture(depth_texture, texCoord); | ||
|
||
// test if infinite | ||
if(depth.r == 1.0) { | ||
float color = 1.0 - blur5(s_depth, shadow_offset+v_texCoord, vec2(2.0, 2.0), shadow_offset).r; | ||
color *= 1.6; // strenghten shadows | ||
gl_FragColor = mix(bgcolor, shadow_color, color); | ||
} else { | ||
gl_FragColor = texture2D(s_texture, v_texCoord); | ||
FragColor = background_color; | ||
if(depth.r != 1.0) { | ||
FragColor = append_color_properly(texture(color_texture, texCoord), | ||
FragColor); | ||
} | ||
|
||
FragColor = correctForAlphaBlend(FragColor); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
#ifdef GL_ES | ||
precision mediump float; | ||
#endif | ||
#version 420 core | ||
|
||
// input vertex and texture coordinate | ||
attribute vec4 a_position; | ||
attribute vec2 a_texCoord; | ||
in vec4 v_texCoord; // vertex | ||
in vec2 m_texCoord; // mapping | ||
|
||
// output texture map coordinate | ||
varying vec2 v_texCoord; | ||
out vec2 texCoord; | ||
|
||
void main() { | ||
gl_Position = a_position; | ||
v_texCoord = a_texCoord; | ||
gl_Position = v_texCoord; | ||
texCoord = m_texCoord; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,34 @@ | ||
#ifdef GL_ES | ||
precision mediump float; | ||
#endif | ||
#version 420 core | ||
|
||
varying vec2 v_texCoord; | ||
in vec2 texCoord; | ||
|
||
uniform sampler2D s_texture; | ||
uniform sampler2D s_depth; | ||
uniform sampler2D color_texture; | ||
uniform sampler2D depth_texture; | ||
|
||
uniform vec4 shadow_color; | ||
uniform vec2 shadow_offset; | ||
|
||
uniform vec4 bgcolor; | ||
uniform vec4 background_color; | ||
|
||
uniform float intensity; | ||
|
||
// Credit: https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/5.glsl | ||
vec4 blur5(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) { | ||
vec4 color = vec4(0.0); | ||
vec2 off1 = vec2(1.3333333333333333) * direction; | ||
color += texture2D(image, uv) * 0.29411764705882354; | ||
color += texture2D(image, uv + (off1 / resolution)) * 0.35294117647058826; | ||
color += texture2D(image, uv - (off1 / resolution)) * 0.35294117647058826; | ||
return color; | ||
layout(location=0) out vec4 FragColor; | ||
|
||
vec4 correctForAlphaBlend(vec4 color) { | ||
return vec4(color.rgb*color.a, color.a); | ||
} | ||
|
||
vec4 append_color_properly(vec4 source, vec4 target) { | ||
target.a = target.a > source.a ? target.a : source.a; | ||
target.rgb += source.rgb*target.a; | ||
return target; | ||
} | ||
|
||
void main() { | ||
vec4 depth = texture2D(s_depth, v_texCoord); | ||
vec4 depth = texture(depth_texture, texCoord); | ||
|
||
// test if infinite | ||
if(depth.r == 1.0) { | ||
vec4 bg = mix(vec4(0.0, 0.0, 0.0, 0.0), bgcolor, 1.0-intensity); | ||
|
||
float depth = 1.0 - blur5(s_depth, shadow_offset+v_texCoord, vec2(2.0, 2.0), shadow_offset).r; | ||
depth *= 1.6; // strenghten shadows | ||
FragColor = append_color_properly( | ||
texture(color_texture, texCoord), | ||
vec4(background_color.rgb, background_color.a*(1.0-intensity))); | ||
|
||
gl_FragColor = mix(bg, shadow_color, depth); | ||
} else { | ||
gl_FragColor = texture2D(s_texture, v_texCoord); | ||
} | ||
//FragColor = correctForAlphaBlend(FragColor); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
#version 420 core | ||
|
||
// input vertex and texture coordinate | ||
attribute vec4 a_position; | ||
attribute vec2 a_texCoord; | ||
in vec4 v_texCoord; // vertex | ||
in vec2 m_texCoord; // mapping | ||
|
||
// output texture map coordinate | ||
varying vec2 v_texCoord; | ||
out vec2 texCoord; | ||
|
||
void main() { | ||
gl_Position = a_position; | ||
v_texCoord = a_texCoord; | ||
gl_Position = v_texCoord; | ||
texCoord = m_texCoord; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#version 420 core | ||
|
||
in vec2 texCoord; | ||
|
||
uniform sampler2D color_texture; | ||
uniform sampler2D depth_texture; | ||
|
||
uniform vec2 resolution; | ||
|
||
vec4 shadow_color = vec4(0.0, 0.0, 0.0, 1.0); | ||
vec2 shadow_offset; | ||
|
||
uniform vec4 background_color; | ||
|
||
layout(location=0) out vec4 FragColor; | ||
|
||
// Credit: https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/5.glsl | ||
vec4 blur5(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) { | ||
vec4 color = vec4(0.0); | ||
vec2 off1 = vec2(1.3333333333333333) * direction; | ||
color += texture(image, uv) * 0.29411764705882354; | ||
color += texture(image, uv + (off1 / resolution)) * 0.35294117647058826; | ||
color += texture(image, uv - (off1 / resolution)) * 0.35294117647058826; | ||
return color; | ||
} | ||
|
||
vec4 correctForAlphaBlend(vec4 color) { | ||
return vec4(color.rgb*color.a, color.a); | ||
} | ||
|
||
vec4 append_color_properly(vec4 source, vec4 target) { | ||
target.rgb += source.rgb*source.a; | ||
target.a = max(source.a, target.a); | ||
return target; | ||
} | ||
|
||
void main() { | ||
vec4 depth = texture(depth_texture, texCoord); | ||
|
||
shadow_offset = vec2(-5.0, 5.0) / resolution; | ||
|
||
// test if infinite | ||
FragColor = background_color; | ||
if(depth.r == 1.0) { | ||
float color = 1.0 - blur5(depth_texture, shadow_offset+texCoord, vec2(2.0, 2.0), shadow_offset).r; | ||
FragColor = mix(FragColor, shadow_color, color); | ||
} | ||
|
||
FragColor = append_color_properly(texture(color_texture, texCoord), | ||
FragColor); | ||
|
||
FragColor = correctForAlphaBlend(FragColor); | ||
} | ||
|
Oops, something went wrong.