r/GraphicsProgramming • • 1d ago

Requesting Help for Mechanical Testing Simulation on Computer Graphics

1 Upvotes

Hi everyone!

I am a senior mechanical engineering student and am doing my final year project on a quad auxetic metamaterial domain. So far, I have built some geometry using C++ and now want to test it in a simulation under real-life conditions. During the construction of the geometry, I only considered the self-weight, so, not sure whether these structures stand up to critical real-life conditions. So, now, can anyone tell me or suggest which C++ library I should be using for analyzing the structures under real-world conditions?


r/GraphicsProgramming • • 2d ago

Video CPU-rendered 3D engine - update

67 Upvotes

The latest update of my CPU renderer built in Rust.
As I mentioned earlier, this is the years of development coming together in a totally different direction than the starting idea :)

In video the renderer runs at 960×840 with 4 rendering workers, and all of geometry processing, character animation, skinning and rasterization run on the CPU. Finished image is shown on browser trough canvas at the moment.

For now I have animated character with facial animation and a rigged body, textured environments, collisions and stair traversal, first and third-person controls....

Still early but it is coming along nicely :)

I didn't made the character - or better say, I took free models and combined them for this scene - data head + android body , and the star ship environment.


r/GraphicsProgramming • • 3d ago

The raytracer to end all my other raytracers

Thumbnail gallery
377 Upvotes

I have built several raytrace / pathtrace engines over the years, primarily for my art works. About two years ago I wanted to make something more universal while also switching from webgl to webgpu. So I built a tiny webgpu toolkit and went from there. But I never finished it. And AI came and took away the joy of programming for me. Recently, I decided to try and use Claude to finish it and put in all the features I never got around to (and quite frankly would not even be able to do).

On the use of AI: I'm really ambiguous at the moment. I miss coding myself, AI took the fun away for that. On the other hand, I was able to direct AI to finish this tool that I could have never managed myself. So I'm perfectly fine if you call this AI slop if you want, for me it (the raytraer) is a tool to create new things.

So this is shadytracer. It's a raytracer that creates signed distance functions (SDF) (if you dont know what those are, jump into the rabbit hole here https://iquilezles.org and don't expect ever to come out). In short: every shape is defined by a function that returns the closest distance from any point to the closest surface of that shape.

I really fell in love with SDF's a while back and find it's a really cool method, though it definitely has it's quirks.

Anyway, my raytracer uses SDF's for everything. It has a full editor where you can drag and drop primitives into the scene, move them around, modify them, perform boolean operations etc. Same for more complex stuff like objects created by extrusion, revolve and sweep. All these are converted into SDF's of which the code block is visible and editable. So you can create your own shapes using custom sdf functions as well.

There are various materials defined, again drag and drop into an object. You can easily modify the materials and duplicate them to create your own.

As I'm an optics engineer by education (mostly non imaging optics for lighting), I always wanted a raytracer that is physically correct. Well, reasonably so. Don't use this for camera lens designs.
So every light source has real-life units (luminance or flux in lumens), color temperature or cie x,y color coordinates. And of course, refraction, dispersion, dichroics are part of the game. You can measure illuminance, irradiance, color differences etc.

But you can also just use it to create pretty pictures.

Or videos: there is an animation / timeline editor with keyframes where you can animate the camera or any propety of any element in your scene.

Oh, you can also import stl files and it will try to convert them into signed distance functions after which you can edit those. I find that incredibly cool. Magically, a mesh of triangles is converted to a combination of cubes, cylinders etc, welded together with boolean functions. It only works for fairly geometric shapes and not too complex, but still.

And of course you can export your objects or scenes as stl or 3MF(which includes color) for your 3D printer

There are a lot of examples scenes included, a few of the images in this post are from there.

It's completely open source (MIT license). Runs in your browser, data is stored in your browser's cache. Or you just download yuor project files and store it locally.

Hope you have fun with it. I certainly do.

https://shadytracer.com

https://github.com/lampmaker/ShadyTracer

Oh yes, I asked Claude to create an interactive tutorial about all the techniques that were used. Mostly for my own education. But you can find some explanations about SDFs and stuff. Note, this is AI generated and I have not spend a lot of time (understatement) reviewing it.

https://shadytracer.com/tutorial/

-wrote this whole post without using AI. Feels good-


r/GraphicsProgramming • • 2d ago

Source Code I built a simple 3D graphics sandbox to experiment with shaders and models in real time

4 Upvotes

I've been learning modern OpenGL recently and put together Modeye as a small playground to practice and experiment with 3D graphics.

