-
Notifications
You must be signed in to change notification settings - Fork 31
Mandelbulb
Portalez Régis edited this page May 11, 2026
·
1 revision
Real-time 3D Mandelbulb fractal renderer. Distance-estimation raymarching on the GPU, output rendered via OpenTK (OpenGL 4) against a cudaSurfaceObject_t shared between CUDA and OpenGL. The window is interactive — rotate the camera with the mouse, change the light angle, etc.
Source: src/3.Maths/Mandelbulb/.
Key files:
-
Mandelbulb.cs— the device-side distance estimator and per-pixel shading kernels. -
MathFunctions.cs—float3vector math (normalize,cross,dot, etc.) all marked[Kernel]. -
TextureHelper.cs— registers an OpenGL texture for CUDA interop viacudaGraphicsGLRegisterImage. -
Program.cs— OpenTKGameWindowplumbing and the main render loop.
What this sample showcases:
-
CUDA-OpenGL interop:
cudaGraphicsResource_t+cudaGraphicsMapResourcesto give a CUDA kernel direct write access to an OpenGL texture without a CPU round-trip. -
cudaSurfaceObject_t: bindless surface writes from inside the kernel. -
Heavy use of
float3arithmetic: shows that user-defined[Kernel]math helpers compose just like CUDA-side__device__functions.
Requires an OpenGL 4-capable driver and a window manager (won't run headless on a server without an X server).
1. Simple
2. Imaging
3. Maths
- Naive Matrix
- Shared Matrix
- Sparse Matrix
- Conjugate Gradient
- Newton Fractal
- Mandelbulb
- NBody
- Monte Carlo Heat Equation
4. Finance
5. CUDA Runtime
6. Advanced
- GenericFunctions
- GenericMemoryAccess
- GenericReduction
- InterfacesReduction
- LambdaReduction
- SimpleMetadataDecorator
7. AI