Skip to content

Conversation

@kRHYME7
Copy link
Contributor

@kRHYME7 kRHYME7 commented May 23, 2025

Pull Request

Description

Adding hyprland shader options!

Use Case

  • Greatly help for accessibility by having a pre-configured template, users can copy this file and adjust up to 4 types of visions: // 0:Normal vision, 1:Protanopia, 2:Deuteranopia, 3:Tritanopia
  • Then they can adjust the intensity in appropriation.
  • Now, why do normal vision care at all? Mode 0 has an option for -1.0 - +1.0 adjustments. Where -1 leans to grayscale and +1 for saturation, which should greatly help productivity!
  • Also I want to have paper texture hehe.

Preview

color-vision // Protanopia

Image

Grayscale!

Image

normal vision with 0.4 saturation

Image

the classic invert

Image

Paper

image


Usage:

All shaders from HyDE are capable to be overridden by making a separate file with the same name and use .inc as suffix instead of .frag

Here's a snippet on one of the shader files.

/*
To override this parameters create a file named './grayscale.inc'
We only need to match the file name and use 'inc' to incdicate that
this is an "include" file
Example:

┌────────────────────────────────────────────────────────────────────────────┐
  │ // file: ./grayscale.inc                                                   │
  │ // integer: 0:PAL, 1:HDTV, 2:HDR                                           │
  │ #define GRAYSCALE_LUMINOSITY_PAL 0                                         │
  │ // integer: 0:HDTV, 1:HDR, 2:HDR                                           │
  │ #define GRAYSCALE_LUMINOSITY_HDR 2                                         │
  │ // integer: 0:HDTV, 1:HDR, 2:HDR                                           │
  │ #define GRAYSCALE_LUMINOSITY_HDT 1                                         │
  │ // integer: 0:No effect, 1:Lightness, 2:Average                            │
  │ #define GRAYSCALE_LIGHTNESS 1                                              │
  │ // integer: 0:No effect, 1:Lightness, 2:Average                            │
  │ #define GRAYSCALE_AVERAGE 2                                                │
  │                                                                            │
  └────────────────────────────────────────────────────────────────────────────┘
 */

CLI

shaders.sh --select - opens a rofi selector to choose shader. It will compile the file.inc then file.frag for HyDE to use.

Basically cat file.inc file.frag > .compiled.cache.glsl

@kRHYME7 kRHYME7 changed the base branch from master to dev May 23, 2025 02:35
@kRHYME7 kRHYME7 requested a review from Copilot May 23, 2025 03:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces Hyprland shader options to improve accessibility and visual effects by providing a set of pre-configured, overridable shader templates. Key changes include adding a new shader selection/compilation script, updating the Hyprland configuration to integrate shader functionality, and providing multiple shader files (e.g. wallbash, vibrance, paper, oled, color-vision, etc.) to deliver various visual effects.

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 8 comments.

