A real-time, GPU-accelerated mathematical function visualizer built with CUDA and OpenGL.
GraXY renders mathematical functions directly onto the screen using CUDA kernels, achieving high-performance pixel-level computation on the GPU. Each pixel is mapped to a coordinate on the mathematical plane and colored based on the evaluated function, producing vivid real-time visualizations.
- GPU-accelerated rendering — every pixel is computed in parallel via a CUDA kernel
- CUDA/OpenGL Interop — uses a Pixel Buffer Object (PBO) for zero-copy transfer from CUDA to OpenGL
- Real-time display — rendered at display refresh rate with VSync enabled
- ImGui overlay — dockable control panel UI rendered on top of the visualization
- Coordinate mapping — pixel coordinates are transformed into a centered mathematical plane
- A CUDA kernel (
pixel_kernel) is launched each frame, covering the full image resolution. - Each thread maps its pixel position
(inx, iny)to a centered float coordinate(x, y)on the mathematical plane. - A function
f(x, y)is evaluated per pixel and used to determine the output color. - Results are written into a CUDA-mapped OpenGL PBO.
- OpenGL uploads the PBO to a texture and renders it as a full-screen quad.
- The ImGui control panel is composited on top.
f(x, y) = |x² - y³|
Pixels are colored on a blue gradient based on the function value, fading to black beyond a threshold.
Open Graxy.sln in Visual Studio 2022 and build the project. Ensure the CUDA Toolkit is installed and the project is configured for your GPU architecture.
- NVIDIA GPU with CUDA support
- Windows (MSVC toolchain)
- Visual Studio 2022
After building the project, run the executable to launch GraXY. You can interact with the ImGui overlay to adjust parameters and visualize different mathematical functions in real-time. Experiment with various functions to see how they are rendered on the screen.
Contributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request. Make sure to follow the project's coding standards and guidelines.
This project is licensed under the MIT License. See the LICENSE file for details.
- Added a Usage Section: This provides guidance on how to run the application and interact with it.
- Added a Contributing Section: Encourages community involvement and contributions.
- Added a License Section: Important for open-source projects to clarify usage rights.
- Minor Formatting Adjustments: Ensured consistent punctuation and clarity throughout the document.
These additions enhance the README by providing users with more context and encouraging community engagement while maintaining the original structure and information.