r/GraphicsProgramming • • Aug 12 '26

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

1 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.

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


r/GraphicsProgramming • • Jun 16 '25

Is it worth learning Graphics Programming in 2025?

20 Upvotes

Im a Mobile App Developer and recently explored graphics programming and it just blew my mind. Is it just worth learning in 2025? And what’s the job market would look like in next 10-15 years?


r/GraphicsProgramming • • Sep 23 '25

Been having to resort to using AI for learning... I am really not proud of it, but it is what it is. Sorry guys. (also, how exactly I'm using it)

0 Upvotes

As for how I'm using AI; I basically give it a set of instructions -
A) Explain it to me in three principles; Rationale, Proof, and Examples.
B) Rationale should be explanations that recognizes the fact that I am a low-IQ individual with non-existent critical-thinking and problem-solving skills. You are to explain Rationales in a way that makes sense to technically-declined and low-IQ individuals.
C) After giving your Rationales, provide your proofs. This can be in the form of Citations, official documentations, industry examples, etc; whatever that can support the Rationales.
D) Examples should be given via real samples and not just AI-generated. For example, if we are talking about D3D and I ask for examples on how to do/solve X, look around the Internet for real working sample sources to reference from. I would do this, but I've tried many times in the past; and I always fail to find the right samples to my problems. If you want to generate code examples w/o real working samples; start first with pseudo-code.

Just 4 instructions... I find it to be very helpful so far. Been getting some of my most struggling questions answered with full clarity.., even though I'm just asking a glorified search engine. At least I'm getting somewhere. Unfortunately, I can't solve anything myself, so usually I end up telling the AI to give me exact code with instruction D, anyway, overriding the pseudo-code portion. Yeah I know it's hypocritical, but what to do *shrug*.

Hope this was helpful for other struggling beginners.

Rant in Spoilers.

Self-taught is such a pain. With no guiding hand or knowing where to find the resources that can actually answer my questions, even fundamental ones, I have to resort to getting the AI to explain things to me even though it scientifically reduces my cognitive IQ. I have kind of given up on asking real programmers questions because I usually get the "have you tried reading (insert common resource here)", some anti-social (and occasionally demeaning) response, or just repetitive explanations which obviously doesn't work to explain anything, which means no one knows how to answer my beginner questions. The lack of programmers and mathematicians that can explain concepts to beginners and not make them feel retarded about it is demotivating, but at least I'm actually getting somewhere with AI. No one seems to be able to explain technical things in human-understandable language and it leaves beginners like me to the dust, but at least with the AI surge, we get a chance.

Look I:m not proud of it, I'm not proud of having to scientifically give up my cognitive abilities to a glorified search engine, but having to get learning done and move on to the next topic, yeah, I'm going to have to sacrifice my IQ.

I know it's not the right way; a person of any technical field shouldn't have to resort to anything that fundamentally hinders their ability to problem-solve, critically-think, and create solutions. What else am I supposed to do? It's a beginner-hostile world. Sorry to anyone who disapproves of using AI (genuinely no sarcasm), but it is what it is. There is no other choice. I have no other choice. It's either I use AI, or I die in a field that requires cognitive skills I don't have.


r/GraphicsProgramming • • May 03 '24

Bye Bye Path tracing, welcome Waves tracing !

0 Upvotes

Hum question for anybody have more knowledge than me,

i have an idea.... Is maybe stupid but i don't know i never see that anywhere.... But basically is possible to create a derivated system from path tracing to "Wave tracing" we replacing the path, by waves, so you cover a more large scale.... and with an influence parameter you can control the density of the wave.... You thinks a projects like that can be possible ? So you can conver a large space, with less "Rays" (Replaced by waves) and the waves can be deformed by the contact of the surface collided, and after that he took this own initial form if she's not collide with other object and at this point we-re removing the wave for not computing in the void.

So for 1 ray lauch you send 1 wave with exemple "32 contact points" And this 32 contact points is the resolution of the "Waves" and you give the form are the launch and when he collide with the deformation of the curve you can get the data like the ray tracing but, more perforly and i think... is really i think more precisely.

