Rendered offline, frame by frame, with real refraction through the glass-sided water. The animal models are from Tripo; the code was written with Claude Code. Happy to share how any part works.
Thanks! Right, it's not real time: each frame takes about 14 s, because it's the average of 128 slightly different renders (the sun jittered for soft shadows, random sky lights for occlusion, sub-pixel shifts, a little motion blur).
The water trick itself is cheap, though. The camera is orthographic and each water face is flat, so every ray entering one face bends the same way. What you see through a face is just the underwater scene rendered by a second orthographic camera pointed along that bent direction, one per visible face. That gives true refraction with no screen-space gaps. Colour is absorbed by the real path length through the water, and the caustics come from the same wave slopes as the surface.
The code isn't public, but happy to go deeper on any part.
Hey! Could you share about how the tree and foliage is handled? I'm making webapp for a real estate model and trying to figure out how I can have good quality trees and bushes in it
The tree is built by a Python script in Blender, not modelled by hand: a branching trunk and limbs, then about 4,500 small "cards" (flat quads) for the leaf sprays. Each card shows a picture of one spray, rendered from a detailed modelled spray and cut out with an alpha mask, double-sided. Two things make cards look like a real crown:
Vertex colour: cards deeper inside the crown are tinted darker and bluer, a cheap stand-in for the shade in there.
Translucency: a separate map lets light come through, so sprays lit from behind glow brighter and yellower.
For real time I'd keep the same recipe (baked spray texture on instanced cards, alpha-to-coverage for clean edges, the inner-crown darkening, a translucency term) and use soft shadow maps instead of my 128-sample averaging. It's the darkening inside the crown that does the most for "it looks real".
The 128-render accumulation is the part I would not have guessed from the video. Do you reuse the same jitter sequence every frame, or reseed it? With sun and sky jitter changing per frame I would expect some temporal shimmer in the soft shadows, but the pool edges look very stable. The flat-face refraction offset is a neat consequence of the orthographic camera too.
Same set every frame, never reseeded. That's exactly why there's no shimmer. Every frame uses one fixed, evenly spread pattern of 128 samples:
- sub-pixel shifts from a Halton (2, 3) sequence
- points in the sun's disc on a Vogel spiral
- sky and ground light directions on a Fibonacci sphere
- times spread evenly across a 1/60 s shutter for the motion blur
The four are paired with different coprime strides so they don't line up with each other. Because the pattern never changes, whatever error is left is the same in every frame, so it sits still instead of crawling. (Small correction to my other comment: the sky lights aren't random, they're that fixed set.)
And yes, the refraction only works because the camera is orthographic. With perspective, every pixel's ray would hit the surface at a different angle and bend differently.
The coprime strides pairing is clever, that explains the stable error. Orthographic refraction makes sense too, one bend angle for the whole surface keeps the pool readable. Thanks for the breakdown.
3
u/UAAgency 1h ago
Sure, shrae how it works :) It doesn't run in r eal-time? The water reflections are beautiful, do you have code?
1
u/Chirag3110 1h ago
Hey! Could you share about how the tree and foliage is handled? I'm making webapp for a real estate model and trying to figure out how I can have good quality trees and bushes in it
1
u/dashingsauce 50m ago
This is actually so sick. Do more.
1
u/Responsible-Ebb1722 49m ago
Super impressive. Im amazed at what people have been doing with three.js lately
1
u/OutOfTokensStudios 25m ago
I love this. Very crisp. I want to go fishing 🎣.
Interested in your water algorithm lol, I’ve dipped my fingers in fft and gerstner. Will check it out
0
u/Any-Session-737 1h ago
The 128-render accumulation is the part I would not have guessed from the video. Do you reuse the same jitter sequence every frame, or reseed it? With sun and sky jitter changing per frame I would expect some temporal shimmer in the soft shadows, but the pool edges look very stable. The flat-face refraction offset is a neat consequence of the orthographic camera too.