Skip to content

Commit d670c97

Browse files
committed
update readme.md GLSL shader
1 parent 3db20b3 commit d670c97

4 files changed

Lines changed: 95 additions & 2 deletions

File tree

FishWave/Preferences.xaml.cs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ private void ApplyVideoPipelineSettings()
8282
var ctx = _controller.Context;
8383

8484
// Hardware Acceleration
85-
MpvApi.SetPropertyString(ctx, "hwdec", App.Store.HardwareAcceleration ? App.Store.HardwareDecoder : "no");
85+
var hwdec = App.Store.HardwareAcceleration ? App.Store.HardwareDecoder : "no";
86+
MpvApi.SetPropertyString(ctx, "hwdec", hwdec);
87+
ApplyRendererForDecoder(ctx, hwdec);
8688

8789
// High Quality Upscaling
8890
if (App.Store.HighQualityUpscaling)
@@ -104,6 +106,27 @@ private void ApplyVideoPipelineSettings()
104106
MpvApi.SetPropertyString(ctx, "deband", App.Store.HardwareDebanding ? "yes" : "no");
105107
}
106108

109+
private static void ApplyRendererForDecoder(System.IntPtr ctx, string hwdec)
110+
{
111+
if (string.Equals(hwdec, "vulkan", System.StringComparison.OrdinalIgnoreCase) ||
112+
string.Equals(hwdec, "vulkan-copy", System.StringComparison.OrdinalIgnoreCase))
113+
{
114+
MpvApi.SetPropertyString(ctx, "vo", "gpu-next");
115+
MpvApi.SetPropertyString(ctx, "gpu-api", "vulkan");
116+
}
117+
else if (string.Equals(hwdec, "d3d11va", System.StringComparison.OrdinalIgnoreCase) ||
118+
string.Equals(hwdec, "d3d11va-copy", System.StringComparison.OrdinalIgnoreCase))
119+
{
120+
MpvApi.SetPropertyString(ctx, "vo", "gpu-next,gpu");
121+
MpvApi.SetPropertyString(ctx, "gpu-api", "d3d11");
122+
}
123+
else
124+
{
125+
MpvApi.SetPropertyString(ctx, "vo", "gpu-next,gpu");
126+
MpvApi.SetPropertyString(ctx, "gpu-api", "vulkan,d3d11");
127+
}
128+
}
129+
107130
private void SelectComboItem(System.Windows.Controls.ComboBox comboBox, string value)
108131
{
109132
foreach (ComboBoxItem item in comboBox.Items)

FishWave/Services/MediaPlayerService.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ private void ApplyVideoPreferences()
255255
_hwAccelEnabled = App.Store?.HardwareAcceleration ?? true;
256256
var hwdec = _hwAccelEnabled ? (App.Store?.HardwareDecoder ?? "auto") : "no";
257257
MpvApi.SetPropertyString(_controller.Context, "hwdec", hwdec);
258+
ApplyRendererForDecoder(hwdec);
258259

259260
if (App.Store?.HighQualityUpscaling == true)
260261
{
@@ -272,6 +273,27 @@ private void ApplyVideoPreferences()
272273
MpvApi.SetPropertyString(_controller.Context, "deband", App.Store?.HardwareDebanding == true ? "yes" : "no");
273274
}
274275

276+
private void ApplyRendererForDecoder(string hwdec)
277+
{
278+
if (string.Equals(hwdec, "vulkan", StringComparison.OrdinalIgnoreCase) ||
279+
string.Equals(hwdec, "vulkan-copy", StringComparison.OrdinalIgnoreCase))
280+
{
281+
MpvApi.SetPropertyString(_controller.Context, "vo", "gpu-next");
282+
MpvApi.SetPropertyString(_controller.Context, "gpu-api", "vulkan");
283+
}
284+
else if (string.Equals(hwdec, "d3d11va", StringComparison.OrdinalIgnoreCase) ||
285+
string.Equals(hwdec, "d3d11va-copy", StringComparison.OrdinalIgnoreCase))
286+
{
287+
MpvApi.SetPropertyString(_controller.Context, "vo", "gpu-next,gpu");
288+
MpvApi.SetPropertyString(_controller.Context, "gpu-api", "d3d11");
289+
}
290+
else
291+
{
292+
MpvApi.SetPropertyString(_controller.Context, "vo", "gpu-next,gpu");
293+
MpvApi.SetPropertyString(_controller.Context, "gpu-api", "vulkan,d3d11");
294+
}
295+
}
296+
275297
public void RotateVideo(double degrees)
276298
{
277299
if (_initialized) MpvApi.SetDoubleProperty(_controller.Context, "video-rotate", degrees);

FishWave/portable_config/mpv.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# FishWave portable mpv configuration
2+
3+
include=~~/profiles.conf

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,57 @@ images/
148148
main.png README screenshot
149149
```
150150

151+
## GLSL Shaders
152+
153+
FishWave includes a comprehensive GLSL shader library for video upscaling, restoration, and post-processing. All shaders work with both Vulkan and Vulkan-copy hardware decoding modes.
154+
155+
### Shader Categories
156+
157+
| Category | Files | Description |
158+
|----------|-------|-------------|
159+
| **FSRCNNX** | 6 | CNN-based upscaling (x1, x2 variants) |
160+
| **ArtCNN** | 2 | CNN upscalers (C4F16, C4F32) |
161+
| **RAVU** | 15 | Sharp upscaling hooks (r2, r3, r4 variants) |
162+
| **AMD FSR** | 2 | FidelityFX Super Resolution |
163+
| **Anime4K** | 3 | Anime restoration and enhancement |
164+
| **HDR Tone Mapping** | 15+ | PQ/HLG to SDR conversion |
165+
| **Misc** | 10+ | Adaptive sharpen, CRT filters, noise |
166+
167+
### Activating Shaders
168+
169+
**Via Context Menu (Recommended):**
170+
1. Right-click the video area
171+
2. Navigate to `Shaders` menu
172+
3. Select a preset (`Default`, `AMD FSR`, `RAVU Zoom R3`) or individual shader
173+
174+
**Via Keyboard Shortcuts:**
175+
- `Alt+Shift+1` through `Alt+Shift+6` - Toggle individual scalers
176+
- `Alt+Shift+A` - Adaptive sharpen
177+
- `Alt+Shift+C` - CRT filter
178+
179+
**Via Profiles:**
180+
- `Video > Renderer > Vulkan` - Enables Vulkan mode (required for optimal shader performance)
181+
- `Shaders > Presets` - Apply predefined shader combinations
182+
183+
**Via Command Line:**
184+
```bash
185+
# Apply shader preset
186+
mpv --glsl-shader=~~/shaders/FSRCNNX/FSRCNNX_x2.glsl video.mp4
187+
188+
# Apply multiple shaders
189+
mpv --glsl-shader=~~/shaders/FSRCNNX/FSRCNNX_x2.glsl --glsl-shader=~~/shaders/Misc/adaptive-sharpen.glsl video.mp4
190+
```
191+
192+
### Status
193+
194+
All GLSL shaders are fully functional with Vulkan and Vulkan-copy modes. mpv's `gpu-next` renderer automatically compiles GLSL to SPIR-V at runtime, ensuring optimal performance on Vulkan-capable hardware.
195+
151196
## Known Notes
152197

153198
- YouTube or web URL playback depends on the bundled/configured YTDL path and can fail under VPNs or when upstream site behavior changes.
154199
- Some LibreHardwareMonitor sensors may be missing without driver support or elevated access.
155200
- The native context menu depends on `portable_config/scripts/menu.dll` and `dyn_menu.lua`.
156201

157-
## Status
202+
## Project Status
158203

159204
FishWave 9 is an active experimental player. The core playback path is usable, and the current focus is making the hardware pipeline more transparent, stable, and easy to tune.

0 commit comments

Comments
 (0)