Adds demo_view_rotate_z_around() which compensates translation
so the point between the two fingers stays fixed during rotation,
like maps apps.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two-finger pinch now does both zoom (distance change) and Z-axis
rotation (angle change) simultaneously. Adds demo_view_rotate_z()
for direct Z-axis rotation from touch input.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only toggle on keydown (not keyup). Remove vsync from web help.
Format key names with spaces.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Press ? or / to show full keyboard/mouse/touch reference.
Esc or ? again to dismiss.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wine may not properly restore windowed mode after fullscreen.
Works on native Windows.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Disable backface culling (both triangles per quad need to render).
Handle Esc/Q to quit via DestroyWindow. Wire vsync toggle to
swap chain present interval.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The library's hb_gpu_fetch references the global hb_gpu_atlas,
so its StructuredBuffer declaration must precede the library
source in the concatenated shader.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
D3D11 renderer using Win32 windowing and runtime HLSL compilation.
Cross-compiles with MinGW, runs under Wine with DXVK.
Also fixes demo-common.h to guard GL/GLFW includes behind
HB_GPU_NO_GLFW, renames near/far to znear/zfar in demo-view
(reserved on Windows), and adds QueryPerformanceCounter timer
for Win32.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wire up the 'd' key debug mode using _hb_gpu_curve_counts from
the library MSL shader. Same R/G/B heatmap as GL and WebGPU:
red = horizontal curve count, green = vertical, blue = coverage.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Now that the WGSL shader has _hb_gpu_curve_counts, wire up
the debug uniform and heatmap visualization. Same R/G/B output
as the GL demo.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bring WGSL shader in line with GLSL/MSL/HLSL by extracting the
header decode + band index computation into a shared helper.
Enables future debug heatmap support in the WebGPU demo.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Check canvas size each frame and reconfigure the WebGPU surface
when it changes. Fixes black screen when toggling dev tools or
resizing the browser window.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Make hb_gpu_fetch public (no underscore prefix) in all shaders.
Internal functions use _hb_gpu_* consistently, including WGSL
(single leading underscore is legal per gpuweb/gpuweb#2298).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Explain why font scale should be left at default, how dilation
works and what jac means, and provide a simpler static dilation
alternative for 2D rendering at known sizes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Same algorithm as GL: pow(coverage, exp) where exp varies by
foreground brightness and ppem, smoothly transitioning to no
effect above 48ppem. Toggled with 's' key, on by default.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Same per-pixel coverage adjustment as the GL demo. Replaces
unused debug uniform with stem_darkening in the uniform buffer.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adjust coverage at small sizes to compensate for gamma washing
out thin stems. Dark-on-light gets pow(cov, 0.7) to fatten,
light-on-dark gets pow(cov, 1.4) to thin. Smoothly transitions
to no effect above 48ppem. Applied before gamma correction so
it works with sRGB, gamma 2.2, and none.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Self-contained HTML with embedded font and text, same controls
as GPU demos (pan, zoom, 3D rotation, drag-release animation).
Useful for comparing DOM text rendering performance vs GPU.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Self-contained HTML with embedded font (base64) and default text.
Same controls as GPU demos. Useful for comparing rendering
performance: DOM vs WebGL vs WebGPU.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show helpful error with link to webglreport.com when WebGL2
context creation fails (e.g. Firefox with hardware acceleration
disabled or GPU blocklisted).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Map DOM button 1 (middle) to GLFW middle button so middle-click
reset and middle-drag zoom work.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Port fragment and vertex shaders to HLSL (Shader Model 5.0+).
Uses asuint for bit reinterpretation, StructuredBuffer<int4> for
atlas, and mul() for matrix multiply. Verified with DXC on Linux.
Adds HB_GPU_SHADER_LANG_HLSL to the enum. Reorders enum to:
GLSL, WGSL, MSL, HLSL. Updates doc strings for consistency.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace separate .glsl files and generated .hh headers with C++11
raw string literals (R"glsl(...)glsl") directly in demo-shader.cc.
Matches the pattern already used by demo-metal.mm and the WebGPU
demo. Removes demo shader generation from meson and the generator
script.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>