Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-defined shaders #110

Open
CyberShadow opened this issue Feb 11, 2023 · 4 comments · May be fixed by #119
Open

User-defined shaders #110

CyberShadow opened this issue Feb 11, 2023 · 4 comments · May be fixed by #119
Labels
enhancement New feature or request

Comments

@CyberShadow
Copy link

Hi, thank you for this project.

I'm wondering if this project could have something equivalent to picom's window-shader-fg-rule, which allows specifying a user-supplied GLSL file to use for windows matching user-defined rules.

Such a feature would allow achieving e.g. the following:

  • Smart color inversion (for applications not supporting a "dark mode")
  • Color-key based transparency (for applications without native transparency support)
  • Ad-hoc hacks / accessibility improvements (adding guides/crosshairs, color correction for color blindness)

Upstream issue (closed WONTFIX): swaywm/sway#3652

@CyberShadow CyberShadow added the enhancement New feature or request label Feb 11, 2023
@WillPower3309
Copy link
Owner

WillPower3309 commented Feb 13, 2023

This should be relatively easy to implement, and I'd accept any PRs implementing this

@WillPower3309
Copy link
Owner

For more context, we could implement this with an initial rendering pass that applies the user defined shader prior to our shaders

@head-gardener head-gardener linked a pull request Mar 10, 2023 that will close this issue
@xplshn
Copy link

xplshn commented May 6, 2024

Maybe, need to investigate how modular Vulkan shaders are, and how this would interact with a potential migration to compute shaders.

Why not use "slang"?

Arguments in favor of slang would be:

  • Slang is backwards-compatible with most existing HLSL code. It is possible to start taking advantage of Slang's benefits without rewriting or porting your shader codebase.
  • The Slang compiler can generate code for a wide variety of targets and APIs: D3D12, Vulkan, D3D11, OpenGL, CUDA, and CPU. Slang code can be broadly portable, but still take advantage of the unique features of each platform.
  • And lots more that aren't related to Slang's compatibility with platforms but rather the language itself

@WillPower3309
Copy link
Owner

dependent on wlrfx/scenefx#53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants