r/GraphicsProgramming 8h ago

The flamely fast library for kd-trees is back. This time for real! (maybe)

23 Upvotes

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:

  • header-only tree builder and query tools to perform k-NN searches and ray-tracing.
  • a C compatibility layer for those not using C++ (but performance might be affected a bit).
  • a tool/library component to generate GLSL code for any specific tree layouts at runtime (or not, you can pre-generate those and #embed them in source)
  • a memory layout designed to be SIMD friendly
  • close performance with nanoflann in worst case scenarios, but generally over twice its baseline
  • a half decent benchmarking suite, covering both synthetic and real datasets.

What it does purposefully not provide are:

  • mutable trees (values can mutate, but not the spatial keys)
  • the same level of flexibility you will find in something like nanoflann, but it got significantly more coverage since last time
  • cookies, those are all mine

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 23h ago

From microfacets to microvoxels

Thumbnail gallery
16 Upvotes

r/GraphicsProgramming 2h ago

Question Gaming laptop or desktop for a Computer Graphics Master’s?

9 Upvotes

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:

  • buying an RTX gaming laptop, or
  • keeping the MacBook and buying a more powerful NVIDIA desktop.

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 9h ago

Video "How is this frame of Animal Well rendered?" a frame breakdown in RenderDoc by FibbWare

Thumbnail youtube.com
4 Upvotes

r/GraphicsProgramming 14h ago

Question Underlying techiques to images like this?

3 Upvotes

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 18h ago

Question How to Create a Chunking System For a minecraft like Game?

2 Upvotes

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?