And by varisously number of wave resolution you can create a parameter to adjust it automatically and create a real customisation of the Global illumination "Resolution".

Exemple :

32 Contact points per wave = LOW res

64 Contact points per wave = MED res

128 Contact points per wave = HIGH res

N Contact points per wave = CUSTOM res

And with a new parameter you can adjust the amplitute of the curve for getting a smooth or hard result, this parameter give really how the waves can be aborbated by the mesh if the collide is smooth or brutal.

You can integrate a weight system for "Points of wave " after N Ms or Seconds in the same place with bias of .05 ms if is 90% too close from the last position you remove 0.1 of weight of one points on the waves... And if the weight come to 0 you dissolve the points on the curve so he pass from 32 to 31. And you do the same for all points of curves ! So by this technics you can remove a problematics waves stucked in bad corner or complex surface like exemple a tree....


r/GraphicsProgramming • • Dec 11 '25

Video Explanation of Normal Maps

Thumbnail
youtu.be
15 Upvotes

r/GraphicsProgramming • • Feb 06 '25

Why is it accepted that IDE does not help programmer with shader languages?

45 Upvotes

It adds a lot of friction and doesnt make any sense to me. You click on any shader programming tutorial in Unity for example and author does not use IDE helping capabilities. Aside from Rider and paid VS Code extension, why there is no other solution to seemingly trivial inconvenience?
Is it some gatekeeping tactic from programming shaders ? Thanks!

EDIT: grammar


r/GraphicsProgramming • • Jul 28 '26

Custom OpenGL rendering engine

0 Upvotes

Built a small C++ / OpenGL rendering engine with an ImGui editor as a learning project toward a custom render pipeline.

What’s in it so far:

  1. Engine core — window, RHI (buffers / shaders / textures), meshes, materials, camera

  2. Multi-light rendering — directional, point, spot, and hemisphere ambient fill

  3. Shadows for directional, spot, and point lights

  4. ECS scene system with JSON save/load

  5. ImGui editor — hierarchy, inspector, content browser, click-to-select, transform gizmos, light debug markers, camera panel

Still early — more of a renderer + editor foundation than a full game engine — but it’s been a solid way to learn the graphics pipeline, GLSL, and how to structure engine code beyond tutorial triangles.

Open to feedback from anyone working on graphics / game engines.

Repo: https://github.com/saibhaskar277/OpenGL

#C++ #OpenGL #GLSL #GraphicsProgramming #GameDev #RenderingEngine #ComputerGraphics #ImGui


r/GraphicsProgramming • • Jul 06 '25

Graphics programming and LLMs

0 Upvotes

I've been using open ai models recently to help me with some shader programming using MSL. It got me wondering if anyone else is doing this or similar? If you are what is your experience, and have you found any models that work better for graphics and shader development?


r/GraphicsProgramming • • Jun 16 '25

Simple 3D Coordinate Compression – Duh! Now on GitHub

0 Upvotes

AI – “Almost all 3D games use 32-bit floating-point (float32) values for their coordinate systems because float32 strikes a balance between precision, performance, and memory efficiency.”
But is that really true? Let's find out.

Following up on June 6th Simple 3D Coordinate Compression - Duh! What Do You Think?

Hydration3D, a python program, is now available at Github - see README.md. This Python program compresses (“dehydrates”) and decompresses (“rehydrates”) 3D coordinates, converting float32 triplets (12 bytes) into three 21-bit integers packed into a uint64 (8 bytes)—achieving a 33% reduction in memory usage.

Simply running the program generates 1,000 random 3D coordinates, compresses them, then decompresses them. The file sizes — 12K before compression and 8K after — demonstrate this 33% savings. Try it out with your own coordinates!

