Decos: Window decoration flags, shadow improvements (#3739)

This commit is contained in:
Vaxry 2023-11-04 13:10:52 +00:00 committed by GitHub
parent 54e51b7acf
commit 73e78f05ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 192 additions and 75 deletions

View file

@ -5,7 +5,9 @@
inline const std::string FRAGSHADOW = R"#(
precision mediump float;
varying vec4 v_color;
uniform sampler2D alphaMatte;
varying vec2 v_texcoord;
varying vec2 v_texcoordMatte;
uniform vec2 topLeft;
uniform vec2 bottomRight;
@ -13,6 +15,7 @@ uniform vec2 fullSize;
uniform float radius;
uniform float range;
uniform float shadowPower;
uniform int useAlphaMatte;
float pixAlphaRoundedDistance(float distanceToCorner) {
if (distanceToCorner > radius) {
@ -74,6 +77,10 @@ void main() {
}
}
if (useAlphaMatte == 1) {
pixColor[3] *= 1.0 - texture2D(alphaMatte, v_texcoordMatte)[3];
}
if (pixColor[3] == 0.0) {
discard; return;
}

View file

@ -37,13 +37,16 @@ uniform mat3 proj;
uniform vec4 color;
attribute vec2 pos;
attribute vec2 texcoord;
attribute vec2 texcoordMatte;
varying vec4 v_color;
varying vec2 v_texcoord;
varying vec2 v_texcoordMatte;
void main() {
gl_Position = vec4(proj * vec3(pos, 1.0), 1.0);
v_color = color;
v_texcoord = texcoord;
v_texcoordMatte = texcoordMatte;
})#";
inline const std::string QUADFRAGSRC = R"#(