From 665f52966e859562878473272384468cafc9ba73 Mon Sep 17 00:00:00 2001 From: Nick Kovalsky Date: Sat, 19 Oct 2024 21:54:47 +0300 Subject: [PATCH] v3 shaders progress --- src/Directory.Build.props | 2 +- src/samples/Sandbox/AppShell.xaml | 2 +- src/samples/Sandbox/MainPageDev.xaml | 78 ++++++++++++++++++- src/samples/Sandbox/MainPageDev.xaml.cs | 51 ++++++++++-- .../Shaders/CarouselWithTransitions.cs | 6 +- 5 files changed, 126 insertions(+), 13 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 66f8081f..6edb0ec9 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,6 +1,6 @@ - false + true diff --git a/src/samples/Sandbox/AppShell.xaml b/src/samples/Sandbox/AppShell.xaml index 3003387c..ecc50461 100644 --- a/src/samples/Sandbox/AppShell.xaml +++ b/src/samples/Sandbox/AppShell.xaml @@ -9,7 +9,7 @@ diff --git a/src/samples/Sandbox/MainPageDev.xaml b/src/samples/Sandbox/MainPageDev.xaml index 9c5d71ed..a9143126 100644 --- a/src/samples/Sandbox/MainPageDev.xaml +++ b/src/samples/Sandbox/MainPageDev.xaml @@ -5,9 +5,11 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:controls="clr-namespace:Sandbox.Views.Controls" xmlns:draw="http://schemas.appomobi.com/drawnUi/2023/draw" + xmlns:mauiNet8="clr-namespace:MauiNet8" xmlns:system="clr-namespace:System;assembly=System.Runtime" xmlns:views="clr-namespace:Sandbox.Views" x:Name="ThisPage" + x:DataType="mauiNet8:MainPageDev" BackgroundColor="Black"> + + + + + + + + + + + + + Type="Column" + UseCache="None"> + + + + + + + + + + + + + + + + + + + + 1) diff --git a/src/samples/Sandbox/Views/Controls/Shaders/CarouselWithTransitions.cs b/src/samples/Sandbox/Views/Controls/Shaders/CarouselWithTransitions.cs index cadd2fed..0261a680 100644 --- a/src/samples/Sandbox/Views/Controls/Shaders/CarouselWithTransitions.cs +++ b/src/samples/Sandbox/Views/Controls/Shaders/CarouselWithTransitions.cs @@ -1,4 +1,3 @@ -using System.Diagnostics; using System.Numerics; namespace Sandbox.Views.Controls; @@ -12,7 +11,8 @@ public CarouselWithTransitions() { Effect = new() { - ShaderSource = ShaderFilename + ShaderSource = ShaderFilename, + ShaderTemplate = @"Shaders\transitions\_template.sksl" }; } @@ -54,6 +54,8 @@ protected virtual void OnFromToChanged() } + + protected override void OnScrollProgressChanged() { if (ScrollProgress >= 0 && ScrollProgress <= 1) //ignore bouncing