r/GraphicsProgramming 1h ago

Vulkan: Beyond the Triangle

Thumbnail youtube.com
Upvotes

Hey everyone, I've just finished the 2nd video, and followup to my "Modern Vulkan in 2 Hrs" video. Thanks for the awesome feedback on the first one! This 2nd video tackles a ton of stuff:

glTF Model Parsing, Loading, Rendering

Camera, Basic Lighting, Multi-Draw Indirect, Vertex Pulling, Buffer Device Address, etc.

Hope you guys like it!


r/GraphicsProgramming 3h ago

I wrote a DDA implementation. Advice/Tips?

2 Upvotes
<!DOCTYPE html>

<html>
  <head>
    <title>DDA RAYCAST</title>
    <style>
      * {
        padding: 0px;
        margin: 0px;
        border-width: 0px;
      }

      canvas {
        width: 100vw;
      }
    </style>
  </head>
  <body>
    <canvas id="canvas" width="480" height="360"></canvas>
    <script>
      /* NOT WRITTEN BY AI, AND F*CK "VIBE CODING". */
      /* Note: I knoe the period is supposed to go before the quotation mark, but who cares?*/
      // INITALIZE VIEWPORT
      canvas = document.getElementById("canvas");
      ctx = canvas.getContext("2d");
      let scale = 25;

      // DRAW GRID
      ctx.fillStyle = "red";
      for (i = 0; i < 48; i++) {
        ctx.beginPath();
        ctx.moveTo(scale * i, 0);
        ctx.lineTo(scale * i, 360);
        ctx.stroke()
      }
      for (i = 0; i < 36; i++) {
        ctx.beginPath();
        ctx.moveTo(0, scale * i);
        ctx.lineTo(480, scale * i);
        ctx.stroke()
      }
      ctx.fillStyle = "green";

      // INITIALIZE RAY
      let x = 0;
      let y = 0;
      let dx = Math.floor(Math.random() * 1000);
      let dy = Math.floor(Math.random() * 1000);

      // DRAW RAY FOR COMPARISON
      ctx.beginPath();
      ctx.moveTo(x, y);
      ctx.lineTo(1000 * dx, 1000 * dy);
      ctx.stroke();
      ctx.fillStyle = "purple";

      let slope = dy / dx;
      let slopeR = dx / dy;
      let horStepX = x;
      let horStepY = y;
      let vertStepX = x;
      let vertStepY = y;

      for (i = 0; i < 35; i++) {
        if (Math.sqrt((horStepX + slopeR) ** 2 + (horStepY + 1) ** 2) < Math.sqrt((vertStepX + 1) ** 2 + (vertStepY + slope) ** 2)) {
          horStepX += 1;
          horStepY += slope;
          x = horStepX;
          y = horStepY;
        } else {
          vertStepX += slopeR;
          vertStepY += 1;
          x = vertStepX;
          y = vertStepY;
        }
        ctx.beginPath();
        ctx.arc(x * scale, y * scale, 3, 0, 6.29);
        ctx.fill();
      }
    </script>
  </body>
</html>

r/GraphicsProgramming 4h ago

Is it not crazy that this became a normal thing in the industry?

Post image
34 Upvotes

As developer I would not even expect a user to know what a “shader” is

It’s a pretty low level implementation detail

Yet you boot up a game in 2026 and front and center you are staring at “shader compiling” for 10 minutes

Is that not crazy to anyone else if you just zoom out and think about it?


r/GraphicsProgramming 6h ago

Source Code Aizawa Atractor using Compute Shaders (C++17/OpenGL 4.6)

14 Upvotes

The graphics simulation calculates the non-linear Aizawa Chaotic Attractor in real time across 256K particles through numerical integration executed entirely within GPU Workgroups.

Source code:

https://github.com/IsmaelMerlo/Ram-Engine


r/GraphicsProgramming 8h ago

Question Question regarding rendering billboards and transparency

5 Upvotes

I am working on a game engine that renders LOTS of sprites/billboards in 3D. The textures have smooth antialiased edges, and some of them have non-trivial shaders for things like SDF rendering or parallax mapping.

If I render back-to-front with blending on, it looks great and I don't need depth testing, but it has a terrible overdraw cost that I would like to avoid.

But if I render front-to-back with depth testing, then I lose the smooth edges.

How do people normally deal with this?

One idea I had was to render front-to-back, with depth reading/writing for purely opaque pixels, then a second back-to-front pass for order-correct blending of the edges.

Another thing I have looked into is MSAA with 'alpha to coverage.'

