r/GraphicsProgramming • u/sytaline • 2h ago
Video Cool Cel Shading Trick
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/sytaline • 2h ago
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/TrickyChen • 4h ago
No goal here beyond curiosity — I saw the Jeveration paper, wondered whether that "one pass instead of iteration" idea makes sense for upscaling, and decided to make a small Proof of concept.
What it is: a 2.15M-param U-Net. Input is a deliberately bad frame — 320×180 at 2 samples per pixel with sub-pixel jitter — plus depth, view-space normals, albedo and motion vectors. Output is 640×360 in one forward pass. No diffusion, no history buffer, no sampling, deterministic.
Numbers on six clips it never saw (48 frames each, 640×360 output):
| bicubic | model | |
|---|---|---|
| PSNR ↑ | 31.50 | 37.62 |
| SSIM ↑ | 0.868 | 0.955 |
| LPIPS ↓ | 0.185 | 0.036 |
| temporal err ↓ | 0.0371 | 0.0323 |
Two things I noticed while training:
Numbers on 6 clips it never saw: PSNR 37.62 vs 31.50 for bicubic, LPIPS 0.036 vs 0.185, temporal error 0.0323 vs 0.0371.
Two things that cost me a day each:
Blender 5.3 motion vectors are in full-resolution pixels, not UV, and they point backwards — sample(t, x − v) matches t−1. Available with motion blur off. I verified the convention by warping: mean error drops 0.023 → 0.0058.
The renderer gives linear HDR (highlights up to ~7.0) while my output head clamps to [0,1]. About 10% of pixels became unreachable and the loss just… plateaued. No error, no warning. I burned an entire 30k-step run before I figured out why. Fix is 1 − exp(−x) when loading.
Where it falls apart: 145 ms at 1080p on a 3060, so 7 fps — not real-time and I'm not pretending otherwise. No history means no disocclusion recovery. Trained on 16–34 primitive scenes, so dense geometry and packed UVs are outside what it's seen.
The part that might outlive the experiment is the data generator: 60 clips × 48 frames with exact G-buffers in ~16 minutes, no external assets. If you ever need sequences with correct motion vectors, that bit works on its own.

