Rendering the Simulation Theory: Exploring Fractals, GLSL, and the Nature of Reality

An exploration of fractals, GLSL, and simulation theory, revealing their deep connections to art, mathematics, and the nature of reality.

At Codrops, we love featuring unique perspectives that push the boundaries of digital art and technology. Yohei Nishitsuji’s work is a fascinating mix of physics, machine learning, and digital art, turning complex ideas into visually striking expressions. His approach to fractals, GLSL, and mathematical aesthetics isn’t just about creating art—it’s a way of exploring the nature of existence itself. We found his perspective truly inspiring, so we invited him to share his journey and insights with the Codrops community.

Everything is a Wave

The wave equation has been a crucial part of my research on Earth’s and the Moon’s internal imaging for over 15 years. As I analyzed moonquake data from NASA’s Apollo missions day after day, a strange sensation came over me.

Everything I saw, heard, touched—even my own existence—began to appear as waves, and I could feel it in my body. This experience changed the way I perceived the periodicity of waves, giving it an entirely new meaning.

The key concept here is fractals. What follows may challenge your expectations, but I hope you’ll enjoy reading to the end.

Fractal Universe

Seashell patterns, coastlines, vascular structures, flower petals, forests, and galaxies—all of these are shaped by visual fractals. Bach’s canons also exhibit infinite fractal properties, and harmonious sounds contain fractal characteristics with multiple overlapping layers. I began to notice a deep connection between visual and auditory experiences.

Our senses are not limited to sight and hearing. Fractals emerge in the tactile experience of complex textures, in the intricate layers of flavors and aromas that blend to create a single dish. In essence, everything is fractal. And these are just the five senses we humans have conveniently labeled. In a universe without ego—or consciousness as we define it—I started to feel that a fractal nature might extend beyond these familiar senses.

If such fractal properties exist, they may belong to a realm of quantum physics or mathematics that we have yet to fully understand. And if such a realm exists, it suggests that the reality we perceive might be far simpler to describe than we ever imagined.

Religion and Philosophy

It’s possible to reach similar conclusions through paths other than quantum physics and mathematics. For example, Kūkai attained the state of “becoming a Buddha in this very body” (sokushin jōbutsu), describing the universe as an infinite flow of energy, symbolized by the mandala world. In psychoanalysis, Jacques Lacan spoke of the primordial sea, suggesting the existence of a “Real” beyond our lived experience—a fundamental reality that underlies all religious thought, separate from the world as we usually perceive it.

The division between what is considered scientific and what is not is merely a matter of human convenience. Through physics, religion, and philosophy, I wanted to illustrate that, from a perspective beyond humanity, these distinctions do not exist.

This sensation came directly into my body from the universe, something beyond what words can convey. For a long time, I carried it with me, guided only by these waves. But as the feeling became overwhelming, I began to express it outwardly—through ART, through what I call “EXPRESSION.”

My Expression: Art

My artistic expression revolves around the idea that “the world humans visually perceive as reality can be described with remarkable ease,” a concept closely tied to simulation theory. In simple terms, simulation theory suggests that our world may exist within a computer or be capable of being simulated.

Through my work, I seek to embody this idea by creating visually striking and realistic pieces using the shortest possible code.

The focus on brevity comes from a simple principle: the more realistic the outcome, the harder it becomes to distinguish from reality—especially when achieved through longer code or high-performance computing. By stripping it down to minimal yet powerful expressions, I explore how complex and impactful visuals can emerge from the simplest of codes.

GLSL

Up to this point, it’s clear that my background is in physics, mathematics, and Earth and planetary sciences. Initially, I had no experience in creating visual expressions. As I explored, I came across Processing and GLSL.

I started with Processing, but it didn’t quite align with the kind of visual expression I had in mind. GLSL, on the other hand—especially fragment shaders for color and design—was exactly what I was looking for.