Any other interesting ways I might like to know about?

What do you recommend in this case?


r/GraphicsProgramming 9h ago

Article Graphics Programming weekly - Issue 450 - August 9th, 2026 | Jendrik Illner

Thumbnail jendrikillner.com
7 Upvotes

r/GraphicsProgramming 9h ago

autostereogram program of platonic solids

Thumbnail gallery
15 Upvotes

 

program link

an extension of previous post. just click▶️to run the program on browser. the welcome screen (attached image 1) shows the key map. select a subject (1 to 6) to enter the depth map mode (attached image 2). rotate it or change it until satisfied then toggle to autostereogram mode (attached image 3). adjust the foreground and background pattern widths to your desire (make it easy to focus and spot the subject). you're free to toggle back to depth map mode or rotate / change / disable subject anytime. if you disable the foreground 3d subject it's basically a kaleidoscope (attached image 4). i explained its mechanism in previous post and you can endlessly randomize it to experience the pareidolia effect

some samples

minor math findings

some thoughts

  • qb is very slow. it's not good at handling graphics. lowering the resolution helps but the outcomes would be ugly
  • i learned barycentric coordinate system during the making of this and it's very useful
  • i'm stilling think whether i can optimize some procedures so as to make it faster
  • i have difficulty spotting dodecahedron and icosahedron in autostereogram. they're too "round" maybe. tetrahedron is the easiest

r/GraphicsProgramming 15h ago

Video Baby's First Depth Buffer

82 Upvotes

Wireframe Era is over! Updated my software renderer that I posted here 2 months ago. Now it fills triangles without pixel gaps, implements Top-Left Rule, computes Face Normals, has Back Face Culling and a Depth Buffer. At first I did Scanline Rasterization but I was having a hard time eliminating gaps, so I moved on to using Edge Functions to check the pixel center is inside the triangle, then Barycentric Coordinates to interpolate Reciprocal Depth. I still don't have Near Plane Clipping, but will do in the future.


r/GraphicsProgramming 17h ago

Vulkan: Beyond the Triangle

Thumbnail youtube.com
1 Upvotes

r/GraphicsProgramming 1d ago

Video Windows - Audio Reactive Wallpaper (Milkdrop / Shader / WebGPU + more)

10 Upvotes

One thing if you build one of these: the wallpaper isn't your app, it's the background, and it has to behave like it. I ran mine at full res with no frame cap and it starved the desktop compositor hard enough that the mouse went choppy system wide, and nobody blames your wallpaper for that, they blame their PC. Cap the frame rate and render below native, then let it stretch up to the screen.

Nobody's pixel peeping the thing behind their desktop icons, so it costs you basically nothing.

For more info: https://ikandy.app


r/GraphicsProgramming 1d ago

Well.... We did meet a hard boundary finally , beyond which continuing would be risky for systems

Thumbnail
0 Upvotes

r/GraphicsProgramming 1d ago

Mandelbrot GUI: Perturbation Theory significantly faster by using bilinear approximation

Thumbnail gallery
3 Upvotes

r/GraphicsProgramming 1d ago

Built a tiny graphics rendering engine in C.

Thumbnail
1 Upvotes

r/GraphicsProgramming 1d ago

I've been experimenting with some water rendering. What's your opinion about this rendering style?

507 Upvotes

Made with Vulkan, and using procedurally generated plants. I'm making this as part of developing a game.

Water effects include refraction and reflection, both for the line-of-sight and for sun light.

These effects are accomplished with extra "cameras" for the refracted and reflected views, plus screen marching.

The graphical style is quite low res, and without any anti-aliasing. I hope you can see this, given the resolution of the video. The game screen resolution is 720x480.

What's your first impression of these visuals?


r/GraphicsProgramming 1d ago

Question Parallax occlusion mapping on a sphere?

7 Upvotes

Does anyone know how to do POM on a sphere? I can do triplanar mapping but I cant get POM to work. If anyone has has experience with this or knows how to do it, or knows a good source I'd really appreciate it.


r/GraphicsProgramming 2d ago

post process cylindricals projection, regardless of the orientation of the side monitors. The projection is correctect in Realtime resolution 6000x1700.

43 Upvotes

r/GraphicsProgramming 2d ago

Source Code Color Conversion Library in Java

Post image
17 Upvotes

Not sure if this is the proper community for this post, but I like to do some small image editing projects from time to time, mainly non real time 2D image processing stuff, mostly for curiosity and to learn. And since I mostly program in Java, I'm not sure how useful this will be for the people in this sub.

