r/GraphicsProgramming • • May 11 '25

Video Implemented Sky AO as fake GI for dynamic world − how is it looking?

229 Upvotes

When I started working on building snapping and other building systems, I realized my lighting looked flat and boring.

So I implemented this:

  1. Render 32 low-res shadow maps from different directions in the sky, one per frame, including only meshes that are likely to contribute something.

  2. Combine them in a fullscreen pass, adjusting based on the normal for diffuse and the reflected view vector for specular. Simply sampling all 32 is surprisingly fast, but for low-end devices, fewer can be sampled at the cost of some dithering artifacts.

  3. Apply alongside SSAO in the lighting calculations.

How's it looking?


r/GraphicsProgramming • • Mar 03 '24

Realistic Ocean Simulation Week 16: Finished project for my dissertation

229 Upvotes

r/GraphicsProgramming • • Aug 21 '25

You can now run HLSL programs directly on the Shader Learning website FOR FREE!

Thumbnail
gallery
228 Upvotes

We have just added HLSL as a new language option for solving tasks and exploring shader programming. It is still early days, so theory explanations and default task code havent been fully updated yet, so things might feel a bit raw. Expect a few bugs or inconsistencies here and there.

the part of the Built-in functions module (it is free) has already been translated to HLSL and supplemented with new theory content. It is a work in progress, but we are steadily expanding coverage and refining the experience.

Your feedback will help us polish the platform and make it even better for shader learners everywhere.

👉 https://shader-learning.com


r/GraphicsProgramming • • Apr 13 '26

Nermal Dynamics - A Physics Engine and Renderer Written in Metal

Thumbnail
gallery
227 Upvotes

Hey folks! I wanted to share some screenshots of a project I've been building over the last 6 months: Nermal Dynamics.

It's a fully custom physics engine and renderer built on Apple Metal.

There is no AI and it uses no external libraries. It's just good old fashioned physics and rendering.

I originally started this project to learn compute shaders after reading this paper. I have a some experience in high performance computing and this seemed like a fun and interesting challenge.

The power and flexibility of compute shaders naturally drove the physics architecture, leading to a design philosophy I've been calling "Everything is Compute Shaders" (EiCS). If it can be a compute shader, it is! Physics, gravity, collisions, fire propagation, magnetism, glue constraints, all run on the GPU. The CPU acts only as a lightweight coordinator for managing buffers and driving the UI.

The renderer is built completely from scratch using Metal's render and ray tracing pipelines, sitting on top of the same GPU-first foundation.

During simulation, the CPU only runs at about 8% and stays in low-power mode.

At its core, the compute engine simulates Cosserat rods (flexible segments that stretch, bend, collide, connect, and break). The segment count scales directly with GPU power. On my M4 Pro, I get about 170k-200k segments and my iPhone handles around 30k. All of this runs at interactive frame rates.

The Cosserat solver sits at the center and other systems either feed into it directly (gravity, glue, magnetism, projectiles) or consume its outputs (collisions, positions, distances).

The renderer leverages Metal's render and ray tracing pipelines to bring the simulation to life. It features:

  • HDR with bloom and lens flares

  • PCSS shadow mapping

  • Volumetric clouds and god rays

  • An ocean system with foam and Fresnel reflections

  • Ray-traced glass spheres that can reflect or refract (or both!)

  • GPU-driven LOD, alongside frustum and occlusion culling

You get a full suite of tools to play with the simulation. You can:

  • Pull, cut, and fling segments around.

  • Ignite segments and watch fire dynamically spread and burn through materials.

  • Change material properties to create emergent behaviors like kinetic sand, water, jelly, etc.

  • Magnetize segments or glue structures together.

  • Place gravity orbs that attract, repel, pulse, swirl, or even drive standing-wave cymatics.

  • Build destructible sculptures, kinetic art, Chladni patterns, or anything else you can dream up.

I'm starting to work on sound and music and will work on a trailer soon! I'd love to hear your initial thoughts and I'm happy to answer any questions.

