Apoorva Joshi's Avatar

Apoorva Joshi

@apoorvaj.io.bsky.social

Computer graphics, systems programming, general methods. Staff graphics engineer at @unity.com. Formerly Playdead, NVIDIA, Microsoft. apoorvaj.io πŸ“Copenhagen

841 Followers  |  201 Following  |  50 Posts  |  Joined: 16.12.2023  |  1.9084

Latest posts by apoorvaj.io on Bluesky

A plot comparing the original PCA and a simpler approximation. Accurate (red) and approximate (orange) first principal components are shown. The approximation seems close to the original based on this experiment. The shown directions are aggregated over five random trials.

A plot comparing the original PCA and a simpler approximation. Accurate (red) and approximate (orange) first principal components are shown. The approximation seems close to the original based on this experiment. The shown directions are aggregated over five random trials.

A new article on my site: Approximate first principal component

It describes simple trick to estimate the direction of most spread of a bunch of points without running a full PCA. Includes my Python re-implementation and plots of some quick tests.

30fps.net/pages/approx...

17.07.2025 17:56 β€” πŸ‘ 32    πŸ” 6    πŸ’¬ 1    πŸ“Œ 0
Preview
Zig's New Async I/O | Loris Cro's Blog https://kristoff.it/blog/zig-new-async-io/

Zig's New Async I/O

https://kristoff.it/blog/zig-new-async-io/

13.07.2025 00:35 β€” πŸ‘ 15    πŸ” 5    πŸ’¬ 0    πŸ“Œ 4

Hey Mikko, it's basically impossible for me to find your email address anywhere. Any chance you could DM/email me? My email address is on my website.

06.07.2025 18:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Zig Roadmap 2026
YouTube video by Zig SHOWTIME Zig Roadmap 2026

The Zig 2026 roadmap is absolute fire. Andrew and team are playing the long game, and it's really starting to pay off big timeβ€”incremental compilation, async await, cross compilation, fuzzing, and more. www.youtube.com/watch?v=x3hO...

04.07.2025 22:47 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Add MacOS-style caret jumping on command+left/right, command+up/down, and option+left/right by ApoorvaJ Β· Pull Request #58 Β· memononen/Skribidi Added some text editor navigation that feels native to MacOS: Command+left/right acts like home and end Command+up/down jumps to the beginning and end of the whole text. Option+left/right jumps to...

Mikko and I added MacOS-style keyboard navigation to the Skribidi text library. github.com/memononen/Sk...

29.06.2025 20:35 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image Post image

*Tin foil hat* Has Google added a special case for Google Docs in Chrome to show the MacOS accent menu in the right spot? It renders out of the window in Firefox, which is what you'd expect to happen when using a hidden textbox to get input. I cannot find a web API do this. Looks like an inside job.

20.06.2025 20:31 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Video thumbnail

Still long way to go, but got the beginnings of IME text composition working in papaya.io. I'm super impressed that @mikkomononen.bsky.social's Skribidi library even has this feature. Here's a video of me typing in 'βŒ₯-u' and then 'o' on Mac, which results in 'ΓΆ'.

15.06.2025 22:35 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I'm using Skribidi for emoji, FreeType for everything else. :)

12.06.2025 21:18 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Uh, bsky's image upscaling makes it look weird. But at native res, it's absolutely *chef kiss*

12.06.2025 21:16 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

If you've ever worked with font rendering, then you'll know that it's the most impressive to get the fonts looking good at low sizes, because then hinting comes into play, which is where FreeType shines over other simpler libraries.

12.06.2025 20:51 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

Got simplified Chinese and FreeType variable font rendering to work in papaya.io.

12.06.2025 20:48 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0
Post image

Multi-script rendering in papaya.io is starting to come together. Here's glyph caching and retrieval across several fonts (including an emoji font)!

11.06.2025 21:08 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

Added intermingled rendering of Latin and emoji (from different font files) to papaya.io. (Also look at that automatic word-wrapping and left-alignment, courtesy of Skribidi!)

09.06.2025 19:00 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

Emoji font rendering in papaya.io with @mikkomononen.bsky.social's github.com/memononen/Sk... library.

Next up: intermingling font and emoji rendering.

08.06.2025 20:57 β€” πŸ‘ 6    πŸ” 2    πŸ’¬ 0    πŸ“Œ 0

