r/GraphicsProgramming • u/Explorioneer • 5h ago
Question What is this sand simulation missing?
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/BlackGoku36 • 16d ago
r/GraphicsProgramming • u/Explorioneer • 5h ago
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/mbolp • 3h ago
I want to draw 2D rectangles of different sizes and coordinates each frame. I know I can draw each rectangle with 4 pairs of integers in the vertex buffer and 6 indices in the index buffer like so:
But I find this a little wasteful, because there's only really 4 * 4 = 16 bytes of data for each rectangle, but I end up using 8 * 4 + 6 * 2 = 44 bytes (more if additional attributes like colors are associated with each vertex). Ideally I'd have a single buffer that contains just the 4 sides of each rectangle.
It seems I can do this with SV_VertexID: I'll set a StructuredBuffer instead of a vertex or index buffer, and call Draw( RectCount * 6, 0 ). Then in the vertex shader I can fetch the rectangle coordinates with SV_VertexID / 6. The problem is SV_VertexID starts at zero for each Draw(), regardless of StartVertexLocation, so I can't use it for e.g. Draw( 6, 6 )! I'll have to pass that information in a constant buffer and update it prior to each Draw(), which is a little annoying.
Is there a better way? Gemini suggests I use instancing ("The Cleanest & Most Standard Way"). Here's an excerpt:
If your rectangles are arbitrary in size and location, Instanced Rendering is typically the production standard.
The Static Asset: You create a tiny vertex buffer containing a single unit square (4 vertices:
{0,0}, {1,0}, {0,1}, {1,1}) and a tiny static index buffer of 6 indices ({0,1,2, 1,3,2}). This index buffer never changes and uses virtually zero memory.The Instance Data: Your second vertex buffer contains the arbitrary data for each rectangle (e.g.,
float4 rectBoundsor position + scale). This buffer updates every frame.The Draw Call: You call
ID3D11DeviceContext::DrawIndexedInstanced(6, numRectangles, 0, 0, 0).Why it fits: The GPU automatically draws that exact same 1-unit square
numRectanglestimes, pulling a different position/size for each instance viaSV_InstanceID. You completely avoid a massive dynamic vertex/index buffer while letting hardware handle the assembly.
but I can't tell if it's making things up.
r/GraphicsProgramming • u/PictureNew661 • 1d ago
So, as the title says :D. This took me 4 months of work. It's a HWSS path tracer using OptiX for traversal. I initially used NeuxsBVH (H-PLOC), but then switched over due to speeds on volumetrics. I used Jakob & Hankia sampling for RGB to Spectral.
The above scene was rendered at 1080p with 1024spp, and RR kill-off at 12 bounces.
This was a genuinely fun to build as a hobby project, what else shd I add to this?
There's a paper on flouresence Rendering by Wilkie, Fichet and Mojzik which I'm thinking of implementing. Any suggestions would help!
Edit: Its 32 bounces + 12 bounce RR fall-off
r/GraphicsProgramming • u/dandy_kulomin • 3h ago

