Video yükleniyor...
Video Yüklenemedi
Some late-night vibe coding with Claude. This time I tried implementing the paper "Real-Time Ray-Traced Ambient Occlusion of Complex Scenes using Spatial Hashing" (by Pascal Gautron) using LightweightVK. The starting point was a basic working ray-traced AO demo without spatial hashing which I already had - just stochastic noise... show more
38,418 görüntüleme • 7 ay önce •via X (Twitter)
23 Yorum

this is so freaking detailed and cool!

Nice! One thing that (IIRC) wasn't mentioned in the paper was cache invalidation. Each entry stores the age that's used when doing the linear search, but do you also use this age to reject samples when reading the cache to reject possibly stale entries?

There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors 😀 In my case, cache entries are retired after N frames, and I`ve found that using 2 frames strikes the best balance helping ambient occlusion converge while still allowing quick updates when the camera moves and new geometry comes into view. Claude needed quite a bit of guidance here and wasn`t able to make meaningful progress without being manually steered through different heuristics.

Ohh, that's quite a short lived cache then, I expected more like 10-30. Actually I had the same exact idea last week. I read the paper and now I'm about to see how far can I go with Claude and implementing Doom-like GI with it. Regarding cache invalidation - check my profile bg

I think the next step to improve visual quality is to introduce invisible guard bands around the camera view. That way, geometry entering the frame can pick up valid cache samples before it actually becomes visible to the user. With this in place, we could increase cache age retirement to around 5–10 frames without causing eviction stalls. Another area worth exploring is tuning the total cache size (the video above uses 10M entries).

Very cool!

Thanks, Panos! I was curious whether it is possible to prototype a demo from a graphics paper in just a few hours. Now I know!

I think with skills and an open mind (no unjustified AI hate) some cool things are possible, that's one of them 🙂

This was very much vibe-coded. I didn`t touch the code directly. Instead, I guided Claude and then, at the end, just hardcoded a few parameters to match my visual taste after tweaking them in the UI to find that sweet spot.

I will do some Claude-assisted cleaning and optimization passes on this code before publishing it.

this is sick, love seeing actual papers implemented in real time curious how much the spatial hashing helped with perf vs the naive jittered version? always wondered if the complexity tradeoff is worth it on mobile

The naive jittered version runs about 1.5x faster than the naive vibe-coded spatial hashing. That said, the naive vibe-coded spatial hashing also produces noticeably better visual quality 😀

Impressive work! I did something similar with Peter Shirley's Raytracing in one weekend by porting it to WebGPU. My focus was in being able to learn Raytracing from scratch so I didn't use a lot of AI help

I was testing how quickly I could build a prototype using Claude. Even in the best-case scenario, it would’ve taken me an entire weekend to code this unassisted myself - compared to just 4 hours in one evening.

AI really speeds up everything and the fact that they used to be slow at shaders but that gap is closing really fast now. I haven't tried Claude but of the copilot models in Vscode , GPT 5.3 Codex is my best to use.

Awesome stuff!!! What I would like to see now is it running at together with everything else 😉

I will be yet another interesting exercise, sure!

Meant to say ...see it running at 16ms with everything else"

On my desktop PC, sure!

impressive

For what?

This is the best kind of vibe coding writeup. You got to "visually acceptable" in 4 hours, but you're also honest that the code is messy and unoptimized. That gap between "it works" and "it's ready" is where most of the real engineering lives. Cool to see this running on mobile too.

I have no idea what you said, but that looks freaking awesome. Way to go!
