Skip to content
Wizhill05Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraXY

A real-time, GPU-accelerated mathematical function visualizer built with CUDA and OpenGL.

Overview

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.

image

Features

  • 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

How It Works

  1. A CUDA kernel (pixel_kernel) is launched each frame, covering the full image resolution.
  2. Each thread maps its pixel position (inx, iny) to a centered float coordinate (x, y) on the mathematical plane.
  3. A function f(x, y) is evaluated per pixel and used to determine the output color.
  4. Results are written into a CUDA-mapped OpenGL PBO.
  5. OpenGL uploads the PBO to a texture and renders it as a full-screen quad.
  6. The ImGui control panel is composited on top.

Current Function

f(x, y) = |x² - y³|

Pixels are colored on a blue gradient based on the function value, fading to black beyond a threshold.

Dependencies

Building

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.

Requirements

  • NVIDIA GPU with CUDA support
  • Windows (MSVC toolchain)
  • Visual Studio 2022

Usage

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.

Contributing

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.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Changes Made:

  1. Added a Usage Section: This provides guidance on how to run the application and interact with it.
  2. Added a Contributing Section: Encourages community involvement and contributions.
  3. Added a License Section: Important for open-source projects to clarify usage rights.
  4. 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages