Nvidia GeForce 4090, 3D Sierpiński Carpet, 125 Million points

Subscribers:
833
Published on ● Video Link: https://www.youtube.com/watch?v=6GXPp2gnl54



Duration: 0:00
1,291 views
47


2024-12-02. 3D Sierpiński Carpet, also known as the Menger Sponge.

GENERATION

Chaos game is a method of fractal generation that creates order from chaos. You plot a 3D dot based on the position of the last plotted dot. Given a cube defined by 8 corners, pick one of the corners, or edges, at random. There are 20 total positions. Move 1/3rd the way to the corner. That's it.

FRACTAL

This process creates a fractal, which actually means fractional dimension, but is typically defined as being self similar -- which produces fractional dimensions. Imagine any point of the resultant fractal is the input to the above Chaos Game -- you can see that it would wholesale copy the entire fractal to be 1/3rd size, and positioned near the corner (or edge) of choice. This literally defines the fractal shape. The fractional dimension (Hausdorff dimension) is ⁠log 20 / log 3 ≅ 2.72683302786

ATTRACTOR

The process is actually an attractor, since if the first dot's position is chosen not on the fractal itself, it will quickly be attracted to it.

STRANGE ATTRACTOR

A strange attractor is an attractor that is a fractal.

COLORING

There are 20 locations (8 corners and 12 edges). I made a program that produces 20 different colors based on evolution theory and human perception of RGB values of light. This gives the foundational 20 colors. During the Chaos Game generation, the color of the chosen corner/edge is used, but it only LERPs (linear interpolation) towards that color. This is where the thousands of colors arrive from, while maintaining a unique color mechanic.

RENDERING

Rendering is real-time. 125,000,000 single pixel dots on the 4090 GPU. Resolution is 1920x1080, which is only about 2 million pixels -- to give an idea of just how many 125 million is. That's about a 60x overdraw per pixel if every pixel was visible on-screen. The rendering produces both a color render target buffer, and a depth render target buffer. The depth buffer is the same as the internal GPU buffer, but I don't have access to it, so I generate it myself in the vertex shader.

Post processing takes these buffers and enlarges the pixels -- in this case, to 5x5 in size in a circle fashion (3/5/5/5/3) with no anti-aliasing. The depth value ensures dots that are closer to the camera are visible over dots further away (see prior videos for where this is not the case, and the colors are just "merged" in some form). Dot enlargement size does not vary according to distance -- that implementation is coming soon. For video upload, I upscale the result to 4K to preserve the fidelity during video compression.

CODE

MonoGame C# with custom HLSL shaders.

INSPIRATION

Demo scene graphics demos in the VGA days where demos asked the viewer "how many dots?" to show off real-time rendering speed. No GPUs back then. Just a 320x200 linear frame buffer, 1 byte per pixel.

HARDWARE

Alienware m18 R2 + 4090 GPU.
I purchased this monster the first day Dell made it available: January 23, 2024.
NVIDIA GeForce RTX 4090 16GB GDDR6 (laptop version)
14th Gen Intel Core i9 14900HX (24-Core, 36MB L3 Cache, up to 5.8GHz Max Turbo Frequency) (16 E-Cores, and 8 P-Cores hyperthreaded = 32 V-Cores total)
64 GB: 2 x 32 GB, DDR5, 5200 MT/s, non-ECC, dual-channel
18" FHD+ (1920 x 1200) 480Hz, 3ms, ComfortView Plus, NVIDIA G-SYNC + DDS, 100% DCI-P3, FHD IR Camera
AlienFX RGB backlit Alienware CherryMX ultra low-profile mechanical keyboard
4 TB, M.2, PCIe NVMe, SSD

PLAYLISTS

Xona System 8:    • Game Dev Engine #1. A New Beginning.  
Voxel:    • Voxel Engine #8 - Correct Peripheral ...  
Nvidia 4090:    • Nvidia GeForce 4090, 3D Sierpiński Ca...  
Road:    • Pseudo 3D Road #8 - infinite vegetati...  
Wave Function:    • A.I. Texture Generation, High Res (Wa...  
Graph-All:    • #1 Graph-All Equation Renderer - Mult...  
Ray Cast:    • 3D Ray Casting Engine: #4 (Global Gam...  
Scroll Shmup:    • The First Pixel: Devlog #9 - Enemies,...  
Arena Shmup:    • Arena Shmup Demo #3 - Object Pool Opt...  
3D Polygon:    • 3D Polygon Engine #9 - Multiple Mater...  
GW-BASIC:    • GW-BASIC - Escape From Monster Cavern...  

WEBSITES

GitHub: https://github.com/JDoucette
Blog: http://thefirstpixel.com/
Studio: http://xona.com/




Other Videos By Jason Doucette


3 days ago3D Noise Isosurface, "The Core" Virgil, 100M points, Nvidia 4900 GPU
2025-10-12Math Trumpet: Complex values of negative exponential to rational exponents, Nvidia 4900
2024-12-30Neon Highway, 3D Spline Parameterization, Nvidia 4900, 50 Million points
2024-12-26Neon Flow, 3D Splines, Parameterization, Nvidia 4090, 50 Million points
2024-12-18Nvidia GeForce 4090, Restricted Chaos Game Cube, 100 Million points
2024-12-03Nvidia GeForce 4090, 3D Sierpiński Carpet, 125 Million points
2024-11-10Nvidia GeForce 4090, Butterfly Effect - Chaos Theory, Strange Attractor
2024-10-28Nvidia GeForce 4090, Chaos Theory, Lorenz Strange Attractor, 50 Million Dots
2024-10-21Nvidia GeForce 4090, Icosahedron Crystal, 125 Million points
2024-10-13Nvidia GeForce 4090: Chaos Game: Dodecahedron, 125 Million points
2024-08-14#8 Amazing Morphing Asymptotic Sine Graphs
2024-08-09Wall Running, Map View, DOOM + DOOM II, E1M2 (Rerelease, Aug 9, 2024)
2024-08-09Wall Running in DOOM + DOOM II, E1M9 (Rerelease, Aug 9, 2024)
2024-08-04#7 Amazing Morphing Wave Functions: Sine, Grid, 3D, Perspective, Rotate
2024-07-30#6 Amazing Morphing Equations: 3D Perspective, Grid, Rotate, Complex Sine
2024-06-17Nvidia GeForce 4090 GPU, 100 Million points, X-Fractal
2024-04-22Pseudo 3D Road - VGA - Full Tilt - play-through, 2 crashes
2024-04-22Pseudo 3D Road - VGA - Full Tilt - engine test #2
2024-04-22Pseudo 3D Road - VGA - Full Tilt - engine test #1
2024-04-01Game Dev Engine #16. Elementary Cellular Automaton.
2024-03-01Game Dev Engine #15. Munch Man. Sprite Scalar.