r/computergraphics • u/FrozenLin • 7h ago
r/computergraphics • u/CuriousDevv • 1d ago
Apple Metal C++ Bindings Memory Leak in Hello World Program
Here's my SO post: https://stackoverflow.com/questions/80017096/apple-metal-c-bindings-memory-leak-in-hello-world-program
I am trying to write an Apple Metal application in C++ using the metal-cpp binding. However, in a simple hello, world program I get a memory leak from simply importing the libraries. I followed the setup on Apple's official "Get started with Metal-cpp".
In order to compile with memory leak checking, the official metal-cpp repository states.
"Use the Environment Variable OBJC_DEBUG_MISSING_POOLS=YES to print a runtime warning when an autoreleased object is leaked because no enclosing AutoreleasePool is available for its thread."
Below is the Hello, World program that is causing memory leaks on my machine.
#define NS_PRIVATE_IMPLEMENTATION
#define CA_PRIVATE_IMPLEMENTATION
#define MTL_PRIVATE_IMPLEMENTATION
#include <Foundation/Foundation.hpp>
#include <Metal/Metal.hpp>
#include <QuartzCore/QuartzCore.hpp>
#include <iostream>
#include <thread>
#include <chrono>
int main(int argc, const char * argv[])
{
// insert code here...
std::cout << "Checking for metal-cpp memory leaks..." << std::endl;
while (true)
{
std::cout << "Sleeping for 10 seconds" << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(10));
}
return EXIT_SUCCESS;
} With the above program, I get continuous memory leaks. If you remove the while loop portion I get a singular memory leak. There should be no memory leaks because I'm not creating any metal objects. Even so, I have tried to add auto release pools in the following way:
#define NS_PRIVATE_IMPLEMENTATION
#define CA_PRIVATE_IMPLEMENTATION
#define MTL_PRIVATE_IMPLEMENTATION
#include <Foundation/Foundation.hpp>
#include <Metal/Metal.hpp>
#include <QuartzCore/QuartzCore.hpp>
#include <iostream>
#include <thread>
#include <chrono>
int main(int argc, const char * argv[])
{
NS::AutoreleasePool* pool = NS::AutoreleasePool::alloc()->init();
// insert code here...
std::cout << "Checking for metal-cpp memory leaks..." << std::endl;
pool->release();
return EXIT_SUCCESS;
} But I still get a memory leak. I feel like I'm going crazy. Not sure if anyone has any ideas.
r/computergraphics • u/sebasjammer • 2d ago
Polysmith: face clustering based mesh simplifier
I worked for the last couple of months to resume algorithm I first wrote in 2002 to see if it could be applied to mesh reduction. Surprisingly it could and I ended up making a tool with it. The algorithm is different from any other mesh reduction algorithm available and this is part of the family that doesn't create new vertices from the starting mesh.
In this video I show how LLMs can automatically use Polysmith to optimize objects.
It understand parameters, manual selection, billboarding, overlaying. More improvements coming over time.
you can follow me on https://x.com/sebify for more news on Polysmith
r/computergraphics • u/Miserable-Debt-8390 • 3d ago
Is Blade Runner the 1st presentation of a Gaussian splat environment in media?
Spoiler for a 40 year old movie.
Here is the scene :
Detective Dekard uses a photo analysis machine called an “Esper” to explore the environment where a photo was taken, in search for clues in his hunt for escaped replicants.
Obviously when the film was made Gaussian splats did not exists, but the implementation and usage seems awfully familiar.
Here is the scene
r/computergraphics • u/Flamert69 • 3d ago
Isometric Berlin is Live!For the best visual experience, please make sure hardware acceleration is enabled in your browser.
r/computergraphics • u/RuchLiv • 3d ago
Sublayer: Lightweight node-based OpenUSD app for multi-app scene assembly & MaterialX lookdev
Sharing an early test of Sublayer, a lightweight node-based app for orchestrating 3D scenes across apps using OpenUSD. Features loaders for Blender (with full material conversion), USD, Alembic, OBJ, VDB, and GoZ, node-based MaterialX authoring, wildcard material/asset overrides, Storm / Omniverse RTX / Autodesk Aurora viewports, and an experimental physics-based hair node.
Free and open source when released
r/computergraphics • u/natevoss_dev • 4d ago
How would you recreate this neon tunnel "roller coaster" effect in Three.js?
I'm trying to make something that looks like this for a browser game (Three.js): https://www.youtube.com/watch?v=W9as7QP8GkM
What's in it: a first-person camera rides a twisting track through an endless tunnel. The track edges glow purple and orange, the floor is lit blue, and white light streaks fly past with heavy motion blur. It loops forever.
I've tried a few times to build it from scratch and every version looks flat. There's no sense of speed, and the glow and streaks never look like the video.
What's the right approach?
- CatmullRomCurve3 + TubeGeometry/extruded track with the camera following the curve, or a shader-only tunnel?
- UnrealBloomPass + motion blur (post-processing) vs. faking the streaks with stretched particles/instanced lines?
- How do you make it loop forever without a visible seam?
- Are there existing examples, repos or assets that already do this?
Any pointers appreciated!
r/computergraphics • u/MoOnThePage-CT • 5d ago
Working on one thing at a time. Today I spent some time setting up a blob tracker using TouchDesigner.
r/computergraphics • u/northrocstudios • 5d ago
SDF 3D Engine!
Hello Everyone!
I am build an SDF game engine / 3D rendering tool in C# called Division Engine and wanted to share some screenshots of my progress over the past year. It is in alpha and not remotely close to done, but I've reached a good point where it is time to show off what it can do.
Feel free to ask any questions you may have!
Check it out here: https://github.com/NorthRocStudios/DivisionEngine
r/computergraphics • u/Moist-Huckleberry739 • 6d ago
Tested few renders In my own Realtime Render Engine, Rn runs Stable at 30 FPS 1440p on RTX 3060
Still trying my best to optimise and reduce the latecy.
Now i have this 25 million triangle forest set runs at about 26 ms a frame parked and 32 ms moving,at 1080p on an RTX 3060
But for My requirement of an small scale Virtual production and an delayed processed output that is great for my side
just check out the renders