Eventually, I discovered twigl.app, a GLSL editor, and learned about techniques for extreme code minimization. One such challenge is called “geekest (300es),” which involves creating shader art under strict character limits. I found a hashtag on X (Twitter) (#つぶやきGLSL) where artists share works created under this constraint, so I began sharing my own expressions there. The character limit for the programming code, excluding the hashtag, is 267 characters.

I’m deeply grateful to the creator of twigl.app and to those who built the culture around #つぶやきGLSL.

Featured Work

“Emptiness, your infinity”

I often use noise functions like fBM or Perlin noise, while at times, I rely on custom functions. In this piece, I used a customized function and applied ray marching for illumination. The code is exactly 267 characters long.

The visuals are simply an external representation of my overflowing inner sensations, always grounded in deeper philosophical and scientific motivations.

This work is inspired by the Huayan Buddhist concept of “one is many, many is one” (一即多 多即一), illustrating how the universe and energy emerge from emptiness (空, kū) while simultaneously encompassing everything.

As I’ve explained, brevity is essential in my work, so I don’t usually share code that is easily readable. However, for those with a particular interest, I do occasionally provide explanatory text. For this piece, here is an example:

// Original shader by Yohei Nishitsuji (https://x.com/YoheiNishitsuji/status/1880399305196073072)
// Adapted for Shadertoy

// HSV to RGB color conversion
vec3 hsv(float h,float s,float v){
    vec4 t=vec4(1.,2./3.,1./3.,3.);
    vec3 p=abs(fract(vec3(h)+t.xyz)*6.-vec3(t.w));
    return v*mix(vec3(t.x),clamp(p-vec3(t.x),0.,1.),s);
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 r = iResolution.xy;
    vec2 FC = fragCoord.xy;
    float t = iTime;
    vec4 o = vec4(0,0,0,1);
    float i,e,g,R,s;
    
    // Initialize ray direction for ray marching
    // Offset by 0.6 creates a perspective effect
    vec3 q,p,d=vec3(FC.xy/r-.6,1);
    
    // Main loop for ray marching
    // This loop advances the ray and accumulates color
    for(q.zy--;i++<99.;){
        // Accumulate 'density' along the ray
        e+=i/8e5;
        
        // Color accumulation using HSV
        // This creates a gradient effect based on the ray's position and properties
        o.rgb+=hsv(.6,R+g*.3,e*i/40.);
        
        // Ray marching step size
        s=4.;
        
        // Advance the ray
        p=q+=d*e*R*.2;
        
        // Accumulate vertical displacement, creating layered effect
        g+=p.y/s;
        
        // Transform space, creating repeating structures
        // R = distance from origin, creating spherical symmetry
        // sin(t) adds time-based animation
        // exp2(mod(-p.z,s)/R) creates exponential periodic structures along z-axis
        p=vec3((R=length(p))-.5+sin(t)*.02,exp2(mod(-p.z,s)/R)-.2,p);
        
        // Inner loop for detailed surface generation
        // This loop creates a noise-like pattern using trigonometric functions
        for(e=--p.y;s<1e3;s+=s)
            // This line generates a type of procedural noise
            // It's not classic FBM (Fractional Brownian Motion) or Perlin noise
            // Instead, it's a custom noise function using sinusoidal patterns
            // The dot product of sin and cos creates interference patterns
            // Dividing by 's' makes higher frequency contributions smaller
            e+=.03-abs(dot(sin(p.yzx*s),cos(p.xzz*s))/s*.6);
        
        // 'e' now contains the accumulated noise value
        // This affects both the color (in the outer loop) and the ray marching step
    }
    
    // Final color assignment
    fragColor = o;
}

You can view this code on Shadertoy.

“Macroscopic microscope”

Fractals dissolve the boundaries between scales. Galaxies and atoms, you and I, the universe and quantum particles—all exist as part of the same interconnected reality. I keep slime molds as pets, and when I observe them under a microscope in the park, a universe unfolds before me.

This work embodies the feeling of infinite connectivity between the large and the small. It is one of my most deeply explored themes, and I have created numerous works based on this idea. If you’ve read this far, it should be no surprise that the character count for this piece is also minimal.

Below, I’ll briefly introduce some of my other works. Each of them adheres to my 267-character limit.

“Macroscopic microscope” series. This one simulates fungi.
“Macroscopic microscope” series. This one simulates the sea floor.
“Geometric play”
“Simulated reality”
“Deep Galaxy”
“Castle to castle”
“Microbe”
“Ocean Ball”

Wonderful Encounters

By expressing the feelings I had once carried alone through art, I found myself connecting with incredible people. I was invited to the podcast “normalize.fm” (spoken in Japanese) by the creator of twigl.app, and I also had the opportunity to appear on a program on the Japanese television station RKB.

Through conversations with Vercel’s CEO Guillermo Rauch, I’ve received support in exploring new directions for my shader work. Additionally, I was invited by Manoela Ilic of Codrops to write this article. For all of these encounters, I am deeply grateful to the universe.

Lastly, I’d like to share one more story. My father is an abstract painter. As a child, I had no interest in painting—perhaps I even made a conscious effort to avoid it. Instead, I chose to study natural sciences at university. But as I progressed in my research during my PhD, I unexpectedly found myself drawn back into the world of painting that I had once distanced myself from. I imagine many of you have experienced something similar—a path that eventually leads you right back to where you started.

Art
Science
Philosophy

I am nobody, but I am you.

Yohei Nishitsuji

Researcher and digital artist dissolving the intersection of physics, machine learning, and simulation aesthetics, using fractals, GLSL, and mathematical expressions to visualize the complexities of nature and consciousness.

The
New
Collective

🎨✨💻 Stay ahead of the curve with handpicked, high-quality frontend development and design news, picked freshly every single day. No fluff, no filler—just the most relevant insights, inspiring reads, and updates to keep you in the know.

Prefer a weekly digest in your inbox? No problem, we got you covered. Just subscribe here.