Show HN: Inkwash, a watercolor sketching app and explanation
Inkwash is a browser-based watercolor sketching app that meticulously simulates real fluid dynamics and pigment behavior using WebGL2. The author's interactive article, part AI-generated, is a masterclass in technical explanation, lauded for making complex concepts intuitively understandable. It demonstrates how intricate physics simulations can be brought to life efficiently on the web, delighting both artists and developers.
The Lowdown
Inkwash is a 'Show HN' project presenting an innovative browser-based watercolor sketching application, distinguished by its deep fidelity to physical painting processes and an exceptionally well-crafted interactive explanation. The author, John O' Whitaker, designed Inkwash to recreate the experience of nature journaling with a pen and waterbrush, transforming a personal artistic practice into a sophisticated digital tool.
The app's core relies on a stack of floating-point textures and WebGL2 fragment shaders to simulate real-world elements like pigment density, wetness, and water velocity. This approach allows for nuanced effects that traditional digital art tools often miss:
- AI-Assisted Creation: The project began as an exploration with Anthropic's Claude Fable 5, which generated the core codebase and much of the explanatory prose, highlighting AI's potential in software development.
- Fluid Dynamics: It employs Jos Stam's "Stable Fluids" algorithm, using semi-Lagrangian advection, pressure projection, and vorticity confinement to create realistic water movement, swirls, and eddies.
- Paper Physics: A "wetness" field governs pigment mobility and velocity, mimicking how ink behaves on damp or dry paper. Water slowly evaporates, and a "drying" mechanic freezes the fluid simulation, capturing the essential nature of watercolor.
- Chromatography: A key feature is the simulation of color separation (chromatography) by allowing different color channels to diffuse at varying rates, producing the characteristic "halos" seen in real watercolor.
- Mark-Making: Strokes are rendered using gaussian splats, with ink densities adding and wetness blending using a MAX operation. Pressure and speed influence brush effects, and a subtle cursor lag enhances the feel of a real brush.
- Layering and Fixing: A distinct "fixed" layer allows dried pigment to bond, enabling traditional watercolor layering. White gouache is simulated destructively, bleaching underlying colors when applied and fixed.
- Realistic Rendering: The display shader uses the Beer–Lambert law for accurate color blending, preventing muddy overlaps. It also generates realistic paper grain, granulation, edge darkening, and wet sheen.
- Device Agnostic Input: The app supports various input methods, including Apple Pencil with finger as a water brush on iPad, stylus barrel buttons, Force Touch on trackpads, or speed-based pressure faking.
- Technical Elegance: The application itself is a single HTML file with no dependencies, running efficiently even on mobile devices, and the interactive explanatory page ingeniously runs multiple WebGL instances within a single context.
The Inkwash project stands out not just as a functional art tool, but as a compelling demonstration of how complex physics can be rendered interactively in a browser, and how AI can significantly accelerate the creation of such intricate software.
The Gossip
Artistic Accolades & Aesthetic Admiration
Commenters were universally impressed by the visual fidelity and aesthetic quality of Inkwash. Many expressed how beautiful, satisfying, and realistic the watercolor effects appeared, particularly appreciating the fluid blending and lifelike pigment behavior. The application's ability to capture the nuances of physical watercolor drawing resonated strongly with users.
Educational Excellence & Explanatory Prowess
A significant portion of the discussion highlighted the exceptional quality of the interactive technical explanation. Users praised the clarity and effectiveness of the article's embedded demos, noting how they made complex fluid simulation and shader concepts understandable and engaging, greatly enhancing their learning experience.
Functional Feedback & Feature Finessing
Users provided constructive feedback and discussed potential improvements for the app. Topics included suggestions for adjusting the fluid flow strength, addressing mobile UI issues (which the author promptly fixed), and comparing Inkwash to other professional watercolor simulation software like Rebelle. The author engaged directly with these comments, demonstrating responsiveness to user input.