Topotoy Labs's Avatar

Topotoy Labs

@topotoylabs.bsky.social

I enjoy pain. That is why I code simulation engines. My blog: http://brashandplucky.com

207 Followers  |  9 Following  |  156 Posts  |  Joined: 13.04.2025
Posts Following

Posts by Topotoy Labs (@topotoylabs.bsky.social)

Video thumbnail

Taking some clunky baby steps: Better actor vs. terrain collision + Mostly fixed cascaded shadowmaps

#indiedev #gamedev #solodev #customengine #procedural #terrain

02.03.2026 17:20 โ€” ๐Ÿ‘ 9    ๐Ÿ” 1    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Post image

Getting ready to drop some non-procedural geometry in the terrain engine. ๐Ÿ’ฅ

#indiedev #gamedev #solodev #customengine #procedural #terrain

28.02.2026 19:59 โ€” ๐Ÿ‘ 10    ๐Ÿ” 2    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

The physics is based on an elevation cache that reads back the terrain from the GPU (GIS-based + procedural GPU detail), kept alive only in the vicinity of active actors. This will allow for sparse planetary-scale physics.

24.02.2026 21:37 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Don't mind the many issues in the demo: faulty cascaded shadow maps, some terrain seams, lousy navigation controls...

24.02.2026 21:37 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

For the physics backend, I cobbled together a minimal Rust wrapper of the fantastic Jolt (by @jrouwe). Built using f64.

24.02.2026 21:37 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Video thumbnail

Starting to add physics to the terrain! Dropping massive 500m spheres and watching them roll down the mountains ๐Ÿ€

#indiedev #gamedev #solodev #customengine #procedural #terrain

24.02.2026 21:28 โ€” ๐Ÿ‘ 15    ๐Ÿ” 4    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 0
Video thumbnail

Beyond GIS elevation data limits, procedural detail is added on the GPU. Elevation bounds for culling (yellow boxes) and tile heightfields for physics use async GPU read-back. Still experimental!

#indiedev #gamedev #solodev #customengine #procedural #terrain

14.02.2026 16:03 โ€” ๐Ÿ‘ 12    ๐Ÿ” 1    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

This must be decoupled from rendering for actors other than the player, such as AI tanks and missiles, which need terrain collision data even when they're off-screen.

12.02.2026 13:29 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Video thumbnail

A new elevation cache (leveraging the same systems as the render tiles cache) will be used to cook heightfields for the physics system. Actors (like the camera) read-back tiles from the GPU in their vicinity at a specific LOD level.

#solodev #indiedev #gamedev #customengine #procedural #terrain

12.02.2026 13:25 โ€” ๐Ÿ‘ 16    ๐Ÿ” 3    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Video thumbnail

Ocean waves swell in Z, intersecting terrain in low areas like beaches. I render terrain into the stencil buffer to exclude water from terrain pixels. The first part of the video toggles stencil on/off.

#solodev #indiedev #gamedev #procedural #terrain #rendering

11.02.2026 07:02 โ€” ๐Ÿ‘ 15    ๐Ÿ” 3    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Video thumbnail

First integration of the ocean system into the terrain with aerial perspective ๐ŸŒŠ

#solodev #indiedev #gamedev #procedural #terrain #rendering

04.02.2026 06:33 โ€” ๐Ÿ‘ 20    ๐Ÿ” 4    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Post image

ELLIPSE: Find the four points where the tangent slope is exactly +/-1. These 4 points define a parallelogram. Each pt defines a corner region, and each consecutive pair defines a band. Vertices are clamped against the conic solved for X or Y depending on which band or corner they fall in.

01.02.2026 14:07 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Post image

To clip the screen-space grid onto the conic:

HYPERBOLA: Rotate the conic so its transverse axis aligns with Y, then solve for Y. Vertices inside the forward branch (ocean side) are left unchanged. Vertices outside (sky side) are clamped along Y toward the curve. The result is then unrotated.

01.02.2026 14:07 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Conics are quadratics, so the screen-space horizon involves square roots and sign flips that make the algebra obnoxious. In particular, the hyperbola produces 2 branches: the actual horizon ahead of the camera, and a virtual projection from the part of the sphere behind the camera, mirrored.

