Uploaded January 2022 | Updated November 2026, 5 hours ago
A lot of optimizations later, the framerate has doubled to ~60fps. Micro-optimization adds up.
Cleverly combining existing algorithms sometimes results in magic:
4D Perlin noise + marching-cubes + Snell's law + OpenCL parallelization
4D Perlin noise provides iso-values on a 3D Cartesian lattice. With the marching-cubes algorithm (paulbourke.net/geometry/polygonise/), it is possible to generate triangulated isosurfaces from the lattice.
Turns out such a 3D lattice already is one of the ideal acceleration structures for raytracing. Any ray only has to check for possible intersections with iso-surface triangles contained within the traversed grid cells. This makes it run in real time on non-RTX GPUs. Light rays from the camera traverse the lattice and check for intersections with the triangles that marching-cubes generates on-the-fly from the isovalues. Triangles never leave registers.
To get a smooth surface, I interpolate the surface normal vector: I first get the normals directly at the lattice points with gradient on the isogrid and then do trilinear interpolation to the ray-triangle intersection point. That interpolation is only done once, after the intersection has been found.
A lot of optimizations later, the framerate has doubled to ~60fps. Micro-optimization adds up.
Cleverly combining existing algorithms sometimes results in magic:
4D Perlin noise + marching-cubes + Snell's law + OpenCL parallelization
4D Perlin noise provides iso-values on a 3D Cartesian lattice. With the marching-cubes algorithm (paulbourke.net/geometry/polygonise/), it is possible to generate triangulated isosurfaces from the lattice.
Turns out such a 3D lattice already is one of the ideal acceleration structures for raytracing. Any ray only has to check for possible intersections with iso-surface triangles contained within the traversed grid cells. This makes it run in real time on non-RTX GPUs. Light rays from the camera traverse the lattice and check for intersections with the triangles that marching-cubes generates on-the-fly from the isovalues. Triangles never leave registers.
To get a smooth surface, I interpolate the surface normal vector: I first get the normals directly at the lattice points with gradient on the isogrid and then do trilinear interpolation to the ray-triangle intersection point. That interpolation is only done once, after the intersection has been found.





![PhysX3D [GRAVITY SIMULATION] 25k body galaxy @20x playback speed
This is PhysX3D simulating a galaxy containing 25000 stars. For calculation brute force and RK4 integration is being used on a notebook GPU (Nvidia GTX 960M, 1.54TFlops). The GPU calculates roughly 3.5 Billion particle interactions every second.
This simulation took 12 minutes to calculate.
More information at: http://www.projectphysx.de
Music: Puddle of Infinity - Open Sea Morning PhysX3D [GRAVITY SIMULATION] 25k body galaxy @20x playback speed](https://i.ytimg.com/vi/TmBf2DI-3cE/mqdefault.jpg)



![PhysX3D [GRAVITY SIMULATION] Der zweite Mond der Erde – 2016 HO3
Die Erde hat einen zweiten Mond, 2016 HO3 wird er bezeichnet. Er ist sehr weit außen, 70 Mal so weit wie der Erdmond. Er ist auch sehr klein, nur ca. 70 Meter im Durchmesser, und deshalb nicht einmal mit einem Amateurteleskop sichtbar. Aber es gibt ihn, das hat die NASA bestätigt, und er umkreist die Erde, was ihn zu einem Mond macht. Aufgrund der großen Distanz zur Erde ist seine Umlaufbahn jedoch nicht stabil, sodass er diese in etwa 325 Jahren verlassen wird und zum Erdtrabanten in einer Hufeisenumlaufbahn wird. Klingt komisch, ist es auch. Ich hab’s genauer unter die Lupe genommen und seine Bahn für die nächsten 1300 Jahre vorausberechnet.
Mehr Informationen auf: http://www.projectphysx.de
Songs:
M83 – Outro
M83 – Fearful Odds
M83 – Oblivion PhysX3D [GRAVITY SIMULATION] Der zweite Mond der Erde – 2016 HO3](https://i.ytimg.com/vi/V7mHQ0L4Wkc/mqdefault.jpg)