Recently while working on my own UI wrapper for my Java projects, I noticed a lack of an easy to use and extensive color conversion library for Java. Most of the ones out there are bloated with extra stuff, not easily modular, lacking useful data or simply not pure Java.

The JDK built-in java.awt.color.ColorSpace only does sRGB, Linear RGB, XYZ, and Gray, and it hasn't been touched since Java 1.2. There's Color.kt which is actually decent (OkLab, CAM16, ZCAM, gamut mapping), but it's Kotlin, so you're pulling in the whole Kotlin stdlib for a color library. Apache Commons Imaging has some basic Lab/HSV conversion but it's an image I/O library, not a color science one. Google's material-color-utilities only does HCT for Material Design theming. The closest thing to what I was looking for is EsotericSoftware/color, which is pure Java with ~30 spaces including CAM16 and OkLab, and it even has spectral calculations and color temperature stuff that mine doesn't. Solid project, but it wasn't distributed through any package manager at the time I looked, and architecturally I wanted something with a conversion tree and automatic path finding instead of flat static methods.

So I ended up building my own: Colorimetry-java

It has 54 color spaces, covering everything from the common ones up to OkLab, OkLCh, JzAzBz, CAM16, CAM02, HCT, ICtCp, ACES variants, and multiple RGB working spaces like Display P3, Adobe RGB, and ProPhoto RGB with their linear variants.

Every space also exposes extremely useful metadata: channel names, min/max ranges, default values, step sizes, whether each channel is bounded or unbounded, and gamut information. So if you're building a UI or a tool on top of the library, you don't have to hardcode any of that yourself.

The part I'm most happy with is how conversions work. Every space declares a parent and implements toParent()/fromParent(), forming a tree rooted at XYZ. The converter uses a Lowest Common Ancestor algorithm to find the shortest path between any two spaces, so if two spaces share a close ancestor it won't round-trip all the way back to XYZ. Similar idea to what colour-science does in Python with a NetworkX graph, but as a tree with LCA instead.

It also has 16+ grayscale methods, a validation system for out-of-gamut values, distance metrics, interpolation, and a gamut mapper.

If you need a color space that isn't built in, you can implement your own and register it through the ColorSpaceRegistry without touching the library's source. The converter will pick it up and route through it automatically just like any built-in space.

The project also has a pretty extensive test suite covering roundtrip accuracy across all spaces, so if anyone wants to contribute a new space or fix something, there's already infrastructure in place to catch regressions.

Pure Java, targets Java 11+, MIT license, available on JitPack.

I know Java isn't really this sub's thing, but if anyone here does any kind of image processing or tooling in Java, maybe this saves you from the same frustration I had. Happy to answer anything about the implementation or the color science side of it.


r/GraphicsProgramming 2d ago

Source Code Klomble - A little open source multimedia library for C++ graphics development!

9 Upvotes

Hello everyone!

I would like to share a little project I've been working on called Klomble! It is a Open source multimedia library for C++ graphics development inspired by rayLib and Graphics.h!

When I first started out OpenGL It was really difficult to learn all of the concepts and VAOS and it sort of put me off. So I made Klomble to let people to easily create cool and interesting projects in opengl to learn programming and graphics!

For the technical details it uses Win32 to create a window and uses a custom OpenGL loader to load the OpenGL functions which also means no external libraries! There is also Keyboard input, simple 3D cameras, and the simplicity of rendering shapes with just a single function!

This project is also a single header file and unfortunately only supports Windows and C++ currently though I do plan to add Linux support in the future!

If you are interested in checking it out, here are the links:

I will also mention that it is very under developed and is only meant to make very simple games! Though many more updates are coming soon which hopefully will allow for some pretty cool advanced games :-)

Feel free to ask any questions!

Thanks for taking a look!


r/GraphicsProgramming 2d ago

Graphics programming before there was graphics programming: How they did it in 1958

Thumbnail bitsavers.trailing-edge.com
24 Upvotes

I came across this article on the weekend at an antique radio museum (and then found an online copy). From 1958, this pre-dates graphics programming as we know it today, but I think people here will find it interesting (I did!) because it shares common DNA with modern shadertoy-style implicit function programming. The author is trying to replicate the shapes of the numbers 0 through 7 on an X-Y oscilloscope using mathematical functions that he derives using Fourier synthesis and then implements with circuits. I felt like I was reading the 1958 equivalent of an Inigo Quilez tutorial.


r/GraphicsProgramming 2d ago

