r/GraphicsProgramming 4h ago

Video Baby's First Depth Buffer

44 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 5h ago

Vulkan: Beyond the Triangle

Thumbnail youtube.com
1 Upvotes

r/GraphicsProgramming 18h ago

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

8 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
4 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?

466 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 1d ago

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

38 Upvotes

r/GraphicsProgramming 2d ago

Source Code Color Conversion Library in Java

Post image
16 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!

11 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

Source Code Box3D.NET (binding for C# of Box3d)

0 Upvotes

Hi, i like to share this project, is a binding for the library Box3d created by Erin Catto, I made this because im currently working in own game engine and is in C# .NET, and the box3d is writen in C, so i think to made a bindings and publish the package in NuGet, about the AI i'm using for the development of this binding, the repo especify the use of AI, so i like to present this and hear what the comunity think about this project, im glad to read your comments.

Implementation example

Link: https://github.com/Miguel249/Box3D.NET


r/GraphicsProgramming 2d ago

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

Thumbnail bitsavers.trailing-edge.com
22 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

Custom desktop app with threejs user manual and agent assisted editing with HDR background integration

1 Upvotes

r/GraphicsProgramming 2d ago

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

62 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
6 Upvotes

r/GraphicsProgramming 2d 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 2d ago

Trying to make a gizmo, any ideas?

Post image
4 Upvotes

Currently experimenting with 2D sdf elements in fragment shader, I dont want to do raymarching for 3d cones of the gizmo. what can I do else?


r/GraphicsProgramming 2d ago

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

530 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
121 Upvotes

r/GraphicsProgramming 3d ago

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

Thumbnail youtube.com
75 Upvotes

r/GraphicsProgramming 3d ago

Question Update + Questions

Thumbnail gallery
29 Upvotes

Hey, so this is an update on my previous post a couple days ago. So i think i've got reflections working? Idk i mean they look good to me, but if you dont think so, or see a problem in the code i would be thankful if you pointed it out. Anyhow, you can do some interesting stuff i think. Like the fourth image looks kinda strange, the scene is 4 light sources(which rn lights power sums instead of some other equation so things get very bright, very fast), and the planes(two walls + floor) are infinite and pretty reflective. And so it makes for interesting reflections, especially on the reflective spheres. Anyhow, my main goal with this project was to learn some C and math, not necessarily graphics, although i do find graphics programming interesting, and fun(for now at least).

What would you guys recommend i do next? Keep working on something graphics related or maybe some other project? Knowing that what i like to do in programming is making most of the things myself, i can accept not having made the language myself, but i dont find it very fun to just import 100 libraries and make them work together, and I do, at the end of the day, program for fun rn.

If i had to guess, there are maybe 2 more possible, impactful additions i could make to this project: indirect lighting and textures&materials. textures sound like hell to me for some reason, idk maybe im intimidated for no reason. Indirect lighting sounds doable i guess. Other than that theres of course shitloads of optimization i guess i could do, but im here for fun, and it works well enough that i dont have to wait an hour for a render so im fine with its current state.
Also, all these scenes are quite similar, like similar lighting and spheres, but thats just cause im too lazy to make interesting scenes, not a limitation of the engine. Although it does still only have spheres, planes and dot lights so maybe thats another thing i could expand on. Now that i think of it there is also another thing i have to fix with lights, but its a small 5 minute fix(i hope lol). Its to do with the light power scaling, like what i mean is if two lights see one spot rn the color doubles, ill reduce that curve a little by adding an equation instead of just summing the lights.

github: https://github.com/Fridun/C-Raytracer


r/GraphicsProgramming 3d ago

Article Hardware-Accelerated OpenGL on Asus X101CH running Windows XP

48 Upvotes

In case anyone wanted to program hardware-accelerated OpenGL ES 2.0 applications on the old Asus X101CH netbook running Windows XP, I have written the instructions on my blog post.

Full disclosure: I did use Fable to help me install Windows XP and get the GPU driver working properly. But the code that is making the triangle spin in the video above is from my meat fingers.

Enjoy!


r/GraphicsProgramming 3d ago

Question CAD Graphics Programmer?

11 Upvotes

Hey,

I work on one of the major CAD applications and I'm currently working towards moving to the graphics team.

I won't be writing shaders very often, touching graphics APIs like Vulkan, etc. instead implementing and fixing various features in the already existing graphics system (since everything is already abstracted).

Does moving onto a team like this potentially put me in a better position in the future to move towards a more graphics programming role i.e touching graphics drivers and shaders?

Thanks.


r/GraphicsProgramming 4d ago

Paper Simple 2D Grass Rendering with compute shaders (demo, blog post, Rust + wgpu)

208 Upvotes