Code Monkey home page Code Monkey logo

taichi-unreal's Introduction

Taichi AOT Plugin for UE5

Requires Unreal Engine 5.0.3 or above

Supports Linux & Windows

SPH AOT Example

This is the ultimate example with AOT Plugin integrated, which demonstrates SPH AOT runs in an UE5 project.

C++ class Source/SPHExample/SPH_Particles_Box contains the major AOT implementation.

Taichi C-API were packaged into UE Plugin located at Plugins/AOTPlugin

SPH_AOT files were generated using:

[email protected]:taichi-dev/taichi-aot-demo.git
commit: d1a4842 [misc] Remove usage of deprecated kwarg in rw_texture type annotation (#111)

C-API library was generated using:

[email protected]:taichi-dev/taichi.git
commit: 0559411ae [bug] Fix crashing on printing FrontendFuncCallStmt with no return value

Steps to generate Taichi AOT Plugin from scratch

  1. Generate Taichi C-API library
  • Have -DTI_WITH_C_API=ON in your TAICHI_CMAKE_ARGS
  • Add target backends to your TAICHI_CMAKE_ARGS, -DTI_WITH_CUDA=ON -DTI_WITH_LLVM=ON suggested
  • Clone and compile Taichi following this guide: https://docs.taichi-lang.org/docs/dev_install

You'll find C-API library in: {TAICHI_REPO}/_skbuild/{OS_NAME}/cmake-install/c_api

  1. Update C-API library for UE project TaichiAOTPlugin
  • Replace C_API_LINUX or C_API_WINDOWS under TaichiAOTPlugin/Plugins/AOTPlugin/Source/AOTPlugin/Public/
  • Regenerate taichi_unreal.hpp if neccessary. (taichi_unreal.hpp is generated from taichi.hpp by replacing all function calls to C-API with a macro CALL_C_API_FUNC, which wraps the original direct function calls with dlopen & dlsym. TODO: Automatically generate taichi_unreal.hpp from taichi.hpp)
  1. Generate Taichi AOT Plugin
  • UE interface: Edit->Plugins->AOTPlugin->Package
  1. Import Plugin in your project
  • Take SPHExample project as an example, put the generated AOTPlugin under SPHExample/Plugins/
  1. Generate SPH AOT files

taichi-unreal's People

Contributors

jim19930609 avatar

Stargazers

Adam Erickson avatar  avatar  avatar Hubert Lu avatar  avatar Youtian Lin avatar Nikan Doosti avatar yekuang avatar 久绊A avatar pengyu avatar li5414 avatar CGBull avatar PENGUINLIONG avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.