During early prototyping, I built a Python version that runs on any machine. Once Nermal Dynamics ships, I plan to release that prototype as open source (openNermal) so that folks can build using a version of the physics engine.

Some of the patterns in the game and screenshots came from here: https://www.cemyuksel.com/research/yarnmodels/


r/GraphicsProgramming • • Jan 07 '26

Source Code I built an open source GPU database with 2,824 GPUs

Post image
225 Upvotes

I needed GPU specs for a project and couldn't find a good structured database. So I built one.

2,824 GPUs across NVIDIA, AMD, and Intel. Each GPU has up to 55 fields including architecture, memory, clock speeds, and kernel development specs like warp size, max threads per block, shared memory per SM, and registers per SM.

NVIDIA: 1,286 GPUs

AMD: 1,292 GPUs

Intel: 180 GPUs

Free to use. Apache 2.0 license.

GitHub: https://github.com/RightNow-AI/RightNow-GPU-Database


r/GraphicsProgramming • • Sep 26 '25

Fractal Worlds – Explore generative fractals in your browser

225 Upvotes

I’ve been experimenting with WebGPU + Three.js to raymarch fractals in real time.
The first 2 interactive fractal worlds are now live: https://fractalworlds.io

You can:

  • Fly around with the mouse + WASD (hold Shift to move faster)

  • Press Spacebar to randomize and animate fractal parameters

  • Tweak settings in the GUI to explore different looks

Would love feedback from the community, both on the visuals and on performance across different GPUs/browsers!


r/GraphicsProgramming • • Jun 19 '25

Playing around with real-time subsurface scattering + translucency

225 Upvotes

r/GraphicsProgramming • • Feb 10 '26

Source Code Built a WebGPU 4D Weather Globe - some shader tricks I learned along the way

Post image
224 Upvotes

Hey all,

Been working on a weather visualization project for a while now. It's a globe that shows current and forecast temperature, wind, and pressure data using WebGPU. Wanted to share some of the graphics challenges I ran into and how I solved them - figured this crowd might find it interesting (or tell me I'm doing it wrong).

Live: https://zero.hypatia.earth
Code: https://github.com/hypatia-earth/zero

Temporal interpolation of isobars

Weather data comes in hourly chunks, but I wanted smooth scrubbing through time. So the pressure contours actually morph between timesteps - the isobars aren't just popping from one position to another, they're interpolating.

Same deal with wind - particles blend their direction and speed between hours, so you can scrub to any minute and it looks smooth.

Haven't seen this done much in web weather apps. Most just show discrete hourly frames.

Wind particles that stay on the sphere

This one was fun. Needed particles to trace wind paths on the globe surface without drifting off or requiring constant reprojection.

Solution: Rodrigues rotation formula. Instead of moving in cartesian coords and projecting back, I rotate the position around an axis perpendicular to both the current position and wind direction:

axis = cross(position, windDirection)
newPos = normalize(rodrigues(position, axis, stepAngle))

Keeps everything on the unit sphere automatically. Pretty happy with how clean and fast this turned out.

Pressure contours entirely on GPU

The whole pipeline runs in compute shaders:

  • Regrid irregular weather data to regular grid

  • Marching squares for contour extraction

  • Prefix sum for output offsets

  • Chaikin subdivision for smoothing

  • Final render

No CPU round-trips during animation. The tricky part was Chaikin on a sphere - after each subdivision pass, vertices need to be re-normalized to stay on the surface. Otherwise the contours slowly drift inward. There is still a bug: Sometimes NE pointing lines are missing :(

WebGPU in production

Still feels early for WebGPU on the web. Had to add float16 fallbacks for Safari on iPad (no float32-filterable support). Chrome's been solid though. The compute shader workflow is so much nicer than trying to do this stuff with WebGL hacks.

Anyway, curious if anyone else has worked on globe-based visualizations or weather data rendering. Always looking to learn better approaches.


r/GraphicsProgramming • • Sep 24 '24

Video I really like old games and wanted to figure out how raycasters work, so I implemented one :)

224 Upvotes

r/GraphicsProgramming • • Aug 23 '26

