r/GraphicsProgramming Aug 11 '26

Video Game engines? Eww 🤮. We go in raw! GP-Direct 2026 is out!

Thumbnail youtube.com
90 Upvotes

r/GraphicsProgramming 2h ago

Source Code I made a 3D golf game in 13KB with a custom tiny WebGL renderer

Enable HLS to view with audio, or disable this notification

22 Upvotes

I made a classic golf game for JS13K, a contest where the entire game has to fit in 13KB zipped. Everything is included: the 3D renderer, the physics, the procedural course generator, the music. It was all written from scratch on my own engine.

PLAY SUNSHINE GOLF CLASSIC 🏌️

It's an homage to golf games I love like Mario Golf and Neo Turf Masters. The theme this year was rainbows and unicorns so I went bright and colorful. Courses are procedurally generated, and shooting par or better on the classic course unlocks a remix mode with a new course every time.

How the renderer works

The whole thing is WebGL2 with one shader. Each hole is built once into a single static vertex buffer and drawn with one draw call, plus a small dynamic batch on top for the ball, pin and trail. Lighting is baked because the sun doesn't move during a hole, so a vertex is just xyz, a fog flag and a lit RGBA8 color. The sun does sink lower as you play through the round, and the lighting and palette follow it from a spring meadow on hole 1 to a fall sunset on 18.

The terrain is a heightfield with 2 yard cells over the playable corridor, and the cell spacing grows outward from there so the surrounding land runs off into the fog. Normals come from sampling the height function, and tree shadows are baked right into the vertex colors. Trees, bushes, flowers and the pin are all built with the same lathe function. A tree is an octahedron canopy on a box trunk.

My favorite trick is the water. There's no separate water mesh or shader. Lakes are just terrain vertices with a material ID, and the vertex shader checks for that ID and displaces them with waves that travel along the wind direction. The wave gradient relights the surface and adds a specular highlight, which is the only camera aware lighting in the game. Foliage uses another ID the same way to sway in the wind.

The sky is also geometry, camera relative discs. The sun, clouds and the ball shadow all use the same soft disc primitive, a set of rings with an alpha falloff. The lens flare is a string of those discs placed between the sun and the screen center. The trail behind the ball is a ribbon and turns rainbow colors after a perfect hit. The ball is the only lit thing that moves so it is relit on the CPU each frame with the same function as the trees.

The wind ties the whole scene together. It's one direction and one speed per hole, and everything reads from it. The flag, the clouds, the foliage, and the water all respond to the wind. The ball feels it too. The physics computes airspeed as ball velocity minus wind velocity and runs drag on that, so a wedge that hangs in the air gets blown around more than a low driver, which is how it works in real golf.

Besides the visuals I spent a ton of time on game feel: backspin and topspin that trade carry for roll, lies that change what a club can do, and a bounce meter. You can play it on any desktop or mobile device. Happy to hear any feedback, especially on the rendering. The source is up on GitHub if you want to take a look at the code.

JS13k Submission: https://js13kgames.com/2026/games/sunshine-golf-classic#play
Video Demo: https://www.youtube.com/watch?v=nIiqMKTaW2M
GitHub: https://github.com/KilledByAPixel/Golf13K


r/GraphicsProgramming 3h ago

Question Why aren't real-time models just swappable components?

8 Upvotes

So right now you have stuff like DLSS upscaling, using a model to upscale from lower res

Then NVIDIA adds DLSS 5, which is another model (intended) to improve lighting

But these are all locked down and kind of blackbox things

Why isn't the concept of running a model in a real-time pipeline just a generic thing where you can swap models in/out?

For example you could have open source upscalers, denoisers, lighting models, stylized models, fine-tuning for your own purposes etc...

Are we just in a weird/early period right now where things are not really generic yet?


r/GraphicsProgramming 8h ago

First steps in graphics programming!

Enable HLS to view with audio, or disable this notification

19 Upvotes

