From d59e6e639ae4c92adfe2f1c2fc7fab8a396a77a4 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Tue, 20 Jan 2026 03:37:25 +0000 Subject: [PATCH] docs(shadertoy): improve iMouse documentation table - More detailed table showing z/w behavior per-frame - Documents 'Just Clicked (frame 1)' vs 'Held Down (frame 2+)' distinction - Shows iMouse.w sign flip: +clickY on first frame, -clickY afterwards --- examples/shadertoy-server/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/shadertoy-server/README.md b/examples/shadertoy-server/README.md index 445ca6c2..9881b1f9 100644 --- a/examples/shadertoy-server/README.md +++ b/examples/shadertoy-server/README.md @@ -140,14 +140,15 @@ _Tool input:_ ## Mouse & Touch Interaction -The `iMouse` uniform provides interactive input, compatible with the official Shadertoy specification: +The `iMouse` uniform provides interactive input, fully compatible with the official Shadertoy specification: -| Component | When Button Down | After Release | Never Clicked | -| ----------- | ---------------------- | ---------------- | ------------- | -| `iMouse.xy` | Current position | Last position | `(0, 0)` | -| `iMouse.zw` | Click start (positive) | Negated (-x, -y) | `(0, 0)` | +| Component | Just Clicked (frame 1) | Held Down (frame 2+) | After Release | Never Clicked | +| ----------- | ---------------------- | -------------------- | ------------- | ------------- | +| `iMouse.xy` | Click position | Current position | Last position | `(0, 0)` | +| `iMouse.z` | `+clickX` | `+clickX` | `-clickX` | `0` | +| `iMouse.w` | `+clickY` | `-clickY` | `-clickY` | `0` | -**Detecting button state:** +**Detecting button state (full compatibility):** ```glsl if (iMouse.z > 0.0) {