Metadata for a single animation shader effect (transition). More...
#include <phosphor-animation/include/PhosphorAnimation/AnimationShaderEffect.h>
Classes | |
| struct | ParameterInfo |
| Declared shader inputs beyond the standard set (iTime, iFrame, etc.). More... | |
| struct | TextureSlot |
| User texture slot. More... | |
Public Types | |
| enum class | FboExtentKind { Anchor , Surface } |
| How wide the shader effect's render target is — relative to its anchor (default), or filling the surface scene root. More... | |
Public Member Functions | |
| bool | isValid () const |
| QJsonObject | toJson () const |
| bool | operator== (const AnimationShaderEffect &other) const |
| bool | operator!= (const AnimationShaderEffect &other) const |
Static Public Member Functions | |
| static AnimationShaderEffect | fromJson (const QJsonObject &obj) |
Public Attributes | |
| QString | id |
| Stable identifier — lookup key in the registry. | |
| QString | name |
| Human-readable display name (localizable by the consumer). | |
| QString | description |
| One-line description for settings UI tooltips. | |
| QString | author |
| Author attribution. | |
| QString | version |
| Semantic version of this effect pack. | |
| QString | category |
| Category for settings-UI grouping (e.g. "Fade", "Geometric", "Glitch"). | |
| QString | fragmentShaderPath |
| Path to the fragment shader (relative to the effect dir). | |
| QString | vertexShaderPath |
| Path to the vertex shader (relative to the effect dir). | |
| QString | sourceDir |
| Resolved absolute directory containing this effect's assets. | |
| bool | isUserEffect = false |
| Whether this effect was loaded from a user-local directory. | |
| QString | previewPath |
| Preview image path (relative to the effect dir). For settings UI. | |
| QStringList | bufferShaderPaths |
| Buffer-pass shader paths (relative to effect dir). | |
| bool | isMultipass = false |
| Opt-in multipass mode. | |
| bool | useWallpaper = false |
| Bind the user's wallpaper as a sampler. | |
| bool | bufferFeedback = false |
Enable per-pass feedback (last frame's buffer is sampleable as iChannel<N>). | |
| qreal | bufferScale = 1.0 |
| Render-target scale relative to the surface size. | |
| QString | bufferWrap |
| Default wrap mode for all buffer samplers. | |
| QStringList | bufferWraps |
Per-buffer wrap-mode overrides; index aligns with bufferShaderPaths. | |
| QString | bufferFilter |
| Default filter mode for all buffer samplers. | |
| QStringList | bufferFilters |
Per-buffer filter-mode overrides; index aligns with bufferShaderPaths. | |
| bool | useDepthBuffer = false |
| Allocate a depth buffer alongside the colour FBO so the shader can sample window depth. | |
| FboExtentKind | fboExtentKind = FboExtentKind::Anchor |
| QList< ParameterInfo > | parameters |
| QList< TextureSlot > | textures |
Static Public Attributes | |
| static constexpr qreal | kMinBufferScale = 0.125 |
Lower / upper bounds on bufferScale (multipass FBO downscale factor). | |
| static constexpr qreal | kMaxBufferScale = 1.0 |
Metadata for a single animation shader effect (transition).
Distinct from PhosphorRendering::ShaderEffect which renders persistent zone backgrounds. An AnimationShaderEffect describes a transition — dissolve, slide, morph, etc. — applied between two visual states over a finite duration.
Each effect is keyed by a stable id string (e.g. "dissolve", "slide", "glitch"). Plugin-authored effects use reverse-domain or namespaced ids ("myplugin.sparkle") to avoid collisions with built-in effects.
Each effect carries a single fragmentShaderPath — the same GLSL source is used on both the QtQuick and KWin compositor paint paths. PhosphorRendering::ShaderNodeRhi handles texture binding and coordinate conventions at the RHI level, so separate per-backend shader variants are not needed.
Each effect declares named parameters with type, default, min/max. Per-event parameter overrides live on ShaderProfile, not here.
|
strong |
How wide the shader effect's render target is — relative to its anchor (default), or filling the surface scene root.
• Anchor (default): FBO covers the captured anchor 1:1. Used by fragment-only effects (dissolve, glitch, …) whose math stays inside vTexCoord ∈ [0, 1] over the anchor.
• Surface: FBO covers the anchor's enclosing surface scene root (the wl_surface size on the daemon path). Used by effects that need to render past the captured anchor (fly-in translates the card across the surface, broken-glass fires shards into the surrounding screen). Authors who pick Surface typically ship a custom vertex shader that uses iAnchorPosInFbo / iAnchorSize / iResolution to position the card within the FBO; the fragment shader then either reads vTexCoord directly (if the vert remaps the quad to the anchor's region — fly-in) or calls anchorRemap to convert surface-UV back to anchor-space (broken-glass, morph).
Mirrors the public fboExtent JSON grammar: "anchor" → Anchor, "surface" → Surface. No other forms are accepted.
| Enumerator | |
|---|---|
| Anchor | |
| Surface | |
|
static |
|
inline |
|
inline |
| bool PhosphorAnimationShaders::AnimationShaderEffect::operator== | ( | const AnimationShaderEffect & | other | ) | const |
| QJsonObject PhosphorAnimationShaders::AnimationShaderEffect::toJson | ( | ) | const |
| QString PhosphorAnimationShaders::AnimationShaderEffect::author |
Author attribution.
| bool PhosphorAnimationShaders::AnimationShaderEffect::bufferFeedback = false |
Enable per-pass feedback (last frame's buffer is sampleable as iChannel<N>).
Requires isMultipass. Daemon-only.
| QString PhosphorAnimationShaders::AnimationShaderEffect::bufferFilter |
Default filter mode for all buffer samplers.
Empty = ShaderEffect default. Daemon-only.
| QStringList PhosphorAnimationShaders::AnimationShaderEffect::bufferFilters |
Per-buffer filter-mode overrides; index aligns with bufferShaderPaths.
Daemon-only.
| qreal PhosphorAnimationShaders::AnimationShaderEffect::bufferScale = 1.0 |
Render-target scale relative to the surface size.
Clamped to [0.125, 1.0] at fromJson time. Daemon-only — the compositor path doesn't allocate auxiliary FBOs.
| QStringList PhosphorAnimationShaders::AnimationShaderEffect::bufferShaderPaths |
Buffer-pass shader paths (relative to effect dir).
When non-empty and isMultipass is true, the daemon's ShaderEffect runs these as intermediate passes before the main fragment shader.
| QString PhosphorAnimationShaders::AnimationShaderEffect::bufferWrap |
Default wrap mode for all buffer samplers.
Sibling of bufferWraps (per-buffer overrides). Empty = ShaderEffect default. Daemon-only.
| QStringList PhosphorAnimationShaders::AnimationShaderEffect::bufferWraps |
Per-buffer wrap-mode overrides; index aligns with bufferShaderPaths.
Daemon-only.
| QString PhosphorAnimationShaders::AnimationShaderEffect::category |
Category for settings-UI grouping (e.g. "Fade", "Geometric", "Glitch").
| QString PhosphorAnimationShaders::AnimationShaderEffect::description |
One-line description for settings UI tooltips.
| FboExtentKind PhosphorAnimationShaders::AnimationShaderEffect::fboExtentKind = FboExtentKind::Anchor |
| QString PhosphorAnimationShaders::AnimationShaderEffect::fragmentShaderPath |
Path to the fragment shader (relative to the effect dir).
The same source is used on both QtQuick and KWin paths — ShaderNodeRhi handles backend differences at the RHI level.
| QString PhosphorAnimationShaders::AnimationShaderEffect::id |
Stable identifier — lookup key in the registry.
| bool PhosphorAnimationShaders::AnimationShaderEffect::isMultipass = false |
Opt-in multipass mode.
When true and bufferShaderPaths is non-empty, the daemon path runs those buffer passes before the main fragment. The kwin-effect compositor path is single-pass only; multipass effects degrade to single-pass there with a diagnostic log (see AnimationShaderContract.h).
| bool PhosphorAnimationShaders::AnimationShaderEffect::isUserEffect = false |
Whether this effect was loaded from a user-local directory.
|
staticconstexpr |
|
staticconstexpr |
Lower / upper bounds on bufferScale (multipass FBO downscale factor).
0.125 means a 1/8 downscale on each axis (1/64 area — the lowest cost-floor that still gives Shadertoy-style buffer effects something to work with). 1.0 means full-resolution FBOs (no downscale). Hosted here as the source-of-truth that fromJson's clamp + the round-trip stability comment in toJson reference; a future runtime that consumes bufferScale from a non-JSON source can read these constants directly.
| QString PhosphorAnimationShaders::AnimationShaderEffect::name |
Human-readable display name (localizable by the consumer).
| QList<ParameterInfo> PhosphorAnimationShaders::AnimationShaderEffect::parameters |
| QString PhosphorAnimationShaders::AnimationShaderEffect::previewPath |
Preview image path (relative to the effect dir). For settings UI.
| QString PhosphorAnimationShaders::AnimationShaderEffect::sourceDir |
Resolved absolute directory containing this effect's assets.
| QList<TextureSlot> PhosphorAnimationShaders::AnimationShaderEffect::textures |
| bool PhosphorAnimationShaders::AnimationShaderEffect::useDepthBuffer = false |
Allocate a depth buffer alongside the colour FBO so the shader can sample window depth.
Daemon-only.
| bool PhosphorAnimationShaders::AnimationShaderEffect::useWallpaper = false |
Bind the user's wallpaper as a sampler.
Daemon-only — the compositor path has no wallpaper plumbing so the field is observed only by SurfaceAnimator::attachShaderToAnchor.
| QString PhosphorAnimationShaders::AnimationShaderEffect::version |
Semantic version of this effect pack.
| QString PhosphorAnimationShaders::AnimationShaderEffect::vertexShaderPath |
Path to the vertex shader (relative to the effect dir).
Empty = use the library's built-in fullscreen-quad vertex shader.