Nvidia GeForce 4090, 3D Sierpiński Carpet, 125 Million points
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/