Compression: Dehydration

  1. Start with any set of float32 3D coordinates.

  2. Determine the bounding box (min and max values).

  3. Non-uniformly scale and translate from this bounding box to a new bounding box of (1.75, 1.75, 1.75) to nearly (2, 2, 2). Now, all binary float32 values begin with the 11 bits 0b00111111111.

  4. Strip the first 11 bits from each coordinate and pack the three 21-bit mantissa values (x, y, z) into a uint64. This effectively transforms the range to an integral bounding box from (0,0,0) to (0x1FFFFF, 0x1FFFFF, 0x1FFFFF).

  5. Together, the bounding box float32s (24 bytes) and the packed 64-bit array store the same data — accurate to 21 bits — but use nearly one-third less memory.

Bonus: The spare 64th bit could be repurposed for signalling, such as marking the start of a triangle strip.

Decompression: Rehydration

  1. Unpack the 21-bit integers.

  2. Scale and translate them back to the original bounding box.

Consider a GPU restoring (rehydrating) the packed coordinates from a 64-bit value to float32 values with 21-bit precision. The GLSL shader code for unpacking is:

// Extract 21-bit mantissas from packed 64-bit value
coord21 = vec3((packed64 >> 42) & 0x1FFFFF,
              (packed64 >> 21) & 0x1FFFFF,
              packed64 & 0x1FFFFF);

The scale and translation matrix is:

restore = {
    {(bounds.max.x – bounds.min.x) / 0x1FFFFF), 0, 0, bounds.min.x},
    {0, ((bounds.max.y – bounds.min.y) / 0x1FFFFF), 0, bounds.min.y},
    {0, 0, ((bounds.max.z – bounds.min.z) / 0x1FFFFF), bounds.min.z},
    {0, 0, 0, 1}
};

Since this transformation can be merged with an existing transformation, the only additional computational step during coordinate processing is unpacking — which could run in parallel with other GPU tasks, potentially causing no extra processing delay.

Processing three float32s per 3D coordinate (12 bytes) now requires just one uint64 per coordinate (8 bytes). This reduces coordinate memory reads by 33%, though at the cost of extra bit shifting and masking.

Would this shift/mask overhead actually impact GPU processing time? Or could it occur in parallel with other operations?

Additionally, while transformation matrix prep takes some extra work, it's minor compared to the overall 3D coordinate processing.

Additional Potential Benefits

  • Faster GPU loading due to the reduced memory footprint.

  • More available GPU space for additional assets.

Key Questions

  • Does dehydration noticeably improve game performance?

  • Are there any visible effects from the 21-bit precision?

What do you think?


r/GraphicsProgramming • • Feb 11 '26

global illumination system I made.

0 Upvotes

I haven't made anything yet, and this is all theory...

it works by getting the sum of all incoming direct light and incoming indirect light with math only. It basically works by getting a reflector plane like the surface of a box, and then copying all the lights into the "mirror world" along that plane.

It simulates light bouncing accurately because when you look in a mirror, it looks like another room on the other side of the mirror, but it's just light bouncing, so instead of physically bouncing light for global illumination, I copy the positions of all lights into the plane of the mirror plane and then do Lambertian diffuse on all normal lights and mirror lights.

These mirror lights don't actually exist; the pixels just calculate light as if they were.

shadow maps would get ridiculously expensive, so I made a system to calculate shadows without making my GPU explode: I assign a box to every object (I haven't figured out more complex shapes yet, don't make fun of me), and then I get the vector from the light to 4 corners of the 8 corner cube (only the corners that are not inside the silhouette). then I check the vector from the light to the pixel to check if it's in between those 4 vectors. Then I check if the pixel is further than the surface of the cube. The Threshold Distance is just the distance of the closest corner's distance, but interpolated from the surrounding corners. So if corner one is 10 feet away, but corner 2 is 12 feet away, and the vector is right in the middle, the threshold distance will be 11 feet. So if the point is in the shadow vectors and more than 11 feet away, it's in shadow.

I haven't figured out non-planar reflections though.

I call it DRGI for (Diffuse Reflection Global Illumination). If you happen to implement this, please be so kind as to credit me.


r/GraphicsProgramming • • May 27 '24

Question Why isn't ReSTIR already implemented in most commercial rendering engines?

5 Upvotes