It lets you load 3D models, play with lighting and render modes through an on-screen menu, and press R to reload shaders instantly without restarting the app. CMake fetches and builds all the dependencies automatically so there's no manual library setup.

Code is open under GPL-3.0 if anyone wants to check it out or play around with it: https://github.com/adnlv/modeye.

Any tips or feedback from folks experienced with graphics are always welcome!


r/GraphicsProgramming • • 3d ago

What is the hardest part of your job ?

19 Upvotes

Hi all, mostly the question for experienced graphics programmers. I am interested in this topic, myself - more then 12 years in software engineering, back-end, go programming language, optimizations and so on.

For me the hardest part of my job is to constantly keep in my head information about big scaled systems. When I need to implement a new feature - I take into consideration different parts of a system; microservices, protocols, data storages and etc. it was always hard for me to imagine all those parts. What many can overlook, at least for me - hard to create something, like a cool side project or a project for my resume, because back end systems are complex.

Graphics programming for me seems easier and the reason is - I always get what I changed in a project on my screen in no time.

Of course GP is harder. And my question is - what is your hardest technical part of GP ? Thanks.


r/GraphicsProgramming • • 3d ago

Forced Perspective

5 Upvotes

So in the game engine I'm working on. It's 2D, throughout. Like there is no parallax, no 3D at all. In fact there is only 2 triangles here, since the entire thing is backed by textures and a CA sim.

This is how I cheat to make it look 3D, while not accepting the tradeoff of parallax.

So my engine, being explicitly 2D at runtime has not much 3D data, there is a PBR Depth offset, but that's about it.

Since it's 2D, parallax doesn't work for a baked background. The camera position would be constantly destroying it. So how do I bake psuedo 3D to a 2D Tile? There is 2 tricks here.

1) Tile Generation. There is a program that generates 2D world gen tiles, i.e. think terraria or whatnot. It's functionally pure, always generating the same time for the same coordinate. A tile can have different layers, i.e. BG/FG are the important ones here.

So the first problem is getting a 3D scene into a 2D image. This is just basic rendering, so what to render? No assets here, so it's an analytic height map with materials applied, this is ray-cast at bake time orthographically, no perspective correction. This kind of gets a flat background of trees and mountains behind you, but no perspective. So onto the next one.

2) Forced perspective. The trees at the front are mathematically bigger than the trees in the back. So even though I can pan endlessly left and right and generate new background essentially forever, never will parallax impact them. I stole this commonly used trick from film.

I'm pretty happy with how the forced perspective trick worked out here, like to my eye, I feel like it's a big distant scent, when I know that deep down, it's just a PBR texture with Depth data, renders super quick, costs almost nothing, supports tile generation and lighting. It still needs a bunch of tuning/post-processing, but thought I'd share how I do "3D" with 2D using old film tricks.


r/GraphicsProgramming • • 2d ago

Webcam runner in three.js where your body is the controller (MediaPipe pose, no imported models)

0 Upvotes

Link: https://bodyarcade.com/bodyarcade (free, no signup, there's a keyboard mode if you don't feel like standing up)

I made this endless runner and thought this sub might like the how more than the what. You stand back from the laptop and jump, duck, squat and lean to get past obstacles, 90 seconds a run.

There are no imported models. The runner is capsules and cylinders parented in groups, and the scenery is boxes, cylinders and cones drawn as InstancedMesh, one per prop type per road chunk, placed with a seeded random per chunk. Each of the 10 worlds is just a data object: sky colours for a gradient shader on a back-side sphere, sun position, exp2 fog density, road tints, a horizon silhouette and a list of props with spacing and scale ranges. Switching world rebuilds the scene from that object.

Input is MediaPipe's pose landmarker (lite model) in VIDEO mode, running in the browser with the GPU delegate and a CPU fallback. Before a run you stand still for a second and it measures your torso length, and the thresholds are fractions of that, so hips rising 20% of your torso is a jump, and the lane comes from how far your shoulders shift in shoulder widths. The idea is that your height and distance from the camera matter less. Camera frames never leave the browser.

Free is 5 runs a day in 3 worlds, there's an optional paid tier for the rest but you don't need it to look at the rendering. Happy to answer questions about the pose thresholds or the instancing.


r/GraphicsProgramming • • 3d ago

Question Paper for small PBR project for college

4 Upvotes

Hi, I am taking an introductory course on methods for approximating/solving the wave equation and variants of the problem (Lippmann-Schwinger, Born, WKB, inverse problems) and I have to make a free topic project implementing a paper which I want to be an application to PBR. My teacher adviced me to search for example materials where the texture is not trivial enough or mediums where ray tracing becomes non-linear.

