diff options
author | Erik Reider <[email protected]> | 2024-02-27 18:05:58 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-02-27 18:05:58 +0100 |
commit | 7f0883b383b73af7bc68dcf8c2ee845c5eab5807 (patch) | |
tree | ff13a416200ac372d0ae303e5996bb9a22f819dd /render/fx_renderer/gles2/shaders/stencil_mask.frag | |
parent | 5b6862c981eb5541888f625cd93e7775cabe06b0 (diff) |
[FX Renderer] Add blur (#30)
* Initial blur implementation
* Added additional blur effects from SwayFX
* Simplified blur pass functions to match the other pass functions
* Minor fixes
* Added support for optimized blur
* tinywl: Don't set decoration values every frame
* Updated public blur function docs
* Simplified blur buffer management
* Moved ignore transparent bool into a per buffer option
* Clip the scene_buffer when blur is enabled
* Added back corner and shadow checks in opaque_region function
* Renamed fx_render_blur_options to fx_render_blur_pass_options
* Fixed nits
* Removed unused fx_framebuffer_bind_wlr_fbo function
* Removed wlr_scene impl. Should be moved into future PR instead
* Made blur impl independent of wlr_scene
* Moved shader init back into fx_renderer.c
* Renamed fx_framebuffer_get_or_create_bufferless to fx_framebuffer_get_or_create_custom
Diffstat (limited to 'render/fx_renderer/gles2/shaders/stencil_mask.frag')
-rw-r--r-- | render/fx_renderer/gles2/shaders/stencil_mask.frag | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/render/fx_renderer/gles2/shaders/stencil_mask.frag b/render/fx_renderer/gles2/shaders/stencil_mask.frag index 523adc8..e1fd76a 100644 --- a/render/fx_renderer/gles2/shaders/stencil_mask.frag +++ b/render/fx_renderer/gles2/shaders/stencil_mask.frag @@ -11,12 +11,12 @@ uniform vec2 position; uniform float radius; void main() { - vec2 q = abs(gl_FragCoord.xy - position - half_size) - half_size + radius; - float dist = min(max(q.x,q.y), 0.0) + length(max(q, 0.0)) - radius; - float smoothedAlpha = 1.0 - smoothstep(-1.0, 0.5, dist); - gl_FragColor = mix(vec4(0.0), vec4(1.0), smoothedAlpha); + vec2 q = abs(gl_FragCoord.xy - position - half_size) - half_size + radius; + float dist = min(max(q.x,q.y), 0.0) + length(max(q, 0.0)) - radius; + float smoothedAlpha = 1.0 - smoothstep(-1.0, 0.5, dist); + gl_FragColor = mix(vec4(0.0), vec4(1.0), smoothedAlpha); - if (gl_FragColor.a < 1.0) { - discard; - } + if (gl_FragColor.a < 1.0) { + discard; + } } |