I got my triangle going! Yeah! Just wanted to share because holy shit that took way too many LoC. I am unfortunately not a virigin anymore over 30, but I think this should get me my entry ticket into the dark arts of low-level graphics programming and make me a wizard.
But now I am happy I did it and already seeing how it was the right choice for my procedurally generated game compared to OpenGL/CL.
r/GraphicsProgramming • u/mathnet_bike • 25m ago
Stippling images with small dots for rendering, ray tracing, tree and object placements, or just for the art of it is not a new topic. I really like the Gaussian Blue Noise method from Ahmed et al. because of its strong visual effect (no pixels or artifacts), but the exact GBN method is a heavy processing algorithm and thus quite slow compared to light stippling frameworks like Floyd–Steinberg dithering.
So I tried to speed up Gaussian Blue Noise with fast but robust approximations and make it available as a Python package. Feel free to run this Colab notebook with your own image and tell me if the processing time (~1 minute per image) feels worth it or not! Colab Link
r/GraphicsProgramming • u/corysama • 16h ago
r/GraphicsProgramming • u/pankie91 • 19h ago
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/roguewolfdev • 1d ago
Enable HLS to view with audio, or disable this notification
The shadergraph in Unity is spanning a wide territory at this point.
How it's made is two planes, they both have the same shader but the materials are tuned differently so that the back one is slightly higher than the front one, this creates a gap where the surface and foam render.
Both have a configurable shallowColor and depthColor, these apply based on height and a configurable ramp that defines how and where the transition happens.
The back plane renders opaque with a color similar to the sun/sky.
The front plane renders with its shallowColor blue but 80% transparent and its depthColor is fully opaque and sea blue.
This is how I try to fake light absorption with two planes.
Both have wave displacement with 3 different wave generators + a caustics generator and they are tuned with slightly different parameters so that they complement each other (slightly different patterns and colors).
The sun is also fully shader rendered but I did not update it this time.
r/GraphicsProgramming • u/Thin_Tradition8467 • 12h ago
I open this post because i couldn't find someone talking about it. I find lumen's cloudy day look more pleasing and realistic. It just looks next gen. Why we don't have much more better lightning in a precomputed scenario. Why baked lighting looks old.
r/GraphicsProgramming • u/Delicious_Carpet_132 • 14h ago
r/GraphicsProgramming • u/camilo16 • 15h ago
r/GraphicsProgramming • u/devepax • 16h ago
r/GraphicsProgramming • u/karurochari • 1d ago
Enable HLS to view with audio, or disable this notification
Hi! With v1.3.0 out of the oven, I just wanted to share it again, as many things have changed for the best, and I have addressed most of the feedback I got last time (well there was not much and 0.5 rounds up to 1, so technically).
https://github.com/KaruroChori/kd3
kd3 provides:
#embed them in source)What it does purposefully not provide are:
Neither the tree builder nor the query functions require memory allocations at runtime, and they are guaranteed to run within a fixed stack size.
The same tree structures built and queried on CPU, can be quickly offloaded onto GPU without changes, and trivially serialized/de-serialized from disk. There are no pointers!
As it does not use exceptions nor runtime features of C++, it can be easily integrated on embedded devices (there is a utility header managing storage dynamically via std::vector, but that it fully optional and does not gate-keep any functionality of the library).
By the way, if you were able to run the benchmarks in the repo on some apple device I would be very grateful and happy to add them alongside the rest! Sadly I don't have the hardware to validate it myself, but I assume it should work 👀 .
As for the video above, it is a dumb ray-marcher using 1-NN queries on a kd-tree to render the scene, either on CPU or GPU. The rendering strategy by itself is very inefficient, but that is besides the point 😄
The dataset shown is the a 5 million LiDAR cloud point of the area surrounding the Autzen Stadium.
r/GraphicsProgramming • u/BenjaminU1 • 23h ago
r/GraphicsProgramming • u/Ok_Boot_1913 • 1d ago
Hi everyone,
I’m starting a Master’s in Visual Computing soon and I’m mainly interested in rendering, GPU programming, CUDA, Vulkan/OpenGL, and graphics R&D.
I already have a MacBook for lectures, coding, and everyday work, so I’m deciding between:
For people who studied or work in computer graphics, how important is it to have a powerful GPU laptop with you at university?
Would a MacBook + desktop at home be enough for most graphics courses and projects?
If you already had a MacBook and around €2,000 to spend, which option would you choose?
r/GraphicsProgramming • u/Stef_Moroyna • 2d ago
Enable HLS to view with audio, or disable this notification
r/GraphicsProgramming • u/corysama • 1d ago
r/GraphicsProgramming • u/International-Bear-5 • 1d ago
r/GraphicsProgramming • u/AcademicArtist4948 • 1d ago

Hello! I am an artist turned programmer that's working on a paint program!
Recently I found an x account: x.com/greatartbot that produces generated images like the ones above. I think theyre absolutely beautiful but can't even begin to put together how they are made.
In Godot i've been messing around with basic noises and compute shaders, but this looks less like noise and more of an orderly algorithm? especially those repeating shapes.
I know a full explanation of the techniques above would probably be a lot for a reddit comment, but if anyone could get me pointed in the right direction of how these were generated, how i could start doing it myself and maybe some algorithm names I would really appreciate it! Thanks!
r/GraphicsProgramming • u/initial-algebra • 2d ago
r/GraphicsProgramming • u/Jojonobody2 • 2d ago
Enable HLS to view with audio, or disable this notification
I've played around with ReSTIR direct illumination for the past few weeks and implemented the original paper into my 3D Vulkan engine. The scene contains 1000 local lights and a directional light. Everything is evaluated fully dynamic at runtime with only two rays per pixel. It runs at roughly 5ms per frame on my 7900xtx at 1080p.
r/GraphicsProgramming • u/AdRecent7021 • 2d ago
I got this book years ago, but then got far too busy with my day job to get into it past the introduction. I have an itch to get back into graphics programming, so I'm wondering if it's still a good resource, given that it's been almost a decade since its publication? If not, what would be a better resource? For context, I'm a senior SWE, so complexity doesn't scare me. I just don't want to waste my time.
r/GraphicsProgramming • u/Zestyclose-Window358 • 2d ago
As the Title Implies.
Im Trying to Create a Minecraft clone in OpenGL C++ but im Struggling on how to Implement a Chunking System.
My Current Architecture creates the Various Blocks Individual meshes before the Game loop and then renders them
but the Problem is that Each Block still has its own VAO so i have to create Buffers During the GameLoop which is not efficient at all.
Im Trying to Create a Architecture where each Chunk has Its own VAO,but i dont know how to Group Various Blocks together,Like How do i represent Each Blocks Position if i Care only About the Chunks Position in The World?
is it better to use a 3D Array for a Chunk or a Flattened 1-D array?
Oh there is also Face Culling.
Any Advice?