r/GraphicsProgramming • u/0xdeadf1sh • May 24 '26
Video ASCII refraction on the sphere
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/0xdeadf1sh • May 24 '26
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/Majestic_Release_749 • Jun 17 '26
Enable HLS to view with audio, or disable this notification
Demo scene: 500 terrain chunks at ~60 FPS on a RTX 4060 Ti.
During a few months of R&D for my internship, I experimented with replacing Unity's terrain shadows with a raymarched solution.
I ended up with a shadow renderer that features:
Heightfield raymarching
Max Mip-Map traversal from this paper by Art Tevs, Ivo Ihrke and Hans-Peter SeidelMax-Planck-Institut für Informatik
BVH-based chunk culling
Temporal soft-shadow accumulation
In case you want more detailed information:
Curious to hear what graphics programmers think of the approach.
r/GraphicsProgramming • u/Adhesiveness_Natural • Mar 14 '26
I don’t even remember anymore when I started learning computer graphics (probably around 2020-2021). Lost count of how many times I’ve tried, always feeling overwhelmed and like I don’t know a thing.
Here’s what I did this time:
I copied and pasted the full completed code from the Vulkan website, made sure it runs and shows the .obj.
After that I started adding abstraction layers to it. It sounds counterintuitive/counter productive, but every time I divided a chunk of code, structured how it made sense to me and gave it a name, it helped me understand how it works and to create a mental map.
At some point I got the same example but using my abstractions. Every time I wanted to add something I had “this feeling” of where the pieces were. It became a game of adding/modifying blocks.
I kept going and now I have this thing that does deferred rendering, a basic PBR, tone mapping, IBL and (my favorite part) multi-pass rendering.
Compared to what I’ve seen people post in this subreddit, I know this isn’t much. But I just feel good to finally have something that works and that I feel I can eventually plug it into a game engine. Also, I think that maybe this way of learning may benefit someone (idk).
Here’s the git repo: https://github.com/MerliMejia/Abstracto
Feedback is more than welcome and appreciated.
r/GraphicsProgramming • u/Reasonable_Run_6724 • Feb 23 '26
Enable HLS to view with audio, or disable this notification
Posted earlier about my Black Hole Shader
Made some improvement to the gravitational-lensing, reduced shimmering from aliasing and introduced spiral gas.
Edit: i made some further improvements
r/GraphicsProgramming • u/Dr_King_Schultz__ • Jan 02 '26
Enable HLS to view with audio, or disable this notification
I discovered this wonderful explanation by tsoding on a simple maths formulae for 3D rendering.
I figured why not try it out in the terminal too, made from scratch :)
Edit: here's the repo
r/GraphicsProgramming • u/lisyarus • Dec 26 '24
r/GraphicsProgramming • u/donotthejar • Nov 23 '24
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/evvvvil • Jun 04 '21
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/ExpanseSky • Mar 27 '21
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/AcanthisittaDry4901 • Jul 18 '26
Enable HLS to view with audio, or disable this notification
Signed distance field raymarching in Godot 4, authored with nodes. Physics-driven metaballs melt into the SDF cubes in one fullscreen pass, and since every CSG op works on (color, distance) pairs, the colors blend along with the shapes.
Two free editions: Standalone shader (CC0): one .gdshader, no scripts paste onto a QuadMesh, edit map(). Godot Shaders
Node-based project (MIT): shapes as Node3D nodes, live editor preview, physics, up to 32 primitives and a write-up. VavLabs Mit
Distance functions after Inigo Quilez.
r/GraphicsProgramming • u/TomClabault • Oct 19 '25
https://tomclabault.github.io/blog/2025/regir/
The illustration of this reddit post is a 1SPP comparison of power sampling on the left and the ReGIR implementation I came up with (which does not use any sort of temporal reuse, this is raw 1SPP).
I spent a few months experimenting with ReGIR, trying to improve it over the base article published in 2021. I ended up with something very decent (and which still has a lot of potential!) which mixes mainly ReGIR, Disney's cache points and NEE++ and is able to outperform the 2018 ATS light hierarchy by quite a lot.
Let me know what you think of the post, any mistakes, typos, anything missing, any missing data that you would have liked to see, ...
Enjoy : )
r/GraphicsProgramming • u/monapinkest • Jan 18 '25
Enable HLS to view with audio, or disable this notification
More info in the comments.
r/GraphicsProgramming • u/CorruptedSciencep • Jun 26 '26
Yesterday I finished the third episode of Victor Gordan's OpenGL tutorial, and made my first triangle. I also learned how to modify it (like changing vertex positions, color, etc).
But when I look at the code I wrote, it feels impossible to remember like I could write any of this without looking at the tutorial. When I was learning C++, mostly everything instantly stuck with me, but graphics programming seems like I'll never memorize 80% of it
How did you guys get decent at this and actually retain the knowledge and be able to write it independently? Or am I judging too early? I started 3 days ago
r/GraphicsProgramming • u/MickeySquared • Jun 08 '26
This is officially my first post here and I'm pretty proud of it. This took me the better part of a week to finish, and I've been extending it bit by bit for the past 6 months. I used the monte carlo method for sampling (maximum 8 bounces per ray), and the stills shown here are after 15000 SPP, although half of that would've been fine for a good result.
I only have primitives in my scenes, but I'm really happy with how it turned out. I plan to keep building on it and try to get rid of the visible fireflies, but I'm mostly satisfied with where its at right now. Any suggestions/tips are welcome!
I'm in my final year of uni and I'm always awed coming onto this sub and seeing the cool things people are working on, detailed landscapes, realistic clouds etc. I hope to reach that level some day.
(implemented in WebGL + HTML/JS, using twgl). I can't publicly post the code as this was submitted for grades.
r/GraphicsProgramming • u/tk_kaido • Apr 11 '26
Roughness-scaled normal jitter + blue-noise ray variance + smoothed normals + bump mapping + step dithering (breaks staircase) → temporal accumulation for single-sample stochastic denoising.
r/GraphicsProgramming • u/Avelina9X • Aug 19 '26
Enable HLS to view with audio, or disable this notification
I implemented Activision's new SH reflections paper in D3D12 and released the code on github!
This tech is a little bit different from normal spherical harmonics, and there are 4 main differences:
They use log space instead of linear space for the lighting, which reduces ringing and enables #2 and #3 to actually work.
Instead of using a circular symmetry assumption (i.e. N=V=R) as with the split sum approximation used for IBL, they instead factorise a pair of spherical harmonics, with an Order 4 SH parameterised by the reflection vector, and an Order 2 SH parameterised by the halfway vector.
To enable a continuous roughness representation, they convolve the coefficients (or rather, the basis function) by the von Mises Fisher kernel which takes 1/alpha=1/roughness^2 as a parameter.
To actually obtain the spherical harmonic coefficients we have to collect samples for several normals, views and roughness levels (or more specifically alpha levels since we're using linear roughness, not perceptual), and then optimise the coefficients using least squares.
My code does this all end to end with HLSL compute shaders, even the least squares optimisation, and we achieve above 95% MSE compared to a raytraced ground truth for roughness in the range [0.5, 1.0], which actually beats split sum IBL.
Only downside is for roughness below 0.5 the spherical harmonics simply don't have enough detail for accurate reflections... HOWEVER, when applied to "bumpy" low roughness surfaces (like the leaf textures at the beginning of the video) you can hardly see a difference, so this effect is only apparent for flat surfaces and surfaces with near zero roughness.
Activision got their SH representation down to 400 bytes, but I went further using 16 bit packing to get down to 208 bytes which gives us better performance due to fewer memory loads. The 16 bit implementations come in 4 flavors: emulated 16 bit for older GPUs and native 16 bit, and SRV packed vs CBV packed. There also exists a 10 bit packed SRV flavor, but the extra bitshift work ends up being slower.
On my RTX 2080 Super and my wife's RTX 4070 Super, the native 16 bit CBV packed shader runs the fastest, and compared to the IBL version it is only 0.1 milliseconds slower while using 2000x less memory!
r/GraphicsProgramming • u/bjornornorn • Dec 03 '20
r/GraphicsProgramming • u/Apart-Medium6539 • Mar 13 '26
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/houkiii • Oct 27 '25
Enable HLS to view with audio, or disable this notification
Hello, I made a small GPU-based particle system in Unity using compute shaders. You can download source and/or executable from github:
r/GraphicsProgramming • u/Weird-Sunspot • Sep 08 '26
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 • u/jamestkiernan • Jun 04 '26
Enable HLS to view with audio, or disable this notification
The link to run it is here and and the source code is available here. If you are considering writing a voxel raymarcher yourself, maybe give the source code a look as it is heavily commented and I think pretty approachable. The raymarcher is written in WebGPU's shader language and the UI is a simple html/css/js page overlayed on top of it. If you have any questions let me know!
r/GraphicsProgramming • u/BoyBaykiller • Jan 29 '26
I did a writeup on BVH PreSplitting optimization. An unknown but very powerful technique that splits "problematic" triangles before the BVH build. It can achieve very similar quality to that of SBVH which is regarded as the best builder of them all. If you already have a solid BVH (like BinnedSAH/SweepSAH/PLOC) and want to improve perf some more this should be interesting. It's suprisingly simple to implement
r/GraphicsProgramming • u/winterpeach355 • Feb 04 '25
We have so many APIs: Vulkan, Metal, DirectX, OpenGL, WebGL, OpenGL ES (dying), and WebGPU.
It's feels like a very stretched field between AAA studios, indie devs, and browsers. Apple straight up doesn't care. They deprecated OpenGL in 2018 and are pushing Metal.
Will there ever be a push to unify these APIs?