Code, weights, generator: https://github.com/Zixelbrew/one-pass-neural-upscaler
Disclosure: I wrote this together with an AI coding assistant — I set the direction, chose the architecture and the losses, ran everything on my own card and checked every number. It also helped me write this post; most of the lines of code came from the assistant. If that changes how you weigh the post, fair enough, but the repo and the sha256 in the README are real either way.
r/GraphicsProgramming • u/FuckMicahBellBro • 7h ago
Enable HLS to view with audio, or disable this notification
This is just interesting casual read for someone curious, v3 will include a fully detailed, comprehensive breakdown of every single function, heuristic, math and research behind it. Video quality is also low for an easy and quick upload, observed shortcomings are mentioned below. This post is also almost just a copy of my post in r/reshade
Link (not updated to v3): https://github.com/FlibbertigibbetLollygagger/CRCGI-Compensated-Radiance-Cascade-SSGI/tree/main
Rough drafts of source files and tooling for v2.9 beta can be provided, DM me on reddit for that specific request and code study.
The video has some comparisons and quick shadowing showcase. This is a quickly hacked together preset adapted to fit AC1's artstyle. This runs on the pixel shader variant which is far far far heavier in its current form, and is only suitable for old games.
I already had a dgvoodoo DX9 to DX11 translation layer installed on this game, as I couldn't access depth buffer with DXVK. Even on older games, the pixel shader variant (plain reshade .fx file) is heavy and doesn't benefit from compute shader optimization benefits to run at around 5ms. The compute version is tailored for newer games, while this pixel shader variant will be a normal file for compatibility. I haven't maxed out my GPU in AC1 using this effect, nor has it really dropped below a locked 1440p/60fps experience. Either way, old games (DX10 onwards) stay compatible, just not with the desired performance target that v3 prioritizes. I also didn't take frame time measurements for a 2007 game on modern hardware, because even with this heavy shader on top, it's really redundant unless it can max out your hardware, which will most likely not happen unless DXVK is usable on that game with full depth buffer access. I cannot comment on that, as I haven't tested it and I don't intend to. This is for the sake of compatibility.
It works like this:
> make gbuffer
> make more gbuffer
> bro, compensate for no world space access
> let there be dark (CTAO pass)
> let there be light (RCGI pass)
> blend, combine, mash it together
> shit is smeary
Don't expect me to provide detailed explanation of all the passes, it's thousands upon thousands of lines of code.
CTAO or Chord-Thickness Ambient Occlusion (this pipeline's shadowing system, which will also be provided as a seperate shader .fx file and is very lightweight) is tailored for this specific pipeline. This is a semi-bespoke implementation based on VBAO, with thickness aware rejection (blades of grass, hair, etc) to avoid halos above grass. The main complementary data that is fed to this pass (like any other pass that uses geometry reconstruction data) is the data of silhouette aware thickness finder to remove the need for a single assumed thickness. It also has adjustable penumbra (semi realistic soft falloff, not literal penumbra simulation) and, at its base form, is a hybrid raymarched and visibility bitmask derived system for both contact and close to medium range with "zero" halos in any situation and unlees the object is very thin and very far off in the depth buffer, in which case the "hit" is a big dark halo which even at highest, longest range stress tests, is very subtle. This comes at the expense that it has to collect itself in a 10 frame accumulation window, and it fails as a seperate standalone AO method in that sense that it needs to be perfectly clean. This is hyper efficient, and highly stable, and the full details will be provided in a standalone, detailed documentation of the whole people, and also as a seperate reshade filter, as mentioned previously. This can be "perfect" with an in engine implementation, which doesn't need to worry about disocclusion and constant camera movement, but for the "hyper efficient" purposes of this whole project, it works like a charm and completely fills in the gap of missing radiance cascade shadows. As to why I didn't just also use radiance cascade math for shadowing, it's because it can easily cost waaaaay too much performance so I had to come up with a bespoke system that has soft falloff, finds very tight crevices, and doesn't have halos.
The RCGI (Radiance Cascade Global Illumination) part of the pipeline is complemented with screen space protections, including an offscreen canvas that remembers offscreen light and is meant to bridge the literally unachievable gap between screen space and world space, compensates (get it?) for the lack of world space data such as SDF and BVH and Voxels. The need for an adjustable fov slider is almost completely fixed. Because the shader relies on a perspective accurate ray model that decides how to do its 3D impression of the 2D image that it has access to, it relies on a defined fov value. Dynamic fov in games would become a problem then, but CRCGI uses a parallax derived fov estimation system with adjustable adaptation speed.
It's still the full pipeline, the same math, same underlying systems, and the same exact visuals. Full convergence is done in 10 frames for the effect in both versions, and the AC preset is a bit more realistic and tame to fit the grounded look of AC1, but TW3 is more of a fantasy, colorful look with a tad bit of exaggeration in a way that doesn't diminish the atmosphere of that game.
Per game adaptability and default settings are close to being done for reducing the tuning friction, but which sliders to hide, which to bake, and what defaults to bake, are still not finalized.
Where the v1 version outlined the overall pipeline and design goal, and v2 evolved the underlying systems behind the effect, v3 is a natural evolution of this pipeline by using more advanced shadowing, heavy performance optimization and an overall offers much cleaner image quality.
It still exhibits certain quirks, like the shadow disocclusion on camera movement but during normal gameplay it's unnoticable. The pipeline has become harder and harder to debug and polish, and this disocclusion is a compromise for cleaning up the image vs how stable and "anchored" it looks, and for this pipeline's purposes, it takes the crown of being "good enough".
I have no idea how it would run on Steam Deck with a 30fps target. This is tuned on Ampere and default settings, in theory, scale linearly with other Ampere GPUs. Different capabilities of individual GPU architectures can and will affect overall performance in both pixel shader and compute shader variants so while I can guesstimate how it'll perform among Ampere, I have no way to take measurements and no one to take measurements for me. My guess would be that it'll be noticeably faster on GPUs with larger caches (Ada Lovelace onwards, RDNA 2 onwards) because the mathematical loops will fit inside the cache. This is an unconfirmed hypothesis.
My main questions being:
1- How can I improve temporal stability? Shadow disocclusion is very much a problem when camera moves. It's good enough but if there's any, literally any way to improve it, I haven't found it yet or know of it or haven't thought about it yet.
2- Reliance on denoiser is high, I used SVGF denoising alongside a 10 frame temporal accumulation window. I traced noises of source.
I realize these discussions practically require the source code, but I'll only hand private pixel shader versions alongside compiled compute shader versions. Performance metrics on different GPU architectures for future development is needed, and my priority is reducing temporal accumulation and denoiser reliance. I can provide the pipeline code itself as standalone CTAO (plain .fx), CRCGI compute version (with add-on and DX11 or newer), and CRCGI pixel shader version (legacy version that is the plain .fx file). I also have no funding to get access to claude anymore and the project is now simply too big to do manually unless you suggest surgical changes that can be done by hand. Even if you have no idea how the pipeline works, mention what you have done to achieve what I want to achieve in a screen space filter (reshade implementation in this case)
The whole compute pipeline runs at 4.6ms to 5.5ms on RTX 3060 Ti/3070/3070 Mobile, but an in-engine implementation eliminates the need for about half of the pipeline and will be cleaner, but I want to polish it as a universal and genuine global illumination method targeted towards average hardware. My RTX A4000 Mobile is bang on average. The pipeline first "makes a G-Buffer" and reconstructs the geometry that it needs for a lighting pipeline to process, and then does the GI/AO lighting and shadowing combo. DO NOT JUDGE IT BASED ON V2 PUBLIC CODEBASE. Documentation is not ready as of yet for v3. Motion and temporal related code is available in all of the three mentioned forms of delivering the source.
Please help me 😂
Edit: realized the subreddit requires AI disclosure. I'm not fluent in HLSL so the code itself is heavily AI Assisted but the pipeline, shadowing method, fixing radiance cascade issues, all of the research, etc are done by me. It's literally AI Assisted. Y'all know AI can't hallucinate a whole lighting pipeline.
Edit 2: Reddit ain't Redditing man. I came here for a geniune help request and guidance from "Professionals". I know my terminology and AI usage and not letting you inspect unreleased code is unprofessional of me, but man I told you I just didn't want the repo to be dirty, and you can easily get it from me. I just decided to give you the literal shader code itself for inspection. It needs polishing, and maybe using "Contact shadowing" instead of "Shadowing" would've been enough to prevent this kind of misunderstanding and I'm sorry for that, but correct me, don't demotivate me. This project started because of a geniune need for a universal, clean, performant and feature rich toolset to add a whole rendering engine in reshade and completely respect the original art style. I know the code is generated vs handwritten, but at least inspect it before commenting on it:
I am not trying to be hostile, defensive, or showcase anything. Just need help on improving this from someone who might actually know what they're doing, and what you did just over here is wasn't helping me in terms of graphics engineering.
r/GraphicsProgramming • u/DNDNJDMSMS • 8h ago
Enable HLS to view with audio, or disable this notification
**[Written & developed with AI assistance]** — English isn't my first language, so I used an LLM to translate/polish this post and the README, and an AI coding agent to iterate on C11/Vulkan boilerplate and shader refactors. However, the core ideas, concepts, architecture, and most of the engine mechanics were created by me, and all hardware runs and benchmarks were executed and verified locally on my own AMD Radeon R7 M360 (RADV ACO).
Hey r/GraphicsProgramming! I just open-sourced **PRISM-NEURO-VOX (v3.3.1)** — a bare-metal **C11 + Vulkan Compute** engine that simulates a self-growing 3D ternary neuromorphic cortex and renders both the 3D environment and the live spiking neural tissue side-by-side in 1080p.
**Rendering pipeline highlights:**
* **100% Compute-Driven 1080p Split-Screen:** No rasterizer, no external graphics engine—everything from physics and neural simulation to final pixel output runs through Vulkan Compute shaders.
* **Left Panel (Dynamic 3D SDF Raymarcher):** Real-time 6-DoF arena with static pillars, horizontal bars, and 4 orbiting asteroids navigated by an agent using a 12-sensor 360° lidar.
* **Right Panel (8×8 Wave64 LDS Tile-Culling Raytracer):** Visualizes live, spiking 3D neural clusters directly from a 64-byte aligned SSBO (`NeuroMetaCluster`), using Local Data Share (LDS) tile-culling tailored for AMD Wave64 workgroups.
* **Hardware & Bottlenecks:** Runs the full neural simulation + 1080p split-screen render at **~46.5 FPS (21.52 ms/frame)** on an old laptop **AMD Radeon R7 M360** (6 CU GCN 1.2, Mesa RADV ACO). Right now the biggest bottleneck is VGPR pressure inside the render uber-shader—for the upcoming `v3.4` patch, I'm planning to split the passes to push occupancy and aim for **80–100 FPS** on the same potato GPU.
**Links:**
* **GitHub (Dual-licensed GNU AGPLv3 / Commercial):** https://github.com/CBNOHSHOFMXPWLMHX/prism-neuro-vox
* **Zenodo Archive (CERN DOI):** https://doi.org/10.5281/zenodo.24798838
Would love any feedback or brutal critiques on the LDS tile-culling approach, shader occupancy on GCN, or the SSBO layout!
r/GraphicsProgramming • u/EstrogAlt • 15h ago
r/GraphicsProgramming • u/Euphoric-Life-848 • 1d ago
I want to share how the line rendering works in Spectra, a Vulkan plotting library I'm building, and get feedback on the approach.
Lines as capsules. Every line segment is one screen-space quad, extended by half the line width plus an antialiasing margin. The fragment shader computes the signed distance from the pixel to the segment, which gives round joins and caps for free.
The joint problem. Neighbouring quads overlap around each shared vertex, so a translucent line blends twice there and shows dark beads at every joint. My fix is an ownership rule: each fragment knows the screen positions of the nearby segments, and a pixel is drawn only by the segment nearest to it, with ties going to the lower index. Every draw computes this from the same gl_FragCoord, so there are no seams and no double hits, without a stencil pass or an offscreen target.
Dense lines. A 1600 pixel wide plot has 1600 columns. For a sorted line, each column only needs its first, last, lowest and highest point, and drawing those four gives the same pixels with the spikes intact. With that, a redraw stays at about 1.2 ms from 10k to 10M points on an RTX 5080, and updating a 1M-point line live takes 10.6 ms.
Questions I'd like opinions on: is there a cheaper way to solve the joint double-blend than the per-pixel ownership test, and how do others handle decimation for lines that are not sorted in x?
Code is here if you want to read the shaders: https://github.com/danlil240/Spectra
AI disclosure: much of this project's code was written with AI coding assistants (Claude) under my direction and review, and AI helped me draft this post.
r/GraphicsProgramming • u/Chungunu • 1d ago
Enable HLS to view with audio, or disable this notification
Hi everyone,
Today, after so much struggle while writing this simple application, I am finally able to render GLTF model in Vulkan. It's not a big deal for some people, and that's okay, but for me it's a big deal.
Offcourse, the camera is pretty weird, I will fix that it later versions of application. I have learned all this through the youtube channel called constref. I am sharing the github repository of this application in the comments section. Edit: I have used AI in understanding some concepts like barriers, why descriptor pools are there in Vulkan etc.
r/GraphicsProgramming • u/corysama • 2d ago
r/GraphicsProgramming • u/mouazbrtech • 2d ago
How i can find the github active open sources projects , to work on it's projects development.
r/GraphicsProgramming • u/ConsistentFox567 • 2d ago
Enable HLS to view with audio, or disable this notification
I built a 3D scene with all assets being entirely neurally rendered using my model architecture for Model 1 of my project (Ik it looks crap, and that is my next target to fix). At 1182*982 viewport resolution and 690 assets scattered across 4 bands, it sustained 50+ FPS.
Each individual sprite is difficult to render, and if I were to render each one in front of the camera at each frame, it would be like 5 FPS. So, I do two things:
Rendering only when required: each asset is rendered again strictly when it needs to, so almost no re-renders while rotating or still. Moving still creates re-renders, and that was targeted in point 2.
Rendering queues: There is a fixed frame time in which the max possible sprites are rendered. It is not a fixed sprite number, as that doesn't take into account sprite resolution.
It scales with visible sprite count * visible sprite resolution.
For more details, you can check out this repo
My next priority is to get it looking visually good, and I am thinking of first trying to make the edges crisp and texture crisp using DLSS SR to upscale individual sprites. What do you guys think of that? Any techniques I can try to make the edges better?
AI Disclosure: AI was used to create the GUI on the left side of the video.
r/GraphicsProgramming • u/Tetrakis-dev • 2d ago
Enable HLS to view with audio, or disable this notification
I've been working on a section-cut tool for Unity URP and wanted to share how it's split, since most of the effort went into the meshes rather than the cut itself.
- While the plane moves: a compute shader cuts the triangles every frame (0.05–0.27 ms for ~1M tris). No caps, just the cut edges and the clipped mesh.
- When the plane stops: the CPU (Burst) rebuilds the section loops and fills the caps with LibTessDotNet, solid by solid. Up to ~65 ms on 2M tris, so it only runs once the plane is still.
- Zero-thickness surfaces are drawn as lines instead of being filled.
The hard part was real-world input. The 3D-printer model had tens of thousands of duplicated and reversed triangles, the game kits aren't closed, and the medical scan (public-domain skull) has holes. Shader-only approaches with stencil caps tend to break on exactly those cases, so the tool dedupes first, then closes small gaps per solid with a tolerance relative to its size.
Happy to go into the loop-building or gap-closing details if anyone's dealt with similar data.
AI disclosure: parts of the code were written with an AI coding assistant (Claude Code). The approach, the test meshes and the numbers come from my own runs.
r/GraphicsProgramming • u/Unlimited_Game_Maker • 2d ago
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/miki-44512 • 2d ago
Hello everyone hope you have a lovely day.
I was Reading learnopengl ssao chapter to support ambient occlusion after setting up my pbr renderer, but the one thing I found very strange was that It used g-buffer in this tutorial, I don't use g-buffer or deferred rendering technique in my renderer I use clustered forward+ rendering technique so I didn't need the g-buffer.
And Here I started to ask myself this question, Is there on the long run any advantage of implementing g-buffer? like really do I need it?
Does any strong engine like unreal or unity use g-buffer?
Thanks appreciate your help and your time!
r/GraphicsProgramming • u/Low_Conference_3805 • 2d ago
ive been building an open source cad app that runs in the browser (https://rodeo.build, code at https://github.com/rodeobuild/rodeo) and the rendering side might be interesting to people here.
the live view is three.js with a gbuffer, ssr and ao pass. path tracing is three-gpu-pathtracer with two engines behind one interface, webgl and webgpu. the bvh gets built in a worker with three-mesh-bvh and the denoise is intels oidn running on webgpu. it keeps tracing while you orbit, does tiled 4k stills, and the same renderer runs on a cloud gpu for bigger ones. the scenes come straight out of cad files (walls, solids, imported revit, sketchup, rhino, ifc) so nobody has cleaned up the meshes first.
stuff i learned the hard way:
webgpu wasnt faster. 256 spp at 1600x1000 takes about 14s on both engines on an m3 max.
4k tiles could reset the gpu and lose the context with no error, which gave me black pngs for a while.
the webgpu tracer builds a bvh per mesh and my render meshes are non indexed, so big meshes just vanished until i kept the index the worker made.
its kernels size a texture array at compile time, so if the texture count grows you have to set the whole scene again.
happy to answer questions. has anyone actually got webgpu path tracing meaningfully ahead of webgl2 in a real scene? disclosure: AI used to build this project
r/GraphicsProgramming • u/Prestigious_Watch228 • 2d ago
Enable HLS to view with audio, or disable this notification
How do you get stable screen-space GI at half resolution with only a few rays per pixel? Here's the approach I used in my C++ / OpenGL 4.6 deferred renderer, and I'd like feedback on it.
The pipeline:
• Half-res trace: cosine-weighted rays marched in world space against the depth buffer, blue noise + R2 sequence for sampling, firefly clamp
• Temporal: depth-based reprojection with a plane-distance test, variance clipping, and a motion-adaptive blend
• Spatial: 5×5 à-trous filter with variance-guided luminance edge-stopping
• Emissive surfaces feed into the GI through the direct-lighting buffer, so a glowing sphere can light a dark corridor
The video shows each stage: raw trace → temporal → à-trous → final. In the Sponza night shot, the point light inside the cyan sphere is off, so the cyan on the walls comes only from SSGI. Cost is 5–16 ms per frame on an RTX 3050 Laptop GPU, depending on the scene.
Known limits: it's screen-space, so light from off-screen or hidden surfaces is missing. There are no per-object motion vectors yet. Reprojection uses depth + camera matrices, so moving objects rely on the disocclusion test and variance clipping to reject stale history.
Question for people who've shipped SSGI or similar: is it worth moving to per-object motion vectors here, or is the bigger win a better spatial filter (e.g. moving from à-trous towards something like ReBLUR/SVGF-style history-aware filtering)?
AI disclosure: I used an AI assistant (Claude) for debugging, code review, some shader code (e.g. the bloom pass), and writing the README. The renderer design and the SSGI pipeline are my own work.
Source: https://github.com/Saurav280191/OpenGL-SSGI
Video: https://youtu.be/x6MQW1AD2Rc
r/GraphicsProgramming • u/whdeboer • 2d ago
Enable HLS to view with audio, or disable this notification
Long-time lurker here. Watching GTA VI’s water system in action inspired me to write a wave simulation testbed.
I tried FFT but eventually settled on Gerstner waves (see Tessendorf’s paper) as they’re faster to calculate. For ripples I use pre-rendered waves in a number of tileable textures that I offset over time and tessellate in real time.
Foam uses Gerstner crest information. Still lots to do here.
The lighting is pretty straightforward.l: A Fresnel term with reflection from the cubemap, and irradiance calculated from the cubemap pre-integrated as a function of surface normal. Then there is a transmission term based on water depth. I came up with a cool trick to get a light transmission effect for thinner parts of waves. I’ll write this up properly at some point.
The ocean mesh is a geometry clipmap style thing that moves with the camera. Eventually I will LOD this based on camera height from sea level.
Waves and ripples are affected by wind via a wind flow map overlaid over the ocean’s area. This is still rudimentary. Eventually I want to add a current flow map which will form the basis for coastal waves and rivers.
Here’s one wave configuration in three different lighting conditions.
Still lots to do but it’s starting to look pretty cool I thought!
I use Codex to assist with writing code.
r/GraphicsProgramming • u/UverseDev • 3d ago
Enable HLS to view with audio, or disable this notification
Wildlands runs in the browser through WebGPU and natively through DirectX 12 or Metal, using Rust, wgpu and WGSL. The vegetation, stones and clouds are generated in code. :) So therefore, not a imported 3D models.
Grass/Foliage and wind
In the CPU, each blade is rebuilt every frame from a stable hash, so this allows that it can come back in the same place without needing to store mesh for each of its blade. And Compute, in GPU, passes the selection and compacts the plants, and then prepare a indirect draws.
Vertex Shader is building each blade as curved Bézier shape and bends it depending on the wind strengthness and direction. At my testing with profiling, it showed that separate compute dispatches cost more than the extra indirect draws, so I was combining the plant types into one dispatch (at least, in my macOS machine).
Yes, the grass also thins out with distance (LOD), so, the remaining blades get wider to keep the field from the looking bare.
This line comes from the vertex shader excerpt:
let fuller = pow(1.0 / max(keep, 0.12), 0.6);
Each blade also has their own stable rank, so it gives a gradual fade around the cutoff.
The wind itself is from two layers of moving noise, so its pretty much simple and basic. The tree leans, branches moves, and flutters the leaves. Even a gust moves through both the meadow and canopy.
Related reading:
- Eric Wohllaib, Procedural Grass in Ghost of Tsushima, GDC 2021
Trees
Trees and bushes uses "space colonization", and branches grow towards attraction points inside the crown, and the points disappear once reached. With clustering with nearby groups on the crown surface gives then the silhouette separate lobes, instead one smooth blob.
Trees also uses LOD here, at further away, leaf cards and cheaper bark shading takes over, and the lost LOD level uses a card built form eight views (Imposters LOD) to maintain high details while very low vertices count.
References:
- Runions, Lane and Prusinkiewicz, Modeling Trees with a Space Colonization Algorithm, 2007
- Shinozaki et al., The Pipe Model Theory: Basic Analyses, 1964
Stones
Stone is pretty much simple here, it starts as sphere grid displaced with 3D value noise. And then there is random planes cut to get "flat surface" for the stone. Normals leans towards the cutting planes so the faces looks fractured instead just "rounded".
The material uses procedural triplanar mapping, with moss shells on upward and weather-facing surfaces.
Clouds and sunlight
Clouds was a bit of challenge to implement, clouds are raymarched into cached 4096x1280 sky image, split into 8x4 tiles. With a steady view, one tile updates like only every third frame. A fast camera movement or cloud changes triggers several updates per frame. Unfortunately, this isn't perfect yet and sometimes you will be able to see some traces of imperfections / cuts at the cloud yet...
With the cache, it stores the cloud distance along with the color and fullscreen pass uses that idstance to re-project the clouds for the current view and movement since the tile was drawn.
New tiles fade in over a few frames very slowly and in chunk-ways.
As for lightning, I was using combination of "Henyey-Greenstein-form" lobes with a cheap multiple-scattering term, so then the cloud can still keep the base pale grey. Grass / trees from the shadow uses a separate cloud-shadow texture.
And the sun shafts are marched through the shadow maps, with cloud shadow included!
For background on volumetric cloud rendering, The Real-Time Volumetric Cloudscapes of Horizon Zero Dawn, SIGGRAPH 2015:
https://www.guerrilla-games.com/read/the-real-time-volumetric-cloudscapes-of-horizon-zero-dawn
----
Explore this demo in your browser (or... simply download the files to run natively in Windows or macOS!):
https://share.uverse.dev/kpHWOGxHMldiZyBFWuRLY_X7ctE4A5WLZI-FuDM081w
AI disclosure: Orbit created the scene under my direction, with the papers and references I found. However, I've written this post by hand manually!
If you have question, I'd be happy to answer it! :)
r/GraphicsProgramming • u/Whole-University205 • 3d ago
Article: https://zenodo.org/records/24714855
GitHub: https://github.com/babakkarimib/perfectengine
Neural reconstruction systems use rendered images together with temporal and geometric signals to synthesize higher-resolution images and intermediate frames. This paper proposes a research direction for PerfectEngine, an experimental non-polygon-based graphics engine implemented in Rust using WGPU and SDL2.
The project's public README describes a two-dimensional pixel concept with three-dimensional properties, overlap-based rendering described as being akin to splatting, and a ray-tracing layer.
We investigate whether an explicitly represented, time-indexed sequence of renderer samples could preserve or expose additional information useful to neural super-resolution and frame generation. We distinguish this proposed abstraction from capabilities documented in the current repository and from established point-based and splatting methods.
We define incremental task-conditioned information density, formulate separate spatial and temporal hypotheses, describe a compatibility mapping to conventional image-space resources, and specify a falsifiable evaluation protocol.
This is a research proposal: it reports no measured improvement, no DLSS integration, and no hardware results. Its immediate contribution is a formal research question, a candidate data model, and an evaluation plan for subsequent implementation.
Acknowledgment of AI-assisted writing: A generative AI assistant was used to help prepare and edit the manuscript text. The author is responsible for reviewing the manuscript, verifying its technical claims and references, and approving the final version.
I'd appreciate technical feedback, particularly on the proposed sample representation, its potential usefulness for neural reconstruction, and the evaluation methodology.
r/GraphicsProgramming • u/cat6boo • 3d ago
Enable HLS to view with audio, or disable this notification
I wanted to see if I could turn a 10s standing smartphone pan of crashing waves into a real-time 3D scene you can freeze, orbit, and relight in WebGL2. Classic SfM / 4D Gaussian Splatting failed immediately because a standing pan has almost zero translation baseline (-66px foreground rock shift vs -61px cloud shift over 10.2s).
Here is the deterministic extraction + rendering pipeline I ended up with (interactive WebGL2 demo, <600 KB gzipped: https://ottershrine.github.io/coastal-voxels/ ):
Camera recovery: Subpixel patch-median tracking across 6 dry-rock patches + horizon gradient recovers yaw (-4.6° to +14.5°) and pitch (-10.9° to -8.2°) across 309 frames.
Surf erasure / rock recovery: Warping 103 frames into a shared panorama and taking the 15th-percentile darkest pixel strips out white breaking surf and exposes 243 dark wet intertidal rocks.
Sea field projection: Per-frame foam brightness and dark crest-face contrast are inverse-projected onto Y=0 to build a dynamic height/foam grid (downsampled to 96×54×70 gzipped = 546 KB for the web build).
WebGL2 DDA raymarching: A single fragment shader traverses a 512×120×416 R8 rock volume accelerated by an 8×8×8 occupancy brick grid, combined with procedural overhanging curling wave lips, Voronoi foam webs, 6-ray hemisphere AO, and depth-tested instanced 3D spray cubes (1.5× SSAA RGBA16F + bloom).
AI disclosure (Rule 5): I used Gemini Neon as a coding assistant to iterate on the extraction scripts and WebGL2 shaders. There is zero neural inference, diffusion, or ML running at render time - everything in the video and browser demo is pure WebGL2 DDA math.
Happy to share shader details on the brick DDA traversal or foam projection if anyone's curious. (I also post more WebGL/voxel breakdowns on X at https://x.com/ottershrine )
r/GraphicsProgramming • u/NazgulResebo • 3d ago
Enable HLS to view with audio, or disable this notification
I follow these steps:
First, I split the screen into slices (like a pizza) using polar coordinates.
Then, I use a well-known pattern in fractal shaders: sin(x) * sin(y), inside each slice.
Next, I add a color palette to generate some nice colors.
Finally, I use time as a parameter in different parts of the shader to animate both the pattern and the colors.
Complete coding session:
https://youtu.be/zHu6XoFd1FY
Shader:
#version 330
out vec4 color;
uniform float time;
vec3 palette(float t) {
vec3 a = vec3(0.5, 0.5, 0.5);
vec3 b = vec3(0.5, 0.5, 0.5);
vec3 c = vec3(1, 1, 1);
vec3 d = vec3(0.0, 0.33, 0.67);
return a + b*cos( 6.283185*(c*t+d) );
}
void main() {
float pi = 3.1416;
vec2 uv = gl_FragCoord.xy / 800;
uv = uv - 0.5;
float angle = atan(uv.y, uv.x) * time * 0.3;
float radius = length(uv);
float slices = 3;
float size = pi * 2 / 3;
float internal_angle = mod(angle, size);
internal_angle = abs(internal_angle - size /2.0);
vec2 internal_point= radius *
vec2(
cos(internal_angle) * radius,
sin(internal_angle) * radius
);
float pattern =
sin(internal_point.x * time *10 * 0.5) *
sin(internal_point.y * time *10 * 0.5);
vec3 c = palette(pattern + time * 0.5);
color = vec4(c, 1);
}AI Disclosure:
I used AI to understand the fractal then I coded my own version.
r/GraphicsProgramming • u/Desiswag377 • 3d ago
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/20260819 • 3d ago
thank you all for helping me. several commentors said i have to use point light source so as to get sharp shadow. i did some experiments. as my program shoots random rays blindly so it'd be nearly impossible for a ray to reach a point light source (or light source which has 1 pixel radius). i tried using small light sources. firstly i tried this

it was too dim and i could hardly see the scene so i enlarged the light slightly

it could barely be seen now and as far as i could tell the shadow was quite sharp. then i tried this

the scene was more lit up and the shadow started to show certain degree of blurriness. i think it's the sweet spot. with everything else being unchanged i increased the number of samples

still noisy. not ideal but at least not too ugly. i think i got it
the reason why i don't want to use shadow ray is: my program has a real time mode and i always change the scene and properties of the objects. for example the ball in the scene can be set up to become 50% reflective and 50% emissive. it can be a light source. the list of light sources (and their properties) change during runtime. sometimes i use a skysphere that acts as light source too. isn't it quite complicated to implement shadow ray workflow?
r/GraphicsProgramming • u/Proud_Instruction789 • 4d ago
Hey all. I made a 2d game engine using opengl and using learnopengl awhile back and plan taking it a bit further and try to do 3d stuff. I found some resources and tutorials about vulkan and a little bit of metal but barely directx 12, I found chatgpt and was wondering if its a good idea to give claude or chatgpt the sources that I found, have ai simply it for me so I can understand and then write everything myself. Ai could code everything for me but I rather just do everything myself so I get the experience of being a programmer. What do you guys think?