Source Code imgui Login interface in C++ with DirectX 11

221 Upvotes

some features
liquid cursor
great font [freetype & geist]
reusable components
curved and windowless window
lot of animated stuff

resources usage
40-50Mb of ram
1-2% Cpu ( average cpu)
40-50Vram

https://github.com/poncippg-spec/Free-Solace-ImGui-Interface (new repo as github terminated old one for no reason )


r/GraphicsProgramming • • Sep 11 '25

Video Ocean Simulation with iWave Interactivity in Unity

221 Upvotes

I had a lot of fun making an FFT-based ocean waves with iWave water interaction and GPU-driven buoyancy in Unity. Papers and sources I used while making this


r/GraphicsProgramming • • Aug 10 '26

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

220 Upvotes

r/GraphicsProgramming • • Apr 30 '21

Got a nice render out of my hobby path tracer :)

Post image
220 Upvotes

r/GraphicsProgramming • • Jun 24 '25

Article CUDA Ray Tracing 3.6x Faster Than RTX: My CUDA Ray Tracing Journey (Article and source code)

Post image
218 Upvotes

Trust me — this is not just another "I wrote a ray tracer" post.

I built a path tracer in CUDA that runs 3.6x faster than the Vulkan RTX implementation from RayTracingInVulkan on my RTX 3080. (Same number of samples, same depth, 105 FPS vs 30FPS)

The article includes:

  • Full optimization breakdown (with real performance gains)

  • Nsight Compute analysis and metrics

  • Detailed benchmarks and results

  • Nvidia Nsight Compute .ncu-rep reports

  • optimizations that worked, and others that didn't

  • And yeah — my mistakes too

🔗 Article: https://karimsayedre.github.io/RTIOW.html

🔗Repository: https://github.com/karimsayedre/CUDA-Ray-Tracing-In-One-Weekend/

I wrote this to learn — now it's one of the best performing GPU projects I've built. Feedback welcome — and I’m looking for work in graphics / GPU programming!


r/GraphicsProgramming • • May 12 '25

iTriangle Benchmarks

218 Upvotes

I ran benchmarks comparing iTriangle to Mapbox Earcut (C++/Rust) and Triangle (C) on three kinds of clean input:

  • Star-shaped polygons

  • Stars with central holes

  • Rectangle filled with lots of small star holes

On simple shapes, Earcut C++ is still the fastest - its brute-force strategy works great when the data is small and clean.

But as the input gets more complex (especially with lots of holes), it slows down a lot. At some point, it’s just not usable if you care about runtime performance.

iTriangle handles these heavier cases much better, even with thousands of holes.

Delaunay refinement or self-intersection slows it down, but these are all optional and still run in reasonable time.

Also worth noting: Triangle (C) - old veteran - still going strong. Slower than others in easy cases, but shows its worth in real combat.


r/GraphicsProgramming • • Mar 15 '25

Update on my Random Image Generator

Thumbnail
gallery
218 Upvotes

Hi everyone! A month ago, I shared a GIF of my first app build, and I got some really nice feedback, thank you! I've since added some new features, including a randomization function that generates completely unique images. Some of the results turned out amazing, so I saved a few and added them as Presets, which you can see in the new GIF.

I’d love to hear your Feedback again! The project is open source, so feel free to check it out (GitHub) and let me know about any terrible mistakes I made. 😆

Also, here are my sources in case you’re interested in learning more:

Cheers Nion


r/GraphicsProgramming • • Dec 01 '25

How to replicate the 90's prerendered aesthetic?

217 Upvotes

In the 90's the computational limitation of processors meant that, whenever possible, 3d assets would be subistituted for prerendered images. In principle, any printscreen one takes today would count as a prerendered graphical element, and yet one can see strong correlations in reguards to a specific style in 90's prerendered graphics. There is something about the diffuse ilumination that seems to have been very common to be used during the prerendering procedure, together with some fuzzines which I think could be related to old JPEG standards that may have added artifacts into the final images. I would like to have a shader that produces this same type of prerendered aesthetic that I am talking about, but rendered in real time allowing for perspective changes, how would I achieve that?