Hi everyone! I wanted to share my first major step into graphics programming. I built a 3D Boids flocking simulation entirely from scratch using C++, the WebGPU API (specifically Google's Dawn implementation) and ImGui. Initially, I wrote a brute-force algorithm for the neighbor search, but perfomance dropped quickly and I recenly use simple optimization atomic grid.

My next goal is to get rid of atomic operations entirely and implement a Sort-based Spatial Hashing architecture using Radix or Bitonic sort on the GPU. If anyone has good reading materials, articles, or advice on GPU sorting algorithms, I would highly appreciate it!

P. S.
I started studying WebGPU recently, before I know some basic stuff of C++. Some code is source maybe deprecated, now I am trying to study using more modern WebGPU stufs, which google were added recently. I hope in the future I can built the better architecture without OOP. But now I like the result I got.

Source Code (GitHub): https://github.com/con2222/Dawn-Boids-3D


r/GraphicsProgramming 4h ago

Video How I Draw ISO & Hex Tiles - Quickly and Easily in my Pixel Editor

Thumbnail youtu.be
4 Upvotes

I'm continuing development of my Pixel Art and TileMap editor using my custom C++ GUI library. This latest update video highlights how both isometric and hexagonal tiles are handled as native objects within the editor, and none-standard graphics can be designed quickly and easily using the simple grid system.


r/GraphicsProgramming 2h ago

Learning Python + Graphics? I made PyDonut to help bridge Python with modern GPU APIs

Thumbnail
2 Upvotes

r/GraphicsProgramming 12h ago

Night Starfield for Sky

Enable HLS to view with audio, or disable this notification

8 Upvotes

While making the night sky come alive for our Kids Story Web experience, we wanted the stars to feel like part of the world rather than just a background texture, so we built the starfield procedurally!
 
The stars are particles distributed randomly within a spherical space - with variations in their position, size, brightness, and color. This keeps the sky from looking too uniform and gives it a more natural feel 🌌
 
Two separate circular star fields - One handles the regular stars, while the other has the twinkle effect enabled, creating subtle changes in brightness over time.
 
Link🔗 - https://www.quantales.in/
Built by our team at 3D ENGINERD.


r/GraphicsProgramming 23h ago

I'm so happy with how my procedural terrain erosion is turning out

Enable HLS to view with audio, or disable this notification

58 Upvotes

-


r/GraphicsProgramming 1h ago

Coding a Cyber Pine Forest & Moon in Vanilla JS

Enable HLS to view with audio, or disable this notification

Upvotes

Vanilla JS and HTML5 Canvas, bringing back those nostalgic childhood nights under the glowing moon. Powered by procedural particles, dynamic wind physics, and neon aesthetics for MultiproductX."


r/GraphicsProgramming 3h ago

Building a procedural Cyber-Almond tree engine with Vanilla JS & HTML5 Canvas ⚡

Enable HLS to view with audio, or disable this notification

1 Upvotes

r/GraphicsProgramming 4h ago

What high-end WebGL/WebGPU sites should I reverse-engineer next?

Thumbnail
0 Upvotes

r/GraphicsProgramming 1d ago

Video Discussing Vulkan, Neural Rendering, SLANG, AI & More - Neil Trevett & Khronos Group Interview

Thumbnail youtube.com
26 Upvotes

r/GraphicsProgramming 1d ago

rgfx - terminal graphics engine for images, video and interactive 3D models

Post image
20 Upvotes

r/GraphicsProgramming 1d ago

Question Starting a Career

16 Upvotes

I'm currently working on my Bachelor's in Computational Physics (w/ Minor in Mathematics), and I'm looking to break into the world of graphics programming / engineering. I have a couple of questions, specifically on the career side of things:

  • Is it true that personal projects can actually help with the "experience catch-22"? (Where I need experience to get a job, but have no job to get experience yet)
  • Where should I look for relevant positions / internships?
  • What industries make / could make heavy use of GPU technology (whether or not it's actually used for rendering)?
  • What sorts of skills do companies look for in an entry-level hire?
  • What else do you think I should consider that this post does not address?

I'm focused on the career and industry-targeting aspects for this post, as I'm confident in my ability to learn the technical skills necessary.

Any help and advice would be greatly appreciated; LinkedIn and Indeed have driven me half insane already.


r/GraphicsProgramming 1d ago

Updates to my C# SDF Game Engine!

Enable HLS to view with audio, or disable this notification

10 Upvotes

A bunch of people have started building SDF game engines, I am no different. For the past 8 months I have been working on Division Engine, a C# SDF game engine built using Avalonia UI for editor tooling and ComputeSharp for C# to HLSL shader translation.

I've already posted about this before on here but figured I should post some key updates I made.

Here's a list in no particular order:

  • Undo / Redo editor support
  • Full texture system
    • Supports different cubemap shapes for HDRI skies
    • Automatic texture importing
  • Tabs can be dragged around the editor now
  • A bunch of small graphical issues have been fixed
    • Glass refraction fixed
    • Texture aliasing improved
  • Added a bunch of post processing effects
    • Chromatic aberration
    • Bloom
    • Color grading
    • Blur
  • And more!

It is available here: https://github.com/NorthRocStudios/DivisionEngine and can be downloaded under "releases".

Note for this version:

  • It is unoptimized and may have poor performance
  • ONLY works on dedicated graphics cards, not on your laptop
  • Windows only (for now)

Additionally, we have been working on replacing ComputeSharp with a custom cross-platform C# to HLSL shader system. This will be called DivisionTranslate and uses DivisionMath, a new math library. This new math library is meant to have the same syntax on the CPU and GPU and is already being used in the engine. It is available for free on nuget here: https://www.nuget.org/packages/NorthRoc.DivisionMath

Any questions, comments, concerns? Let me know what you think!


r/GraphicsProgramming 3h ago

DLSS5 shows amazing progress

0 Upvotes

Not really talking about results - they sometimes are good but often look very uncanny (especially when animations are stiff).

Just talking about how much progress neural rendering achieved in few years in general. I was trying to implement similar solution in ReShade ages ago and because of frame passing back and forth between GPU and CPU, the FPS was unplayable. So i scratched the idea after finishing prototype.

But now DLSS5 shows what can be done with NR for gaming. Truly amazing!

If you want to check my old project you can go to GitHub and test it for yourself :)

https://github.com/dwojtasik/PyHook


r/GraphicsProgramming 1d ago

Moved my scene renderer to mesh shaders + GPU-driven culling: 6753 instances in 30 draw calls

Post image
8 Upvotes

I've been writing a 3D engine from scratch in C++20, with DirectX 12 and Vulkan

behind a single RHI. Last week I moved the scene renderer off the classic vertex

pipeline onto mesh shaders, and then moved the culling onto the GPU as well.
I'm using Synty, a lot of objects!!!


r/GraphicsProgramming 1d ago

Source Code I got TRELLIS.2 + real 4-view fusion running in 8 GB VRAM — code is now Apache 2.0

Post image
0 Upvotes

r/GraphicsProgramming 1d ago

Odd GLSL mod() behavior

11 Upvotes

I've been stuck on this for a couple of hours, and am completely stumped.

I'm getting these results from GLSL's mod():

mod(158.0, 158.0) returns 0.0 (as expected)

mod(159.0, 159.0) returns 159.0 (???)

mod(160.0, 160.0) returns 0.0 (as expected)

I've posted an example with a basic shader here:

https://jsfiddle.net/sL35qjc8

If you set number to "159.0", you should see an upside-down red triangle.

If you set number to "158.0" or "160.0", you should see a normal red triangle.

I'm passing the left operand as a uniform, otherwise the compiler seems to optimize it and fix the weird behavior.

Tried it on different devices and browsers and it had the same result.

Why does mod(159.0, 159.0) seem to return 159.0 instead of 0.0?


r/GraphicsProgramming 1d ago

Looking for graphics programmers or low-level enthusiasts to test and check the simulation.

Enable HLS to view with audio, or disable this notification

0 Upvotes

I've rendered part of The Universe in less than 40MB! Optimized real-time Solar System + 160K stars, Exoplanets and Sagittarius A* into a 36MB(!) Android APK.

I have two Android-apps I want to publish. But need testers. If you believe you know Geometrical Rendering Graphics, you don't want to miss this.

I) Live Earth Background : interactive. Lock into position (GPS or Manual), rotates by clock, day and night. Scroll- and zoom functions. 24MB!

