r/GraphicsProgramming • • Jul 14 '26

Source Code No WebGL, no AI, no bytes to spare. My new game is a 3D fever dream in 1024 bytes!

983 Upvotes

Play Skydreams: https://killedbyapixel.github.io/TinyCode/1K/Skydreams
Official 1024 byte entry: https://js1024.fun/demos/2026/25/bar
My size code demos: https://github.com/KilledByAPixel/TinyCode

An endless race in the sky inspired by 90's 3D games like sky roads, marble madness, and sonic 3d. My goal was to create a dreamlike experience with full resolution full speed graphics that would be easy to pick up and play.

Having worked on much more complex stuff, it's a lot of fun to start a new project from scratch and make an tiny 3D rendering system. There are a lot of fun challenges trying to fit something in this small of a space that looks cool and runs well. The contest goes until July 19, plenty of time to make something, and there's even a WebGL category.

Features
- 3D level rendering system
- 3D player sphere with shadow
- colorful sky gradient with stars
- procedurally generated levels
- level increases in difficulty over time
- mouse controls
- enhanced version has keyboard and touch input

this is the entire html file. it needs to be RegPacked to fit in 1024k but that will not post into reddit...

<head><title>🌈☁️ Skydreams</title></head>
<body id=b style=margin:0>
<canvas id=a>
<script>
    // JS1024 shim
    a.width = innerWidth;
    a.height = innerHeight;
    c = a.getContext`2d`;
</script>
<script>z=A=B=C=D=E=0,F=H=3,I=a.width/2,J=[],K=(e,h,a,t=1)=>{c.fillStyle=`hsl(${e},${h}%,${a}%,${t})`},L=(e,h,t)=>[a.width/2+(e-z+(t-3)**2/50*Math.cos((B+t)/49))*a.height*.7/t,a.height/2-(h-2+t*t/50)*a.height*.7/t,.7*a.height/t];onmousemove=e=>I=e.x,onmousedown=e=>E=.1,onmouseup=e=>E=0,setInterval(e=>{for(e=500;e--;)K(170+e/9+B,70,70-e/10),c.fillRect(0,a.height*e/500,a.width,a.height/250),K(0,0,99),c.fillRect((e*e+B*e/20)%a.width,e**3.3%a.height,e%4*a.height/500,e%4*a.height/500);for(g=B+40|0;g>B;g--){for(e=J.length;e<=g;)for(D<-8&Math.random()<Math.min(.2,e/1e4)&&(D=2+Math.min(4,e/400)),Math.random()<.1&&(H=2+3*Math.random()|0,F=Math.max(0,Math.min(7-H,F-2+5*Math.random()|0))),D--,J[e++]=k=[],f=7;f--;)k[f]=e<40|.9<Math.random()|D<0&F<=f&f<F+H&Math.random()>Math.min(.2,B/1e4);for(f=2;f--;)for(e=7;e--;)J[g][e]&&([p,q]=L(e-3.5,0,g-B),[r,u]=L(e-2.5,0,g-B),[v,w]=L(e-3.5,0,g-B+1),[x,y]=L(e-2.5,0,g-B+1),f?(K(99+70*(g>>7),70,30+9*(g+e&1)),c.fillRect(v,w,x-v,(40-g+B)/30*a.height)):(K(99+70*(g>>7),70,9+5*(g+e&1)),c.fillRect(p,q,r-p,(40-g+B)/30*a.height),K(99+70*(g>>7),70,60+30*(g+e&1)),c.lineTo(p,q),c.lineTo(r,u),c.lineTo(x,y),c.lineTo(v,w),c.beginPath(c.fill())))}for(0<=A&J[B+3|0][Math.round(z+3)]&&(K(0,0,0,.5),[m,n,l]=L(z,0,3),c.ellipse(m,n,l/4,l/9,0,0,9),c.beginPath(c.fill())),e=99;e--;)K(B/9-e,90,99-.7*e),[m,n,l]=L(z+.1-e/1e3,A+.35-e/1e3,3),c.ellipse(m,n,e*l/300,e*l/300,0,0,9),c.beginPath(c.fill());-4<A&&(z+=I/a.width/2-.25,A+=C-=.006,B+=Math.min(.5,.2+B/5e3),A<0&-.3<A&J[B+3|0][Math.round(z+3)])&&(A=C=E)},16)</script>

r/GraphicsProgramming • • Jul 15 '26

Mandelbrot GUI: Visualizer with Perturbation Theory

Post image
11 Upvotes

Fragment of the Mandelbrot set, using perturbation theory. Coordinate X approx -2.0! View size 1.15e-119! So how do you like it? Rendered using SSAA 2x2 GUI and 8x8 CLI. C++ source code included. https://github.com/Divetoxx/Mandelbrot-2 and https://github.com/Divetoxx/Mandelbrot


r/GraphicsProgramming • • Jul 15 '26

Question Help with ghosting and black noise in a custom Foveated Path Tracer (Summer Research Project)

Thumbnail github.com
4 Upvotes

Hi everyone,

I'm working on a foveated rendering implementation using a path tracer for a summer research project. When the camera is still, it looks fine, but whenever I move the camera, I get heavy ghosting, noise, and blinking black dots in the peripheral areas.

I am modifying a reference path tracer (HLSL/C++). Right now, my foveation logic uses two passes:

  1. Pass 1 (Path Tracer): Skips pixels based on distance from the gaze point (using a 2x2 or 4x4 stride).
  2. Pass 2 (Fill Pass): A compute shader that fills the skipped pixels by copying/interpolating from the sampled ones.

I suspect the issue might be a race condition between the passes, a problem with how the history buffer (g_AccumulationBuffer) blends old frames when the camera moves, or maybe some clamping issues where missed rays snap to 0 or 1.

How to build and run:
You can build the project with CMake:

bash

cmake --build ./build --config Release

And run it with:

bash

./build/bin/Release/scene_viewer.exe

(Note: Please switch from the GUI/rasterizer to the Reference Path Tracer in the settings to see the foveated rendering)

If anyone has experience with foveated path tracing or sees what I'm doing wrong with the accumulation/clamping, I would love some advice. Also, if there's a better/more efficient way to handle the periphery instead of path tracing it at a lower resolution and filling it, please let me know.

Every bit of help is highly appreciated. Thanks!


r/GraphicsProgramming • • Jul 16 '26

Ray tracing tech demo

Thumbnail samfa12.itch.io
0 Upvotes

Hey guys I wanted to test real time ray tracing support from the adreno gpu so made a little tech demo with codex. It runs surprisingly well and the light is fully path traced. I have plans to continue developing this with more rt features.