I will open a few GitHub issues with proposed solutions as I get things working in my fork, over the next few days/weeks.

06.06.2025 09:35 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
Switch from bitfields to flags Β· ApoorvaJ/Skribidi@b9ce26e

These are my proposed changes: github.com/ApoorvaJ/Skr...

05.06.2025 22:54 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
translate-c: support C bitfields Β· Issue #1499 Β· ziglang/zig struct Test { unsigned foobar : 1; }; pub const struct_Test = @OpaqueType();

I know this is a relatively obscure use case for you, but Zig does't support C bitfields. github.com/ziglang/zig/...

From my limited research, similar interop issues will arise with Go, Rust and Python ctypes.

If you would accept classic `& IS_RLT` kind of packing, I could include it in my PR.

05.06.2025 21:20 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
translate-c: support C bitfields Β· Issue #1499 Β· ziglang/zig struct Test { unsigned foobar : 1; }; pub const struct_Test = @OpaqueType();

Apologies for spamming here; I can't seem to find any other way of contacting you, and DMs aren't allowed for non-followers.

Is there any chance you would accept a more old-school bitfield method than `uint8_t is_rlt : 1;`?

05.06.2025 21:20 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0

Thanks for the clarification. My build system is fairly complicated, so I won't be able to contribute directly. But I've already found and fixed some minor compilation errors while building with emcc. I'll send a PR with the fixes once I get it working.

05.06.2025 17:02 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Do you know if there is any rendering quality delta between Skribidi and FreeType?

Also I’m currently trying to build Skribidi to WebAssembly. Will let you know how that goes. Thank you again for sharing this library!

05.06.2025 16:32 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Papaya - Image editing right in your browser

Congratulations on the release! Great timing, since I'm just starting to implement text rendering in my side project papaya.io, so lots to learn here for me. I was wondering if you've rolled your own rendering instead of using FreeType, and if so why that is.

05.06.2025 15:38 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
GitHub - memononen/Skribidi: Nimble bidirectional text stack for UIs Nimble bidirectional text stack for UIs. Contribute to memononen/Skribidi development by creating an account on GitHub.

I just published the bidi text stuff I have been working the past months. It's called Skribidi (because all text and font related things need funny name for some reason).

github.com/memononen/Sk...

05.06.2025 08:02 β€” πŸ‘ 65    πŸ” 19    πŸ’¬ 7    πŸ“Œ 0

Hold up. A thin sheet of gold is transparent? 🀯 That somewhat breaks my mental model of conductors. Is this transparency similar to say water, or is it some other QED phenomenon?

04.06.2025 14:42 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

It is my (potentially flawed) understanding that the imaginary component is zero for wavelengths that are transmitted. And the visible frequency range is visible because eyes first evolved under water.

04.06.2025 12:59 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

(cc @omershapira.com) Fun fact, this is also useful in computer graphics.

The complex IOR can be converted into an F0 (Fresnel reflectance value of a ray aligned with the normal). This can be used in Schlick's approximation. en.wikipedia.org/wiki/Schlick...

04.06.2025 12:57 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

There's a lot more work before I can roll this out to users. But rasterizing this using FreeType + HarfBuzz as opposed to using the browser's canvas means that I can get deterministic rendering across browsers/OSes.

03.06.2025 22:09 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image Post image

Started implementing text rendering for papaya.io. Got FreeType and HarfBuzz compiling to WebAssembly. Here's a demo of kerning working with Roboto.

03.06.2025 22:09 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0

I'm really excited about the tech behind this:

- Built in Zig compiled to WASM.
- Linking C/C++ libraries (e.g. libwebp)
- Worker threads for async stuff
- Decent test coverage

Overall this is a major simplification of the tech stack, and I think I'll be able to iterate very quickly.

22.05.2025 21:29 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

Just relaunched papaya.io β€” a web-based image editor I've been building on nights and weekends. What's new:

- .ppy file format for local saves
- Automatic browser persistence
- WebP import/export support

Building fast and shipping features regularly. Try it out β€” feedback very welcome.

22.05.2025 21:29 β€” πŸ‘ 6    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0
Post image 20.05.2025 09:17 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

@apoorvaj.io is following 19 prominent accounts