FrostedGlassEffect
A pixel shader effect that scatters each pixel of its input by a small pseudo-random amount, which reads as frosted or etched glass laid over it.
public class FrostedGlassEffect : ShaderEffect
Inherits from / implements: ShaderEffect
Remarks
The randomness is computed from the coordinate rather than sampled from a noise texture, so the effect ships as a shader and nothing else. That also makes the scatter fixed for a given Seed: animate the seed, not just the frostiness, to make the glass shimmer.
Members at a glance
FrostedGlassEffect | Initializes a new instance of the FrostedGlassEffect class. |
Frostiness | How far a pixel may be displaced, in texture coordinates. A useful range is about 0.002 to 0.05; beyond that the input stops being readable. |
Input | The image this effect is applied to. It is set for you when the effect is attached to an element; set it directly only when using the effect as a brush. |
Seed | Shifts the scatter pattern. Any value gives a different arrangement of the same frostiness, so animating it shimmers the glass without changing how rough it looks. |
FrostinessProperty | Identifies the Frostiness dependency property. |
InputProperty | Identifies the Input dependency property. |
SeedProperty | Identifies the Seed dependency property. |
Constructors
FrostedGlassEffect
Initializes a new instance of the FrostedGlassEffect class.
Properties
Frostiness
How far a pixel may be displaced, in texture coordinates. A useful range is about 0.002 to 0.05; beyond that the input stops being readable.
Input
The image this effect is applied to. It is set for you when the effect is attached to an element; set it directly only when using the effect as a brush.
Seed
Shifts the scatter pattern. Any value gives a different arrangement of the same frostiness, so animating it shimmers the glass without changing how rough it looks.
Fields
FrostinessProperty
Identifies the Frostiness dependency property.
InputProperty
Identifies the Input dependency property.
SeedProperty
Identifies the Seed dependency property.