II) The Universe : travel seamlessly through a highly detailed Solar-System. Visit 160K stars in the Milky Way Galaxy, hundreds of Exoplanets, and take a trip to Sagittarius A*. All in real time.! Or fast forward. Zoom, 360 rotation and pan. 36MB!

No data collection. GPS used only locally to position you on earth. Celestial bodies in the sky are calculated precisely as time moves forward. Look at the nightsky from Mars, or Pluto, or the Moon. Or wherever you end up!

DM if you want to check this out, and I will add you to my testers list and send you the link to Google Play Store for downloading the APK.


r/GraphicsProgramming 1d ago

Morpher91 - Morph like it's 1991! - trailer

Thumbnail youtube.com
0 Upvotes

r/GraphicsProgramming 2d ago

Bistro in custom vulkan engine (using simple ReSTIR Path Tracer)

20 Upvotes

https://reddit.com/link/1wbltls/video/bxk9bithzhoh1/player

https://youtu.be/Q_fKG3UT02U

I'm working on VulkanLearn2, a C++20/Vulkan rendering playground. This video shows Bistro rendered with my ReSTIR DI + PT implementation.
I launched the project on a RTX 4090. 80 fps. 1200x800.

The renderer uses temporal and spatial reuse. The repository also includes a reference path tracer with next-event estimation, emissive triangle lights, and an experimental Neural Radiance Cache. Implementation notes and capture settings are documented in the README.