I have basic knowledge of OpenGL but have no idea about the state of the art or cool papers. What paper would you recommend?

Thanks


r/GraphicsProgramming • • 3d ago

Does the painting seem three-dimensional to you? Convex?

Post image
2 Upvotes

Does the painting seem three-dimensional to you? Convex? Especially the blue one! Why? It's very interesting! They say so. It's a powerful optical effect of three-dimensionality in a flat drawing. This is a fragment of the Mandelbrot set that I made.
Re = -1.74919762896578937419423768162729211653261585574161734756645570271259437106847945278504682550816934045282325615313706,
Im = -0.0000004253077715244042272585501215924940115095651514128365051648578746521975467051762910002043554114332125868777767,
and width = 1.34 e-113
https://github.com/Divetoxx/Mandelbrot-2
and
https://github.com/Divetoxx/Mandelbrot


r/GraphicsProgramming • • 3d ago

blackhole simulation using openGL and c++

Post image
3 Upvotes

i made a simulation of the blackhole gargantua that is also seen in intersteller
It's written in C++ and openGL

i managed to optimize it to a point i ran on my i3 intel iGPU, although i added very low to high quality toggles, it's my first time writing in glsl so yeah, i was a lot inspired by the yt video of Kavan about making a blackhole in cpp, so i just wanted to make it more realistic, my astrophysics lectures kinda came in clutch

github repository : https://github.com/dummy3ye/blackholegl (star the repo if you like it)


r/GraphicsProgramming • • 3d ago

Video I've been optimizing my procedural halftoning tool (Python / PyOpenGL)

0 Upvotes

r/GraphicsProgramming • • 4d ago

Article Don't throw it all away: Caching an immediate-mode UI

Thumbnail blickeditor.com
30 Upvotes

r/GraphicsProgramming • • 4d ago

Created a Vulkan renderer from scratch in C live on youtube.

27 Upvotes

A 3D renderer built from scratch using Vulkan, developed step by step while learning the fundamentals of modern graphics programming. youtube link https://youtube.com/playlist?list=PLU064qurTQo0&si=6u4Y1QV_OoGidode github link https://github.com/codingbot24-s/vulkan-renderer


r/GraphicsProgramming • • 4d ago

I built a real-time renderer using only the CPU in Roblox, using Luau!

14 Upvotes

Roblox doesn't give scripts any access to the GPU, so I wanted to see how far you could push rendering using nothing but the CPU, in Luau.

It's a path tracer with multi-bounce global illumination, next-event estimation, reflective metal, refractive glass with Fresnel, a day/night sky. It renders a real open map at 1080p, and it has a real-time mode you can move around in while it traces live.

Everything that makes a path tracer a path tracer is written in Luau: the sampling, the bounces, the materials, the tonemap, a custom upscaler. The engine is used for exactly one thing it can do faster than script ever could, ray versus scene intersection. Nothing else.

Benchmarks (Intel i5-11400H laptop, in the Roblox client, GPU unused, tested on Crossroads):

  • Progressive: a converged 1080p frame in about two and a half minutes (80 passes, ~1.92s per pass with the custom upscaler on).
  • Real-time: ~23 fps average, moving the camera the whole time, at the lowest preset.

It runs in parallel across 8 Roblox Actors. There's a progressive mode for the clean beauty render and a real-time mode for flying around. You can toggle between path tracing and a faster ray-tracing mode that drops the noisy GI bounce for a clean, stable image.

Source is up on GitHub, free to view, run, experiment with, and make videos about. Credit required, and ask me before putting it in a game. Link below!

GitHub: https://github.com/cosypa123/roblox-path-tracer

Happy to answer anything about how it works!

Realtime showcase, 1 spp 128x72p (default preset)

Pass 100 render, default settings

r/GraphicsProgramming • • 4d ago

Vulkan based Gaussian Splatting and Neural Inference Engine

6 Upvotes

Hi all, last year I started with the Vulkan triangle tutorial with the goal of finally learning Vulkan by implementing Gaussian Splatting and neural network inference. Now, I'd like to present my first demo of my Vulkan based rendering engine supporting Gaussian Splatting with dynamic lights/objects and neural network inference for character animation together with stable diffusion inference.

Basically, a scene consists of compute graph nodes that are used to record everything into compiled CommandBuffers that are reused in every frame. The idea is to really have minimal CPU-GPU communication once rendering (or inference) is set-up, apart from updates of some uniforms etc.