01.02.2026 14:07 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

When seen from afar, the ellipse is the obvious case. The hyperbola appears when you are close to the surface, looking toward the horizon line. The parabola case only happens when the ellipse is about to become a hyperbola and vice-versa.

01.02.2026 14:07 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

The horizon in case (4) projects as one of the following conics:

4.1. An ellipse (or a circle if the camera is centered on the sphere).
4.2. A parabola, which I treat as a hyperbola by nudging the coefficients numerically.
4.3. A hyperbola.

01.02.2026 14:07 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

There are four main cases:

1. Camera inside planet (point-in-sphere -> skip).
2. Camera looking away from planet (sphere outside frustum -> skip).
3. Camera sees only planet (all frustum corners hit sphere -> grid unaffected).
4. Camera sees both planet and sky (horizon visible).

01.02.2026 14:07 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Video thumbnail

This is an implementation of what I was talking about in my previous post: A grid in screenspace, clipped to the horizon (conic) of the planet (a sphere) for ocean rendering. ๐Ÿงต

#solodev #indiedev #gamedev #procedural #terrain #rendering

01.02.2026 13:53 โ€” ๐Ÿ‘ 18    ๐Ÿ” 2    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Post image

Clipping to the ellipse is a little more convoluted. Clipping to the hyperbola is "basically" clamping sky vertices towards the branch that matters and disregarding the mirrored one, like so. The parabola case I am treating as a degenerate hyperbola.

29.01.2026 06:37 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Doing the math you end up with a quadratic, where the sign of A tells you the conic type (A<0:ellipse, A>0:hyperbola, A=0:parabola).

29.01.2026 06:37 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

The image plane slices through this tangent cone. A plane cutting a cone gives a conic section. That's literally where the name comes from. So the horizon of a sphere in screen space is a conic: ellipse, hyperbola, or in a degenerate case, parabola.

29.01.2026 06:37 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Why a conic? The set of all rays from the camera that are tangent to the sphere forms a cone. The apex is the camera (eye), and the axis points toward the sphere center.

29.01.2026 06:37 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Post image Post image

For planetary ocean rendering I use a screen-space projected grid. The grid starts as a flat mesh in NDC, and each vertex is projected onto the sphere surface. But what about vertices that point at the sky? You need to clip the grid to the horizon. The horizon is a CONIC SECTION.

#solodev #gamedev

29.01.2026 06:37 โ€” ๐Ÿ‘ 16    ๐Ÿ” 2    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Video thumbnail

Waking up in the Grand Canyon ๐ŸŒ… Still doing optimizations and clean-ups before going back to ocean rendering.

#indiedev #gamedev #computergraphics #procedural #terrain #rendering

27.01.2026 18:53 โ€” ๐Ÿ‘ 13    ๐Ÿ” 2    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Preview
NASA Scientific Visualization Studio | Deep Star Maps 2020 The star map in celestial coordinates, at five different resolutions. The map is centered at 0h right ascension, and r.a. increases to the left. || starmap_2020_4k_print.jpg (1024x512) [41.8ย KB] || st...

Thanks! The starmap comes from NASA here: svs.gsfc.nasa.gov/4851/

27.01.2026 03:36 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Definitely!

25.01.2026 05:28 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

This is my homebrew real-time (Rust/Vulkan).

25.01.2026 05:27 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Post image 24.01.2026 13:05 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Video thumbnail

Here's where I'm at, combining some of the building blocks I've been working on recently: terrain LOD, atmosphere with aerial perspective, starmap, and auto-exposure.

#indiedev #gamedev #computergraphics #procedural #terrain #rendering

24.01.2026 13:02 โ€” ๐Ÿ‘ 21    ๐Ÿ” 3    ๐Ÿ’ฌ 3    ๐Ÿ“Œ 0
Video thumbnail

You wake up in the middle of the night, floating in space. No ground. No walls. Nothing to grab. Just you and the stars...

#indiedev #gamedev #computergraphics #procedural #terrain #rendering

23.01.2026 06:25 โ€” ๐Ÿ‘ 10    ๐Ÿ” 2    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0