Why has it not yet been implemented in Blender / 3DS Max / Cinema 4D /Autodesk Arnold / ... even though there are unbiased approaches for ReSTIR? The only ones I could find are (although I haven't been googling for hours) Lumion and Radeon Pro Render.

Is it "purely" the cost of integrating ReSTIR in the already very complex codebase of these engines?


r/GraphicsProgramming • • May 23 '24

How to learn unreal engine

0 Upvotes

Hello everyone,

I aspire to become a game engineer and am currently learning graphics programming using Vulkan. I've noticed that many companies require familiarity with Unreal Engine, but I'm not quite sure about the specific development needs they have. I also don't know what kind of projects I should create to showcase my abilities.

Personally, I want to focus on rendering, but it seems like many rendering features have already been well-developed by the official teams.

Do you have any advice?


r/GraphicsProgramming • • May 14 '18

Off Black

Post image
5 Upvotes

r/GraphicsProgramming • • Sep 03 '26

I open-sourced a native Shadertoy-style GLSL workstation (Tauri + SolidJS) — code-first runtime, node pass graph, and video export

Thumbnail
gallery
5 Upvotes

I built a desktop app for prototyping and exporting GLSL shaders locally, and just shipped v0.1.0 (open source, AGPL-3.0).This is my first open-source project, all implemented through Vibe Coding, which is incredibly exciting for someone with only a rudimentary programming background like myself. For years, I've imagined writing programs that solve my own problems, and the advent of AI has made it all possible.

Why: I spend a lot of time on Shadertoy but kept wanting offline editing, a real editor, and proper video export. So I localised the workflow.

Repo: github.com/yuxiaoyaoo/ShaderLab-Pro

What's inside:

- Code-first runtime with iTime / iResolution / iMouse / iChannel0-3 (includes keyboard & audio channel handling)

- Monaco editor with GLSL ES 3.00 IntelliSense

- Visual pass graph where nodes compile to GLSL — the generated code and the graph stay in two-way sync

- Project gallery with auto-captured thumbnails (640x360) and a saved-project library

- Export pipeline: MP4 / GIF / WAV with resolution stepping

- 40+ bundled templates across geometry / materials / particles / post-processing / scenes

Stack: Tauri 2 (Rust) + SolidJS + Vite + TypeScript + Monaco, WebGL2. Windows installer is ~6.6 MB.

Licensing: AGPL-3.0, dual licensed if you want to embed it commercially.

I'm genuinely curious about what's missing or broken from a real graphics-pipeline perspective — especially the pass graph compiler (GLSL emission from node IR) and the iChannel audio/keyboard paths. Feedback appreciated, issues welcome.


r/GraphicsProgramming • • May 10 '26

UI IP Toolkit: I built a visual frontend asset library so I can stop losing my own UI snippets

0 Upvotes

r/GraphicsProgramming • • Jan 11 '22

I kinda implemented IK when i was making a grass blade with segments for the grass simulation am trying to make with opengl lol.

21 Upvotes

r/GraphicsProgramming • • Feb 26 '23

Question Started the Raytracing in a weekend tutorial. Wish me luck.

10 Upvotes

So I did graphics programming at university 20 years ago, but haven’t written a line of code in 5 years as I’m now in management.

(I wrote a directX heightmap terrain renderer with frustum culling about 20 yrs ago lol)

I’ve always had a love and fascination with 3D programming and the release of RT hardware has reawakened that in me.

Im hoping to do the rt weekend tutorial then a vulkan tutorial and eventually combine the two to make a vulkan app that raytraces a sphere using rt cores. That’s my current goal. Let me know if I’m being overly optimistic.


r/GraphicsProgramming • • Mar 19 '26

Video Nvidia Answers my DLSS 5 Questions

Thumbnail
youtube.com
12 Upvotes

Watch video - very correct graphic rendering related questions.
(video not my obviously - I just saw it randomly)

  • 2:00 - screenshot of the game to genAI

  • 6:30 - geometry aware

  • 13:16 - "artistic intent" - "do not apply makeup on final image if scene is not require it"

  • 15:20 - answer - ...

  • 16:15 - "is model limited to screen space or environment aware"

  • 16:50 - answer - ...

  • 18:08 - vendor lock


r/GraphicsProgramming • • Jul 27 '26

Article I measured my Metal shader optimizations instead of trusting them: half did nothing, and the trick that won on mobile went negative on desktop

0 Upvotes

Pet project: an Interstellar-style black hole as a macOS live wallpaper (one Metal shader, hosted both in a desktop-level window under the icons and in a screensaver target). I put the skeleton together in spring, it worked, and then I came back and did the thing I should have done first: hung GPU-time instrumentation on it and walked my optimization list with measurements instead of by eye. Code: https://github.com/vientooscuro/ShaderBackgroundApp

Credit where it's due: the black hole core is a port of edankwan's Shadertoy 3lG3WR. The lensing math isn't mine, I moved it to Metal and adapted it (procedural background instead of an iChannel0 texture, fixed camera, no final tonemap).

The architecture bit worth stealing: split the scene by update frequency, not by screen area.

In an earlier mobile project I did progressive "striped" rendering, computing a slice of the background per frame to spread one heavy frame over time. Here I split differently. Expensive and nearly static (stars, galaxies, nebulae, planets, giant stars, dozens of fbm evals per pixel) goes into a static pass that renders into an offscreen texture every 2nd frame. Cheap and unavoidably per-frame (the hole's lensing, comets, the click ripple) is drawn in a composite pass every frame on top of the sampled cache, followed by ACES tonemap.

The cache is rgba16Float, and that matters. Giant stars are deliberately authored past 1.0, channel values like float3(7.0, 5.5, 3.0), so the tonemap in the composite can compress them into real-looking glow. With an 8-bit cache everything past one clips at the write and there's nothing left to tone map.

Two things I got wrong on the way:

Cadence. I wanted the cache refreshed every 6th frame (~5 Hz static at 30 fps display). The cost math looked great, but with live star and planet parallax the background visibly steps: it stands still between refreshes while the composite moves smoothly on top. Backed off to every 2nd frame. Smaller win, honest picture.

Invalidation is where the actual work is. Any settings change has to re-render the static immediately, so I diff the uniforms struct in didSet and raise a dirty flag. The catch is excluding time and mouseClick from that comparison, because they change every frame and have nothing to do with cache contents. Miss that and the cache re-renders every frame, so it isn't a cache. The click ripple, for the same reason, warps the UVs the cache is sampled by rather than the cache itself.

How I measured. Dev-only instrumentation, commandBuffer.gpuEndTime - gpuStartTime per frame, avg/p50/p95/max printed every 120 frames. Fixed bench: M4 Max, same display, default settings, 30 fps target, ~18 s run, first window with the cold render dropped. Run-to-run noise ~0.4 ms. Plus a deterministic quality gate: an env var pins time and mouse, the build renders one frame offscreen to a PNG, and two runs of the same build give a bit-identical file. So any nonzero pixel diff is the optimization, not jitter.

What did nothing:

  • fp16 inside the noise function. I was sure about this one, noiseS runs ~200 times per pixel. Zero. The cost isn't the bilinear interpolation I converted to half, it's the sin-based hash inside it, and that stays float. Reverted.

  • Cutting geodesic steps 20 to 14. No visual change and no time change, because the bend loop already early-outs and the 120-step max is almost never reached. Cutting something that doesn't run to completion buys nothing.

  • Moving the camera parallax offset from GPU to CPU. Correct in principle (it's constant for the whole frame), but a dozen trig ops dissolve against dozens of fbm calls. Free, kept it, no measurable win.

  • Frames-in-flight semaphore. Zero on time, and that's the right answer: it limits CPU run-ahead and removes a shared-buffer race, it doesn't reduce GPU work. A correctness fix wearing a performance costume.

What worked:

  • fp16 in the color math of nebulae() only. Colors and density to half, coordinates and the noise calls left in float so spatial frequency can't jitter. Visually invisible (max diff 2/255), about minus 20% average GPU per frame from one function.

  • A sin-free hash (Dave Hoskins) instead of fract(sin(dot(...))*43758), under a soft quality bar: different noise pattern, same statistical character, avg 8.8 to 7.7 ms. Less than I expected, Apple has a fast hardware sin.

  • Static cache at 0.7x under the same soft bar. The nebula is low frequency and the hole is composited at full res, so slight star softening goes unnoticed. At the strict pixel-for-pixel bar I had rejected this: the heatmap put the entire error on sharp edges, planet rims, star points, the giant's corona.

The lesson I actually paid for. I ported the striped progressive render from the mobile project into this one, expecting the same win. GPU ms per frame:

Monolithic cache, refresh every 2nd frame: avg ~7.5, p95 ~13.2, max ~16.3, spread ~13.0.

Striped render-ahead with 4 stripes: avg ~8.4, p95 ~12.0, max ~13.3, spread ~9.4.

Peak and spread improved, average got worse. Each stripe pays a full load/store over the whole 3456x2234 rgba16Float target, and on a desktop GPU with a fat bus that fixed overhead times four outweighs what the scissor rect saves. On top of that, 4 stripes means the cache refreshes at 7.5 Hz and the nebula started stepping again. A trick that wins under mobile budget pressure can go negative on desktop, and eyeballing it would never have told me.

Final numbers, baseline to shipped: avg 7.5 to 6.2, p50 6.5 to 4.8 (minus 36%), max 16.3 to 12.0. All on a GPU that was never the bottleneck, roughly 14% of frame budget to start with. The point isn't hitting the frame, it's headroom, battery, and older Macs. p95 now bottoms out on the disk-hit path in the black hole, which is the center of the screen and the riskiest thing to touch, so I stopped there.

Curious whether anyone has measured the same fp16 result: is "the sin hash dominates, so halving the interpolation is free but pointless" a general thing on Apple GPUs, or specific to how this noise is written?


r/GraphicsProgramming • • Oct 02 '22

Question GPU Testing and Rendering

7 Upvotes

Whats the difference? Why does it take minutes to render a picture, but a video game can render 60 pictures a second?

Also, what makes a GPU stress test "hard"? Is it the amount of objects in scene, the quantity of light sources and shadows, colors of objects/lights, is it textures? What makes one render stress test harder/better?


r/GraphicsProgramming • • Jan 29 '25

This field is safe from AI?

0 Upvotes

New aspiring graphics programmer here.. would you say this field is relatively safe from the AI Hype?


r/GraphicsProgramming • • Jun 28 '26

After 14y doing Front/Back Web/Mobile stuff i want to learn game dev

4 Upvotes

I've setup a project to use 3 languages C++, Jai, Zig. All these are new for me so I'm learning them as i go along. I use AI for incrementally building functions and then trying to understand each of them.

Why write in 3? Because i want to see the differences in those and see which one i like the most. Also gives me a different perspective in understanding the logic.

I think for me Jai is clear winner, the only downside, I'm using leaked version, because i don’t have access (and i have requested) and I'm not sure if this is because of that but in vscode references when i want to find where a function is being used does not work... Also wish there was language server and formatter.

The file / folder structure I'm using is from web/mobile react world to split logic, but I'm not sure if this is right way, feedback would be much appreciated.

https://github.com/MariuzM/learning-archive/tree/main/learning-game-engine


r/GraphicsProgramming • • Jul 15 '24

Unity or OpenGL

0 Upvotes

I want to get into graphics programming. I know the math and am experienced with programming. I now want to get into Computer Graphics. Which is better to learn CG concepts, Unity or OpenGL?


r/GraphicsProgramming • • Sep 02 '26

Video Is anyone out there messing around with stochastic rendering?

4 Upvotes

I made a game about erotic aesthetic philosophy and abject poetry, and for that I chose the best way to evoke filth by using stochastic rendering with OpenGL.

It was the first time I did this, and I think the aesthetic works relatively well for the concept. Has anyone else been playing around with more outlandish experimental rendering?

By the way, if you want to see the game I made, it's free:

https://arthursouzasally.itch.io/qra-bulknur