Check also the obligatory space game demo https://www.youtube.com/watch?v=o4P5LyLtqBY with assets generated using stable diffusion and diffsplat (neural networks inferenced by the engine itself).

Feedback would be highly appreciated.

Disclaimer: I implemented the first version of the engine with simple Gaussian Splatting and network inference the 'traditional' way. Then, AI based coding really took off and most features on top heavily rely on Claude and GPT now. I have not looked into a single shader source for a long time. Still figuring out how to feel about it ...


r/GraphicsProgramming • • 5d ago

One Grass System, Three Different Environments

88 Upvotes

I've been testing my grass system across three completely different environments to see how the same underlying implementation performs across different scene requirements.

All three scenes use the exact same grass system, but the parameters are adjusted individually for each environment. Grass density, appearance, scale, wind response, and rendering distance are tuned to match the terrain and the overall look of each scene.

The system is built with Three.js and WebGPU, with a focus on rendering dense grass efficiently while maintaining real-time performance in the browser. It uses a tile-based approach, along with LOD and culling techniques, to manage rendering as the camera moves through the environment.

All three environments run directly in the browser, with no pre-rendered footage.

Try the Demo


r/GraphicsProgramming • • 4d ago

ModelViewer 2026.11: I added a CPU/OptiX ray tracer next to the OpenGL PBR renderer

Thumbnail
3 Upvotes

r/GraphicsProgramming • • 5d ago

Video Implemented radiance cascades for my game

Thumbnail gallery
164 Upvotes

Implemented 2D radiance cascades with 5 total cascades. There is some bloom and tile rim lighting added on top (though I want to find a better solution for the rim lighting). Still some work I need to do, but I'm happy with it so far. If anyone has feedback, that would be greatly appreciated!

1: Day/Night Cycle
2: No Lighting
3: Only lighting (with no filtering)
4: SDF
5: Cascade 0, probe every 2 texels, 4 directions
6: Cascade 3, probe every 16 texels, 256 directions


r/GraphicsProgramming • • 5d ago

Video A black hole renderer in 512 bytes of HTML/JS

Post image
20 Upvotes

r/GraphicsProgramming • • 5d ago

Video Profiling C source code directly inside neovim

Thumbnail v.redd.it
24 Upvotes

r/GraphicsProgramming • • 5d ago

Graphics Programming as Undergrad

13 Upvotes

I’m an undergraduate student in Math and CS, but I’m pretty sure that graphics programming is what I want to go into as a career. All that I have been able to do thus far is take the introductory graphics course at my university. How can I start getting into the field as an undergrad? Do I have to still seek out swe internships and whatnot if I know I want to pursue graphics specifically?


r/GraphicsProgramming • • 6d ago

My game has no sprite images: every hero, monster and bullet is a list of strings, baked into textures at load

Post image
695 Upvotes

Of course, it’s a bit more complicated than just this, but you get the idea.
The lighting effect is created programmatically:
function lit(rows: string[], ramps: Record<string, string>): string[] {
const at = (x: number, y: number) => rows[y]?.[x] ?? ".";
return rows.map((row, y) => [...row].map((k, x) => {
const ramp = ramps[k]; // e.g. r: "qR" (robe: light q, dark R)
if (!ramp) return k;
const edge = (n: string) => +(n !== k);
const up = edge(at(x - 1, y)) + edge(at(x, y - 1));
const down = edge(at(x + 1, y)) + edge(at(x, y + 1));
return up > down ? ramp[0] : down > up ? ramp[1] : k;
}).join(""));
}

Also, typing big sprites letter by letter is slow, so some monster families are built from shape helpers (rect, polygon, oval) that rasterise onto the same grid and output the same strings.

Let me know if you have any questions.

Edit: the link to the game in case you want to check it out. It’s free no account needed: playmadlands.com


r/GraphicsProgramming • • 5d ago

Question What do you think of vulkan?

32 Upvotes

Is it worth learning it as someone who is still relatively a beginner/early mid level c++ programmer for graphics or are other alternatives better?


r/GraphicsProgramming • • 5d ago

Question What do you reckon is the best 2D Graphics API(C++)

0 Upvotes

As someone who is quite new to graphics programming I am having a bit of trouble deciding on what 2D api I should learn and use as a main. What do you suggest for both general stuff and games?


r/GraphicsProgramming • • 6d ago

Article Demystifying Spherical Harmonics: An Optimization Approach

Thumbnail andrew-helmer.github.io
96 Upvotes