r/computergraphics • u/_ucama • 6d ago
Lumina: pull 3D models apart with your hands, in the browser
r/computergraphics • u/EliasWick • 6d ago
I made this really nice Glitch Noise Shader, but the video didn't really take off. So hopefully you'll enjoy it.
r/computergraphics • u/Janet_believer1998 • 9d ago
What’s the best use of 3D you’ve seen on a real website, not a portfolio or tech demo?
reddit.comr/computergraphics • u/mambata95 • 9d ago
Memory Decay
made with TouchDesigner + Hex Composer
r/computergraphics • u/Objective-Silver-770 • 9d ago
A raytracer made in Scratch, with refraction, reflections, and soft shadows
I've been working on this 3D raytracer using Scratch blocks. The scene has refracting glass, chrome and gold reflections, soft shadows, and fog. Moving the camera starts a coarse render that progressively sharpens.
The stage is 480 x 360. The anti-aliasing mode uses four rays per pixel; the screenshot is from that mode.
You can try it and inspect the blocks here: https://scratch.mit.edu/projects/1437715094/
I'm trying to make it faster. What would you profile or simplify first in a renderer running in an environment like Scratch? Feedback on the materials is welcome too.
r/computergraphics • u/Sea_Radio758 • 10d ago
420 Bulb: a Mandelbulb folded into a kaleidoscope, raymarched live in WebGL2
This is one Mandelbulb layer, raymarched live in a WebGL2 shader. There are no videos or pre-rendered frames. Everything is computed per pixel on your GPU.
**What it's made of**
- **Effect:** Mandelbulb, with the power set to about 5.0 (the classic bulb is 8) and a detail level of 5.
- **Motion:** the spin wanders between 0.11 and 0.35, so it doesn't loop. With audio on, each bass hit kicks it to the top of that range and it falls back.
- **Colour:** palette cycling is on, so it morphs to a new random palette every second or two. The colours change fast.
- **Filter chain:** Wedge fold (mirrors the bulb into 7 kaleidoscope segments, at a wandering angle), then Chromatic aberration (the colour fringing), then Bloom for the glow.
Open it here: https://kicktro.com/#c=Dp0RwrU9VNB0EfgxrPAq
Every value in the scene is a slider you can change, and you can arm any slider to react to the beat from your mic or system audio. It runs in the browser, with nothing to install. A few seconds in it asks for an audio source, which you can skip; the audio is only analysed in your browser, nothing is recorded or uploaded.
r/computergraphics • u/uuxxaa • 10d ago
Bloom Sketches - Impasto oil painting demo - art by me
r/computergraphics • u/Mysterious-Spread445 • 10d ago
If you could wish for anything in a render engine – what would it be?
Hi everyone!
I’m building my own render/simulation engine (a path tracer called PrismForge), and before I decide what to work on next, I’d love to hear what you would wish for.
It can be anything:
- a big feature you’ve always wanted
- a tiny thing that annoys you every single time
- something very specific, like “I want fog that reacts to my car’s headlights”
- a workflow or a feeling, like “I just want to press one button and get a nice result without too much complicated jibberish”
- a simple, but nice conveniece feature
No wish is too small, too weird or too niche. Feel free to be as oddly specific as you want!
Thanks!