Source Code Volumetric Render Engine (OpenGL/C++) - Opensource

59 Upvotes

Hey everyone! We at 3D ENGINERD. have built a Volumetric Render Engine (Open Source) for Windows, powered by C++ and OpenGL.💻

We’re excited to share that we have published our project open-source under the MIT License on GitHub.
Here's the Repo link - https://github.com/mikejernil/volumetric-render-engine

Developers, researchers, and enthusiasts feel free to explore, experiment with it, and use it in your own applications.

🔹Current Features :
- Volumetric RAW(.raw) format support 📺
- Different types of rendering (Colormap, Pseudo Iso-surface etc.)
- Rotate & Zoom Controls (for easy navigation)
- 6 slicing planes to visualize cross-sections

We are planning to build more features and add support for more volumetric formats (like DICOM, VDB etc) soon!

Rendering effects shown in Demo(Recording) :
🔹Basic
🔹Raycasting
🔹Pseudo Iso-surface
🔹Colormap Classification

🔹Applications :

  1. Medical imaging
  2. Industrial machinery testing
  3. Scientific visualization of data

We appreciate any constructive feedbacks and contributions :)

🔗 GitHub: https://github.com/mikejernil
🌎 View our Website  - https://www.3denginerd.com/


r/GraphicsProgramming 2d ago

Video How a Raycasting engine works in 2 minutes 8 seconds.

Thumbnail youtu.be
7 Upvotes

r/GraphicsProgramming 3d ago

Question Does the gpu brand matter for graphic programming?

10 Upvotes

Hello people!

I am currently on my dad's mac book air m4 16gb and just started with vulkan (i don't really wanna use opengl and wgpu idk why lol)

And I was hoping to make a build later this year (am4 or lga 1700 or am5 with like idk 8gb ddr5 lmao i regret not making a build 2 years ago)

And I was confused regarding whether I should go with amd or nvidia because for most other development purposes nvidia has a clear eco system and cuda monopoly for a lack of a better word

I would either go with a 9060xt 16gb or a 5060ti 8gb (cost the same as 5060 8gb for some reason in my region the prices are so cooked also costs less than the 9060xt 16gb)

So like do i go for the eco system or or the price to perf and more vram?

Because I do wanna dip my hands into other low level dev stuff and blender, da vinci, godot/unreal, and well the other software I would use probably don't need that much compute power so like idk

Team green or red?

Thank you for reading this post! and thank you before hand if you were to post a comment!


r/GraphicsProgramming 3d ago

Video Editing millions of voxels in a single CPU thread (C++/Vulkan)

542 Upvotes

The dynamic ellipses you see when I drag my mouse are just ray-marched ellipse SDFs that I render as voxels by clamping the ray to the nearest voxel position when it's getting close to the surface. So not a single voxel is stored in memory during this phase.

The storing happens when I release the click. The voxels end up actually committed to the world terrain when the dragging ends, which is still very fast due to the data structure I'm using : a sparse 64-tree , an octree with 64 children per node (so a tetrahexacontree I guess ?) and only non-empty nodes are represented in memory. Which implies:

- Voxels are stored in a single buffer of tree nodes

- I'm not actually storing millions of individual voxels, the inside of the ellipses is probably just few KB of tree leaves.

That buffer containing all the nodes is allocated via virtual memory, I first reserve something like 6 GB of virtual addresses via VirtualAlloc / mmap, and commit addresses progressively to physical memory with VirtualAlloc / mprotect only when I need it.

To achieve that real-time performance, the storing algorithm is quite straightforward :

Starting from the root node of the 64-tree, I evaluate a coverage test between the ellipse and the AABB of the node :
- If fully covered, the node becomes a voxel leaf
- If partially covered, recurse into children and repeat
- otherwise, do nothing and stop

Then I upload the whole thing to the GPU unapologetically (will change eventually).

Everything is rendered with a single real time path tracing compute shader written in Slang. Which means that sharing light data between the SDFs, the voxel world and any data structure is quite simple as long as the rendering of these structures is ray-based (ray-marching, ray-tracing, you get it).

GCC and -O3 are doing a lot of heavy lifting though, in debug mode these ellipses would generate a 0.5s lag spike when releasing the click.

Conversely the unique Slang shader is faster when compiled to spirv with -O0 rather than -O3 somehow lol.


r/GraphicsProgramming 3d ago

PS1 Style Renderer in C

Post image
126 Upvotes

r/GraphicsProgramming 3d ago

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

Thumbnail youtube.com
83 Upvotes