File Description
Configs/.local/share/hyde/hyprland.conf Added environment variable and configuration references for the compiled shader file.
Configs/.local/lib/hyde/shaders.sh Introduced a new script to compile and select shaders using rofi and manage shader includes.
Configs/.config/hypr/shaders/* New shader files (fragment shaders and include files) implementing multiple visual effects.
Configs/.config/hypr/shaders.conf Updated configuration to point to the new disable shader by default.

@kRHYME7 kRHYME7 requested a review from Copilot May 23, 2025 03:40
@kRHYME7
Copy link
Contributor Author

kRHYME7 commented May 23, 2025

@HyDE-Project/testers

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for configurable Hyprland shaders by introducing a selection script, shader templates, and wiring them into the main configuration.

  • Introduces $SCREEN_SHADER_COMPILED, includes shaders.conf, and sets decoration:screen_shader in hyprland.conf
  • Adds shaders.sh to pick, concatenate, and cache .frag/.inc shader files
  • Supplies a variety of new shader .frag and .inc templates plus cache and ignore files

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Configs/.local/share/hyde/hyprland.conf Added path for compiled shader, sourced shaders.conf, and enabled decoration:screen_shader
Configs/.local/lib/hyde/shaders.sh New Bash script for interactive shader selection and compilation
Configs/.config/hypr/shaders/.gitignore Ignore rules for shader directory
Configs/.config/hypr/shaders/.compiled.cache.glsl Initial stub compiled shader
Configs/.config/hypr/shaders.conf Generated shader configuration for Hyprland
Configs/.config/hypr/shaders/*.frag & *.inc New shader templates (wallbash, vibrance, paper, etc.)
Comments suppressed due to low confidence (3)

Configs/.config/hypr/shaders/grayscale.frag:36

  • Macro GRAYSCALE_LUMINOSITY_HDT likely intended as GRAYSCALE_LUMINOSITY_HDTV to match the HDTV standard and avoid confusion.
#ifndef GRAYSCALE_LUMINOSITY_HDT

Configs/.config/hypr/shaders/custom.frag:87

  • Missing space and leading zero before the value; it should read #define SHADER_VIBRANCE_SKIN_TONE_PROTECTION 0.75 for clarity and consistency.
#define SHADER_VIBRANCE_SKIN_TONE_PROTECTION.75// Balance: 0.0 to 1.0

Configs/.config/hypr/shaders/custom.frag:71

  • Using true in a preprocessor macro may not expand as a numeric value for #if COLOR_VISION_ENABLED==1; replace with 1 or 0.
#define COLOR_VISION_ENABLED true// Set to 1 to enable color vision deficiency simulation

@voidrc
Copy link

voidrc commented May 23, 2025

@HyDE-Project/testers

After Lessons i will try out

@UnaTried
Copy link

I'll also try this in about 5-7 hours.

@amit-0i
Copy link
Member

amit-0i commented May 23, 2025

can you update the waybar_rework branch aswell? (hehe thank you)

Edit:- nevermind, i now realized shaders is a different branch

@Prof-Shiba
Copy link
Member

i'll try it in a bit

that paper texture kinda goes hard ngl

@amit-0i
Copy link
Member

amit-0i commented May 23, 2025

i have found an issue, when using invert-colors shader the screen starts flickering. i highly doubt its an nvidia driver issue, but i'll like to know about the experience of other testers.

im not visually impaired or color blind, so i cant personally speak to how effective the color-vision filter is but the filters like blue-light-filter, greyscale, paper and vibrance are working great.

great work khing!

(below is the screenshot of the flickering)
image

@kRHYME7
Copy link
Contributor Author

kRHYME7 commented May 23, 2025

Does the flickering happen too frequently? Or it only occur during shader changes?

@amit-0i
Copy link
Member

amit-0i commented May 23, 2025

it happens mostly when there is no apps on the workspace and when switching wallpapers. but some minor flickers in applications too

Edit:- looks like closing apps triggering the flickers

@Prof-Shiba
Copy link
Member

Invert colors also bugs out for me. Same thing with flickering everywhere.

Also, with the color vision option, it looks visually like it's the same as disabled. It seems a bit redundant, unless I'm missing something.

@kRHYME7
Copy link
Contributor Author

kRHYME7 commented May 23, 2025

like it's the same as disabled. It seems a bit redundant, unless I'm missing something.

It is a normal vision by default. The file has instructions on how to use it.

As for the invert , if it flickers seriously I will just remove it for now.

@kRHYME7
Copy link
Contributor Author

kRHYME7 commented May 23, 2025

for flickering try to add

debug:damage_tracking = 0

in your userprefs.conf

though this consumes some GPU juice.

@Prof-Shiba
Copy link
Member

that made it significantly better. It's still not perfect (a little bit of flashing when closing windows and moving stuff around) but its like 90% better and fairly usable, at least for me.

@amit-0i
Copy link
Member

amit-0i commented May 24, 2025

for flickering try to add

debug:damage_tracking = 0

in your userprefs.conf

though this consumes some GPU juice.

250524_17h09m13s_recording.mp4

after adding the above, the flickering is limited to only closing windows.

@kRHYME7
Copy link
Contributor Author

kRHYME7 commented May 24, 2025

What happens if you disable blur. Maybe it's hyprland?

@amit-0i
Copy link
Member

amit-0i commented May 24, 2025

What happens if you disable blur. Maybe it's hyprland?

when blur is disabled, instead of the closing window's trails, the whole screen flashes

@kRHYME7
Copy link
Contributor Author

kRHYME7 commented May 24, 2025

Haha hmm 🤔 I'm not capable of fixing this as of the moment. Should I just remove the feature for now?

@amit-0i
Copy link
Member

amit-0i commented May 24, 2025

nah its not that big of a deal tbh. we should wait for amd users if they are facing the same issue.

@kRHYME7
Copy link
Contributor Author

kRHYME7 commented May 25, 2025

we should wait for amd users if they are facing the same issue.

Will merge this to dev now. We can simply nuke broken frag or add warning in case. So far the reports are hyprland related, so we can't really fix it.


If you read the invert-colors.frag it's very simple so I don't know if we can solve it via shader file or hyprland's pre-processor.

Also, I noticed the so-called flicker is from hyprland's effects. It looks like shaders are not being applied for a split second.

@kRHYME7 kRHYME7 merged commit 813e13b into dev May 25, 2025
2 checks passed
@rubiin rubiin deleted the shaders branch May 25, 2025 19:29
kRHYME7 added a commit that referenced this pull request May 30, 2025
This is an automated PR to promote changes from `dev` to `master`.
Please review and test before merging.


See [TESTING.md](./TESTING.md) for complete testing instructions.


According to our release policy, this PR is expected to be merged on:
**Friday**
Testers are encouraged to test the changes before merging.
Please note that this schedule may be adjusted based on the needs of the
project.

---
* chore Merge branch 'master' into dev (2db2112) by Khing
* fix: improve mediaplayer.py `max_length` behavior in case of extremely
long artist and track (#701) (bb1ed13) by Ilya Bogdanov
* feat: add keybinding for rofi animation select menu (#698) (0464c8d)
by Rubin Bhandari
* feat: add keybinding for rofi animation select menu (d534f61) by Ilya
Bogdanov
* feat: use `duf` as alias for `df` (#693) (f9fd4b6) by Rubin Bhandari
* chore Merge branch 'dev' into feature-duf (7aef008) by Rubin Bhandari
* chore Add Optimized Animation Config and Enhanced IBM Hyprlock Theme
(#681) (7e1ba15) by Rubin Bhandari
* chore Merge branch 'dev' into master (bf58a9b) by Rubin Bhandari
* feat: use `duf` as alias for `df` (2373b81) by Ilya Bogdanov
* doc: remove copied line (#688) (adb788d) by ProfShiba
* fix: change config names in `uninstall.sh` note to actual values
(#684) (81eacca) by Ilya Bogdanov
* chore Adding enhanced IBM hyprlock with transparency, and blur support
(0e2953c) by xaicat
* chore LimeFrenzy - An optimized animation config with smooth and
fluent transitions (8f92b21) by xaicat
* fix: explicitly mention playerctl (#679) (4f0b15d) by Rubin Bhandari
* fix: systemupdate (a99a15a) by kRHYME7
* fix: systemupdate (a584569) by kRHYME7
* fix: update hypridle config syntax (#676) (ba6c273) by Rubin Bhandari
* fix: Fix #677/graphic-loading for non-interactive shell (#678)
(d8eb7f9) by Rubin Bhandari
* chore Update Configs/.user.zsh (ffa2db0) by Rubin Bhandari
* chore Merge branch 'master' into dev (d538f66) by Khing
* fix: Fix #677 graphic-loading for non-interactive shell (8ed764d) by
comrumino
* feat: Add dropdown terminal (#673) (29e0b0e) by Rubin Bhandari
* doc: add dropdown terminal keybind (2d72567) by ProfShiba
* chore Update keybindings.conf (6d17828) by Khing
* chore Merge branch 'dev' into dropdown (d23f742) by Khing
* chore Merge branch 'master' into dev (d71b42b) by Khing
* chore Update Configs/.config/hypr/keybindings.conf (1e91a5f) by Rubin
Bhandari
* chore Merge branch 'dev' into dropdown (2f398db) by Rubin Bhandari
* fix: Some QOL (cdb73c1) by kRHYME7
* chore Shaders (#656) (813e13b) by Khing
* feat: dropdown terminal (14e7b4c) by ProfShiba
* fix: includes the XDG cache directory in the discord wallbash script
(#671) (2a5e8a5) by Keegan Wright
* chore config: update .zshrc and .zshenv to reference .user.zsh instead
of .hyde.zshrc (#668) (b0e6d71) by dagiikg9134
* fix: Missing scrollbars on Discord Clients (#666) (ebdd8a9) by
Xyloflake
* chore Merge branch 'master' into dev (acf8ec0) by Khing
* docs: add custom keybinding example for gamelauncher.sh (#518)
(0844927) by jacob
---

Please review the changes carefully before merging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants