Unknown6656 / WPFPixelShaderLibrary

A Pixel Shader Library for WPF UI Controls written in HLSL
GNU General Public License v3.0
40 stars 4 forks source link
control csharp effects hlsl hlsl-wpf-effects library net pixel shader wpf

WPFPixelShaderLibrary

A Pixel Shader library to be used in WPF's XAML.

Nuget (with prereleases) | NuGet Package

Requires .NET Framework v.4.6 (or higher) or .NET Core 3.0 (or higher).

Have a look at https://github.com/Unknown6656-Megacorp/Unknown6656.CVGLPixelShader for a rough Python-equivalent of this repo.

Usage

Just add xmlns:fx="https://unknown6656.com/wpfpslib" to your XAML namespace definitions to use the effects:

<Window x:Class="MyTestApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:fx="https://unknown6656.com/wpfpslib"
        ...
        />
    <Grid>
        <Button Width="100" Height="25">
            <Button.Effect>
                <fx:PixelationEffect Count="40,20"/>
            </Button.Effect>
            PRESS ME !
        </Button>
    </Grid>
</Window>

Result:

The complete documentation will be available when I will have more free time!