Digimon World 1 (1999 PS1) is particularly good at capturing what I mean by 90's prerendered aesthetic (I used AI (grok) to make the video to try to get a example of how a shader that reproduced that same aesthetic would look like in camera motions that would change perspective, some of the aesthetic is preserved in this change, but AI is rather so-so at this...).


r/GraphicsProgramming • • May 30 '25

Very good video from Sebastian Lague on software rendering

Thumbnail
youtube.com
217 Upvotes

I'm pretty new to graphics programming and I feel like I understand a lot more about it from this video


r/GraphicsProgramming • • May 06 '25

Software-Rendered Game Engine

217 Upvotes

I've spent the last few years off and on writing a CPU-based renderer. It's shader-based, currently capable of gouraud and blinn-phong shading, dynamic lighting and shadows, emissive light sources, OBJ loading, sprite handling, and a custom font renderer. It's about 13,000 lines of C++ code in a single header, with SDL2, stb_image, and stb_truetype as the only dependencies. There's no use of the GPU here, no OpenGL, a custom graphics pipeline. I'm thinking that I'm going to do more with this and turn it into a sort of N64-style game engine.

It is currently single-threaded, but I've done some tests with my thread pool, and can get excellent performance, at least for a CPU. I think that the next step will be integrating a physics engine. I have written my own, but I think I'd just like to integrate Jolt or Bullet.

I am a self-taught programmer, so I know the single-header engine thing will make many of you wince in agony. But it works for me, for now. Be curious what you all think.


r/GraphicsProgramming • • Aug 03 '26

Hardware Raytracing with my RHI!

Thumbnail
gallery
216 Upvotes

I made a fully open source Vulkan RHI that supports hardware pathtracing so I decided to make a test application with it. Very fun!

Source: https://github.com/Nevarea-Project/Nevarea


r/GraphicsProgramming • • Sep 07 '25

CPU Software Rasterization Experiment in C++

216 Upvotes

Inspired by Tsoding's post about Software Rasterization on the CPU, I gave it a try in C++. Here are the results. The experiment includes depth testing, back-face culling, blending, MSAA, trilinear filtering, gamma correction and per-pixel lighting.

I am impressed that a CPU can draw 3206 triangles at 1280x720 with 4x MSAA at ~20FPS. I wouldn't try to build a game with this renderer, but it was a fun experiment.


r/GraphicsProgramming • • May 03 '25

Particle Effect Maker in WebGPU

216 Upvotes

Feel free to make your own particle effects at https://particles.onl - your browser must support WebGPU. If you make a cool enough particle effect send me the JSON save either by dm or at [email protected] and I’ll replace the “Reactor” example with your effect.

If you want to checkout the code or star the repo, the code is available at https://github.com/MankyDanky/particle-system

I used GPU instancing to render the particles and compute shaders for the physics. AMA


r/GraphicsProgramming • • 17d ago

Source Code Vector field simulation with my own math library and Vulkan!

214 Upvotes

I made a small vector field visualizer in C# with Vulkan through Silk.NET.

You type some 2D field, for example F(x, y) = [x,sin(y)] and it draws the flow with particles.

How it works:

- Formula is parsed and compiled at runtime into one fast delegate, so evaluting the field for every particle each frame is light

- 1,200 to 6,000 particles depending on window size, integrated with RK4 on the CPU, each with a 24-point trail

- Everything is drawn as colored with one tiny shader and 4x MSAA

All the math comes from Epsilon - my symbolic math library for .NET that I'm working on.

- Simulation: https://github.com/XBambinoX/VectorField

- Library(C#): https://github.com/XBambinoX/Epsilon

AI disclosure: I used AI assistants to help write parts of the simulation code and fix bugs in my library.


r/GraphicsProgramming • • Jul 08 '26

10k models running on my 1050 laptop

214 Upvotes

i can finally say im gpu bound. the wow models have ~280 bones and ~400 tracks i have no idea how to push this further without mesh shaders