46 ms·
Acrylics or oil?
by RotaryTelephone 5y ago
Acrylics or oil?
- smlss_sftwr 5y agofingerpainting
- scollet 5y agoDo you prefer the walls or the floor?
- tppiotrowski 5y agoCanvas + WebGL
- scollet 5y agoThat's pretty awesome. Last time I burnt out to painting I was doing paper sketches and shader graphs!
- agumonkey 5y agoWacom or not ?
- exikyut 5y agoWebGL I haven't quite got the hang of yet, but I just discovered `PointerEvent.pressure` and got terribly distracted playing with it with my phone :) thanks! <!doctype html> <style>html, body { width: 100%; height: 100%; margin: 0 }</style> <canvas style="touch-action: none" id=c></canvas> <div id=z style="position: fixed; left: 0; top: 0"></div> <script> c.width = window.innerWidth; c.height = window.innerHeight; var x = -1, y; var ctx = c.getContext('2d'); c.onpointermove = ev => { //var p = Math.pow(ev.pressure, 3) * 20; // both bad; var p = 0.5/(-Math.log10(ev.pressure)); // try one z.innerText = ev.pressure + '\n' + p; if (x != -1) { ctx.lineWidth = p; ctx.beginPath(); ctx.moveTo(x, y); ctx.lineTo(ev.x, ev.y); ctx.stroke(); } x = ev.x; y = ev.y; } c.onpointerup = () => x = -1; </script> I also learned about the concept of pressure curves, and that they're really annoying both to implement and to get right: https://github.com/xournalpp/xournalpp/issues/2619 https://github.com/xournalpp/xournalpp/issues/2619, https://github.com/xournalpp/xournalpp/pull/2622 https://github.com/xournalpp/xournalpp/pull/2622, https://github.com/xournalpp/xournalpp/issues/1170 https://github.com/xournalpp/xournalpp/issues/1170 The two one-liners above to convert pressure to lineWidth are the result of playing around with no idea what I'm doing for a few minutes. They... work, in the sense that I can tolerate them for about 30 seconds :) but I keep playing with them because they don't "click". I wouldn't mind suggestions for how to actually do this (my google-fu isn't finding anything, likely because I don't know what to look for). I had a poke around Krita, but only found C++ abstractions. I also stumbled on http://willowsystems.github.io/jSignature/#/about/linesmoothing/ http://willowsystems.github.io/jSignature/#/about/linesmooth..., which is an awesome looking bit of open source code. It implements both realtime curve extrapolation and pressure approximation for devices/environments that don't report that.