mirror of
https://github.com/hyprwm/Hyprland
synced 2026-05-08 14:58:09 +02:00
fix highlighting
This commit is contained in:
parent
cf9c93503e
commit
de606eb9b7
6 changed files with 100 additions and 94 deletions
|
|
@ -37,34 +37,34 @@ layout(location = 1) out vec4 mirrorColor;
|
|||
#endif
|
||||
void main() {
|
||||
#if USE_MIRROR
|
||||
vec4[2] pixColors = getBorder(
|
||||
vec4[2] pixColors =
|
||||
#else
|
||||
fragColor = getBorder(
|
||||
fragColor =
|
||||
#endif
|
||||
v_texcoord, alpha, fullSizeUntransformed, radiusOuter, thick, radius, roundingPower, topLeft, fullSize, gradientLength, gradient, angle, gradient2Length, gradient2, angle2,
|
||||
gradientLerp
|
||||
getBorder(v_texcoord, alpha, fullSizeUntransformed, radiusOuter, thick, radius, roundingPower, topLeft, fullSize, gradientLength, gradient, angle, gradient2Length,
|
||||
gradient2, angle2, gradientLerp
|
||||
#if USE_CM
|
||||
,
|
||||
sourceTF, targetTF, convertMatrix, srcTFRange, dstTFRange
|
||||
,
|
||||
sourceTF, targetTF, convertMatrix, srcTFRange, dstTFRange
|
||||
#if USE_ICC
|
||||
,
|
||||
iccLut3D, iccLutSize
|
||||
,
|
||||
iccLut3D, iccLutSize
|
||||
#else
|
||||
#if USE_TONEMAP || USE_SDR_MOD
|
||||
,
|
||||
targetPrimariesXYZ
|
||||
,
|
||||
targetPrimariesXYZ
|
||||
#endif
|
||||
#if USE_TONEMAP
|
||||
,
|
||||
maxLuminance, dstMaxLuminance, dstRefLuminance, srcRefLuminance
|
||||
,
|
||||
maxLuminance, dstMaxLuminance, dstRefLuminance, srcRefLuminance
|
||||
#endif
|
||||
#if USE_SDR_MOD
|
||||
,
|
||||
sdrSaturation, sdrBrightnessMultiplier
|
||||
,
|
||||
sdrSaturation, sdrBrightnessMultiplier
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
);
|
||||
);
|
||||
#if USE_MIRROR
|
||||
fragColor = pixColors[0];
|
||||
mirrorColor = pixColors[1];
|
||||
|
|
|
|||
|
|
@ -88,34 +88,34 @@ vec4 getColorForCoord(vec2 normalizedCoord, int gradientLength, vec4 gradient[10
|
|||
}
|
||||
|
||||
#if USE_MIRROR
|
||||
vec4[2] getBorder(vec2 v_texcoord, float alpha, vec2 fullSizeUntransformed, float radiusOuter, float thick, float radius, float roundingPower, vec2 topLeft, vec2 fullSize,
|
||||
int gradientLength, vec4 gradient[10], float angle, int gradient2Length, vec4 gradient2[10], float angle2, float gradientLerp
|
||||
vec4[2]
|
||||
#else
|
||||
vec4 getBorder(vec2 v_texcoord, float alpha, vec2 fullSizeUntransformed, float radiusOuter, float thick, float radius, float roundingPower, vec2 topLeft, vec2 fullSize,
|
||||
int gradientLength, vec4 gradient[10], float angle, int gradient2Length, vec4 gradient2[10], float angle2, float gradientLerp
|
||||
vec4
|
||||
#endif
|
||||
getBorder(vec2 v_texcoord, float alpha, vec2 fullSizeUntransformed, float radiusOuter, float thick, float radius, float roundingPower, vec2 topLeft, vec2 fullSize,
|
||||
int gradientLength, vec4 gradient[10], float angle, int gradient2Length, vec4 gradient2[10], float angle2, float gradientLerp
|
||||
#if USE_CM
|
||||
,
|
||||
int sourceTF, int targetTF, mat3 convertMatrix, vec2 srcTFRange, vec2 dstTFRange
|
||||
,
|
||||
int sourceTF, int targetTF, mat3 convertMatrix, vec2 srcTFRange, vec2 dstTFRange
|
||||
#if USE_ICC
|
||||
,
|
||||
highp sampler3D iccLut3D, float iccLutSize
|
||||
,
|
||||
highp sampler3D iccLut3D, float iccLutSize
|
||||
#else
|
||||
#if USE_TONEMAP || USE_SDR_MOD
|
||||
,
|
||||
mat3 targetPrimariesXYZ
|
||||
,
|
||||
mat3 targetPrimariesXYZ
|
||||
#endif
|
||||
#if USE_TONEMAP
|
||||
,
|
||||
float maxLuminance, float dstMaxLuminance, float dstRefLuminance, float srcRefLuminance
|
||||
,
|
||||
float maxLuminance, float dstMaxLuminance, float dstRefLuminance, float srcRefLuminance
|
||||
#endif
|
||||
#if USE_SDR_MOD
|
||||
,
|
||||
float sdrSaturation, float sdrBrightnessMultiplier
|
||||
,
|
||||
float sdrSaturation, float sdrBrightnessMultiplier
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
) {
|
||||
) {
|
||||
vec2 pixCoord = vec2(gl_FragCoord);
|
||||
vec2 pixCoordOuter = pixCoord;
|
||||
vec2 originalPixCoord = v_texcoord;
|
||||
|
|
@ -182,28 +182,29 @@ vec4 getBorder(vec2 v_texcoord, float alpha, vec2 fullSizeUntransformed, float r
|
|||
|
||||
#if USE_CM
|
||||
#if USE_MIRROR
|
||||
vec4[2] pixColors = doColorManagement(pixColor, sourceTF, targetTF, convertMatrix, srcTFRange, dstTFRange
|
||||
vec4[2] pixColors =
|
||||
#else
|
||||
pixColor = doColorManagement(pixColor, sourceTF, targetTF, convertMatrix, srcTFRange, dstTFRange
|
||||
pixColor =
|
||||
#endif
|
||||
doColorManagement(pixColor, sourceTF, targetTF, convertMatrix, srcTFRange, dstTFRange
|
||||
#if USE_ICC
|
||||
,
|
||||
iccLut3D, iccLutSize
|
||||
,
|
||||
iccLut3D, iccLutSize
|
||||
#else
|
||||
#if USE_TONEMAP || USE_SDR_MOD
|
||||
,
|
||||
targetPrimariesXYZ
|
||||
,
|
||||
targetPrimariesXYZ
|
||||
#endif
|
||||
#if USE_TONEMAP
|
||||
,
|
||||
maxLuminance, dstMaxLuminance, dstRefLuminance, srcRefLuminance
|
||||
,
|
||||
maxLuminance, dstMaxLuminance, dstRefLuminance, srcRefLuminance
|
||||
#endif
|
||||
#if USE_SDR_MOD
|
||||
,
|
||||
sdrSaturation, sdrBrightnessMultiplier
|
||||
,
|
||||
sdrSaturation, sdrBrightnessMultiplier
|
||||
#endif
|
||||
#endif
|
||||
);
|
||||
);
|
||||
#endif
|
||||
|
||||
#if USE_MIRROR
|
||||
|
|
|
|||
|
|
@ -205,13 +205,14 @@ vec4 fromLinearNit(vec4 color, int tf, vec2 range) {
|
|||
#endif
|
||||
|
||||
#if USE_MIRROR
|
||||
vec4[2] doColorManagement(vec4 pixColor, int srcTF, int dstTF, mat3 convertMatrix, vec2 srcTFRange, vec2 dstTFRange
|
||||
vec4[2]
|
||||
#else
|
||||
vec4 doColorManagement(vec4 pixColor, int srcTF, int dstTF, mat3 convertMatrix, vec2 srcTFRange, vec2 dstTFRange
|
||||
vec4
|
||||
#endif
|
||||
doColorManagement(vec4 pixColor, int srcTF, int dstTF, mat3 convertMatrix, vec2 srcTFRange, vec2 dstTFRange
|
||||
#if USE_ICC
|
||||
,
|
||||
highp sampler3D iccLut3D, float iccLutSize
|
||||
,
|
||||
highp sampler3D iccLut3D, float iccLutSize
|
||||
#else
|
||||
#if USE_TONEMAP || USE_SDR_MOD
|
||||
,
|
||||
|
|
@ -226,7 +227,7 @@ vec4 doColorManagement(vec4 pixColor, int srcTF, int dstTF, mat3 convertMatrix,
|
|||
float sdrSaturation, float sdrBrightnessMultiplier
|
||||
#endif
|
||||
#endif
|
||||
) {
|
||||
) {
|
||||
pixColor.rgb /= max(pixColor.a, 0.001);
|
||||
pixColor.rgb = toLinearRGB(pixColor.rgb, srcTF);
|
||||
#if USE_ICC
|
||||
|
|
|
|||
|
|
@ -34,32 +34,33 @@ layout(location = 1) out vec4 mirrorColor;
|
|||
void main() {
|
||||
vec4 pixColor = v_color;
|
||||
#if USE_MIRROR
|
||||
vec4[2] pixColors = getShadow(pixColor, v_texcoord, radius, roundingPower, topLeft, fullSize, range, shadowPower, bottomRight
|
||||
vec4[2] pixColors =
|
||||
#else
|
||||
fragColor = getShadow(pixColor, v_texcoord, radius, roundingPower, topLeft, fullSize, range, shadowPower, bottomRight
|
||||
fragColor =
|
||||
#endif
|
||||
getShadow(pixColor, v_texcoord, radius, roundingPower, topLeft, fullSize, range, shadowPower, bottomRight
|
||||
#if USE_CM
|
||||
,
|
||||
sourceTF, targetTF, convertMatrix, srcTFRange, dstTFRange
|
||||
,
|
||||
sourceTF, targetTF, convertMatrix, srcTFRange, dstTFRange
|
||||
#if USE_ICC
|
||||
,
|
||||
iccLut3D, iccLutSize
|
||||
,
|
||||
iccLut3D, iccLutSize
|
||||
#else
|
||||
#if USE_TONEMAP || USE_SDR_MOD
|
||||
,
|
||||
targetPrimariesXYZ
|
||||
,
|
||||
targetPrimariesXYZ
|
||||
#endif
|
||||
#if USE_TONEMAP
|
||||
,
|
||||
maxLuminance, dstMaxLuminance, dstRefLuminance, srcRefLuminance
|
||||
,
|
||||
maxLuminance, dstMaxLuminance, dstRefLuminance, srcRefLuminance
|
||||
#endif
|
||||
#if USE_SDR_MOD
|
||||
,
|
||||
sdrSaturation, sdrBrightnessMultiplier
|
||||
,
|
||||
sdrSaturation, sdrBrightnessMultiplier
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
);
|
||||
);
|
||||
#if USE_MIRROR
|
||||
fragColor = pixColors[0];
|
||||
mirrorColor = pixColors[1];
|
||||
|
|
|
|||
|
|
@ -24,32 +24,33 @@ float modifiedLength(vec2 a, float roundingPower) {
|
|||
}
|
||||
|
||||
#if USE_MIRROR
|
||||
vec4[2] getShadow(vec4 pixColor, vec2 v_texcoord, float radius, float roundingPower, vec2 topLeft, vec2 fullSize, float range, float shadowPower, vec2 bottomRight
|
||||
vec4[2]
|
||||
#else
|
||||
vec4 getShadow(vec4 pixColor, vec2 v_texcoord, float radius, float roundingPower, vec2 topLeft, vec2 fullSize, float range, float shadowPower, vec2 bottomRight
|
||||
vec4
|
||||
#endif
|
||||
getShadow(vec4 pixColor, vec2 v_texcoord, float radius, float roundingPower, vec2 topLeft, vec2 fullSize, float range, float shadowPower, vec2 bottomRight
|
||||
#if USE_CM
|
||||
,
|
||||
int sourceTF, int targetTF, mat3 convertMatrix, vec2 srcTFRange, vec2 dstTFRange
|
||||
,
|
||||
int sourceTF, int targetTF, mat3 convertMatrix, vec2 srcTFRange, vec2 dstTFRange
|
||||
#if USE_ICC
|
||||
,
|
||||
highp sampler3D iccLut3D, float iccLutSize
|
||||
,
|
||||
highp sampler3D iccLut3D, float iccLutSize
|
||||
#else
|
||||
#if USE_TONEMAP || USE_SDR_MOD
|
||||
,
|
||||
mat3 targetPrimariesXYZ
|
||||
,
|
||||
mat3 targetPrimariesXYZ
|
||||
#endif
|
||||
#if USE_TONEMAP
|
||||
,
|
||||
float maxLuminance, float dstMaxLuminance, float dstRefLuminance, float srcRefLuminance
|
||||
,
|
||||
float maxLuminance, float dstMaxLuminance, float dstRefLuminance, float srcRefLuminance
|
||||
#endif
|
||||
#if USE_SDR_MOD
|
||||
,
|
||||
float sdrSaturation, float sdrBrightnessMultiplier
|
||||
,
|
||||
float sdrSaturation, float sdrBrightnessMultiplier
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
) {
|
||||
) {
|
||||
float originalAlpha = pixColor[3];
|
||||
|
||||
bool done = false;
|
||||
|
|
@ -105,28 +106,29 @@ vec4 getShadow(vec4 pixColor, vec2 v_texcoord, float radius, float roundingPower
|
|||
|
||||
#if USE_CM
|
||||
#if USE_MIRROR
|
||||
vec4[2] pixColors = doColorManagement(pixColor, sourceTF, targetTF, convertMatrix, srcTFRange, dstTFRange
|
||||
vec4[2] pixColors =
|
||||
#else
|
||||
pixColor = doColorManagement(pixColor, sourceTF, targetTF, convertMatrix, srcTFRange, dstTFRange
|
||||
pixColor =
|
||||
#endif
|
||||
doColorManagement(pixColor, sourceTF, targetTF, convertMatrix, srcTFRange, dstTFRange
|
||||
#if USE_ICC
|
||||
,
|
||||
iccLut3D, iccLutSize
|
||||
,
|
||||
iccLut3D, iccLutSize
|
||||
#else
|
||||
#if USE_TONEMAP || USE_SDR_MOD
|
||||
,
|
||||
targetPrimariesXYZ
|
||||
,
|
||||
targetPrimariesXYZ
|
||||
#endif
|
||||
#if USE_TONEMAP
|
||||
,
|
||||
maxLuminance, dstMaxLuminance, dstRefLuminance, srcRefLuminance
|
||||
,
|
||||
maxLuminance, dstMaxLuminance, dstRefLuminance, srcRefLuminance
|
||||
#endif
|
||||
#if USE_SDR_MOD
|
||||
,
|
||||
sdrSaturation, sdrBrightnessMultiplier
|
||||
,
|
||||
sdrSaturation, sdrBrightnessMultiplier
|
||||
#endif
|
||||
#endif
|
||||
);
|
||||
);
|
||||
#endif
|
||||
#if USE_MIRROR
|
||||
return pixColors;
|
||||
|
|
|
|||
|
|
@ -67,28 +67,29 @@ void main() {
|
|||
|
||||
#if USE_CM
|
||||
#if USE_MIRROR
|
||||
vec4[2] pixColors = doColorManagement(pixColor, sourceTF, targetTF, convertMatrix, srcTFRange, dstTFRange
|
||||
vec4[2] pixColors =
|
||||
#else
|
||||
pixColor = doColorManagement(pixColor, sourceTF, targetTF, convertMatrix, srcTFRange, dstTFRange
|
||||
pixColor =
|
||||
#endif
|
||||
doColorManagement(pixColor, sourceTF, targetTF, convertMatrix, srcTFRange, dstTFRange
|
||||
#if USE_ICC
|
||||
,
|
||||
iccLut3D, iccLutSize
|
||||
,
|
||||
iccLut3D, iccLutSize
|
||||
#else
|
||||
#if USE_TONEMAP || USE_SDR_MOD
|
||||
,
|
||||
targetPrimariesXYZ
|
||||
,
|
||||
targetPrimariesXYZ
|
||||
#endif
|
||||
#if USE_TONEMAP
|
||||
,
|
||||
maxLuminance, dstMaxLuminance, dstRefLuminance, srcRefLuminance
|
||||
,
|
||||
maxLuminance, dstMaxLuminance, dstRefLuminance, srcRefLuminance
|
||||
#endif
|
||||
#if USE_SDR_MOD
|
||||
,
|
||||
sdrSaturation, sdrBrightnessMultiplier
|
||||
,
|
||||
sdrSaturation, sdrBrightnessMultiplier
|
||||
#endif
|
||||
#endif
|
||||
);
|
||||
);
|
||||
#endif
|
||||
#if USE_MIRROR
|
||||
pixColor = pixColors[0];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue