interopunitycuda
Demonstrate interoperability between Unity Engine and CUDA
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 8 DOI reference(s) in README -
✓Academic publication links
Links to: wiley.com -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.5%) to scientific vocabulary
Keywords
Repository
Demonstrate interoperability between Unity Engine and CUDA
Basic Info
Statistics
- Stars: 45
- Watchers: 4
- Forks: 3
- Open Issues: 5
- Releases: 2
Topics
Metadata Files
Readme.md
Interoperability Between Unity Engine and CUDA
This repository demonstrates and gives tools for interoperability between the Unity Engine and CUDA. Specifically, it showcases how to create and render graphical objects (e.g., textures) in Unity and edit them directly through CUDA kernels. This approach bypasses compute shaders, leveraging the full capabilities of CUDA. For more details about this project you can read our article InteropUnityCUDA: A Tool for Interoperability Between Unity and CUDA.
Plugins
The Plugin folder contains the C++ libraries used for interoperability. These libraries can be regenerated using CMake. Assuming you are at the root of the interopUnityCUDA repository, execute the following commands:
bash
cd ./Plugin
mkdir build
cmake -B build
To compile the libraries:
bash
cmake --build build --config Release
cmake --build build --config Debug
To use the library in your Unity project, copy the contents of the Debug and Release folders to your Unity project.
The C++ project consists of three libraries:
1. Utilities
This library includes a singleton logger to simplify debugging between Unity and the native plugin. It also contains Unity's native plugin API, which is used by the other libraries.
2. PluginInteropUnityCUDA
This library provides the classes that handle interoperability between Unity, the graphics API, and CUDA. Additionally, it includes functions to register and invoke new Action objects.
An Action is a base class from which you can inherit to override specific functions. These functions are executed on the render thread, which is a necessary condition for making interoperability work.
3. SampleBasic
This library contains two basic examples of actions:
- ActionSampleTexture: Registers a Unity texture with CUDA and writes some color data to it.
- ActionSampleTextureArray: Registers a Unity texture array with CUDA and writes color data to each texture slice.
- ActionSampleVertexBuffer: Registers a Unity vertex buffer of float4 with CUDA and modifies its values.
InteropUnityCUDA Unity Project
The InteropUnityCUDA folder contains the Unity project, which includes scripts for handling actions and invoking them on the render thread. Additionally, there is a script for displaying log information in Unity, using the logger from the Utilities library (see above).
The project includes a single scene demonstrating the three basic actions described earlier.
Generate and Add the InteropUnityCUDA Package to Your Project
See the dedicated documentation here.
Create Your Own Action
See the dedicated documentation here.
Platform Availability
This project has been tested with Unity 2021.1 and CUDA 12.2. It currently supports only OpenGL and DirectX11 graphics APIs. The plugin is designed for Windows but can also be compiled for Linux.
Limitations
- For DirectX11, textures work only with the
Texture2Dtype, not withRenderTexture(see issue #2). - Buffers cannot be written by both Unity and CUDA without remapping/unmapping the buffer after each write operation in CUDA (see issue #12).
Meta
This repository was developed as part of David Algis' thesis in collaboration with XLIM and Studio Nyx.
If you find this project useful, please consider citing our associated publication:
Algis, D., Bramas, B., Darles, E., & Aveneau, L. (2025). InteropUnityCUDA: A Tool for Interoperability Between Unity and CUDA. Software: Practice and Experience. https://doi.org/10.1002/spe.3414
```bibtex @article{algis2025interopunitycuda, author = {Algis, David and Bramas, Berenger and Darles, Emmanuelle and Aveneau, Lilian}, title = {InteropUnityCUDA: A Tool for Interoperability Between Unity and CUDA}, journal = {Software: Practice and Experience}, year = {2025}, doi = {10.1002/spe.3414}, url = {https://onlinelibrary.wiley.com/doi/10.1002/spe.3414} }
Owner
- Login: davidAlgis
- Kind: user
- Repositories: 2
- Profile: https://github.com/davidAlgis
Citation (citation.cff)
cff-version: 1.2.0
message: "If you use this software, please cite the following work:"
authors:
- family-names: Algis
given-names: David
- family-names: Bramas
given-names: Berenger
- family-names: Darles
given-names: Emmanuelle
- family-names: Aveneau
given-names: Lilian
title: "InteropUnityCUDA: A Tool for Interoperability Between Unity and CUDA"
version: 1.0.0
doi: 10.1002/spe.3414
date-released: 2025-02-12
url: https://onlinelibrary.wiley.com/doi/abs/10.1002/spe.3414
GitHub Events
Total
- Issues event: 1
- Watch event: 10
- Issue comment event: 1
- Push event: 4
- Fork event: 1
Last Year
- Issues event: 1
- Watch event: 10
- Issue comment event: 1
- Push event: 4
- Fork event: 1
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 13
- Total pull requests: 0
- Average time to close issues: about 1 month
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 1.69
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 0
- Average time to close issues: about 3 hours
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 0
- Average comments per issue: 1.5
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- davidAlgis (12)
- Sakura-hana-bit (1)