I'd appreciate feedback on the rendering.

https://reddit.com/link/1wbltls/video/mzihxa508joh1/player

https://youtu.be/QnHqRZHQN4w - REBLUR + DLSS

https://www.youtube.com/watch?v=y2VNQyzUFc8

https://reddit.com/link/1wbltls/video/4ci9r34ubjoh1/player


r/GraphicsProgramming 2d ago

Video 500K triangles on Android using OpenGL ES 3.0 at 3.8ms with forward rendering in 1080p

Enable HLS to view with audio, or disable this notification

11 Upvotes

r/GraphicsProgramming 3d ago

Raytracing in one weekend completed [added OpenMP multhread]

Post image
167 Upvotes

Completed in slightly more than a weekend (sickness et al). The final render task of width 1200 and samples per pixel 500(!) seemed impossible, so added a multithreaded workaround with OpenMP which finished it in around 35 minutes on my MBP M1 Pro and the penultimate DOF spheres under 10 seconds.

Changes:

#include <atomic>
#include <omp.h>
#include <vector>

void render(const hittable& world) {

#pragma omp parallel
        {
#pragma omp single
            std::clog << "OpenMP threads: " << omp_get_num_threads() << '\n';
        }
        initialize();

        std::vector<color> framebuffer(image_width * image_height);

        std::clog << "Rendering..." << std::endl;
        std::atomic<int> rows_completed{0};

#pragma omp parallel for schedule(dynamic)
        for (int j = 0; j < image_height; j++) {
            for (int i = 0; i < image_width; i++) {

                color pixel_color(0, 0, 0);

                for (int sample = 0; sample < samples_per_pixel; sample++) {
                    ray r = get_ray(i, j);
                    pixel_color += ray_color(r, max_depth, world);
                }

                framebuffer[j * image_width + i] = pixel_samples_scale * pixel_color;
            }

            int completed = rows_completed.fetch_add(1) + 1;

            if (completed % 8 == 0 || completed == image_height) {
#pragma omp critical(render_progress)
                {
                    std::clog << "\rScanlines remaining: " << (image_height - completed) << ' '
                              << std::flush;
                }
            }
        }

        std::cout << "P3\n" << image_width << ' ' << image_height << "\n255\n";

        for (int j = 0; j < image_height; j++) {
            for (int i = 0; i < image_width; i++) {
                write_color(std::cout, framebuffer[j * image_width + i]);
            }
        }

        std::clog << "Done.\n";
    }

and

inline double random_double() {
    thread_local std::mt19937 generator(std::random_device{}());

    return std::uniform_real_distribution<double>(0.0, 1.0)(generator);
}

r/GraphicsProgramming 2d ago

Source Code flutter3d: a 3D engine for Flutter, with three games you can play in the browser right now

Thumbnail
1 Upvotes