Skip to content
/ iEngine Public

A tiny real-time graphics rendering engine based on opengl, webgpu and webassembly.

License

Notifications You must be signed in to change notification settings

xrui94/iEngine

Repository files navigation

Project Description

This is a real-time rendering engine, which uses the WASM ( emscripten tool chain ), based on webgl, webgpu, emscripten, OffscreenCanvas(or calle it Offscreen-Canvas) technology, through C++ code, you can deploy the engine to the desktop, mobile and HTML5 web.

  • Known issues:
    • Based on the WebGPU implementation provided by Emscripten, it can be compiled, but it runs abnormally;
    • Based on the WebGPU implementation provided by WGPU-Native, it cannot be compiled on emsdk-v3.1.60; it can be compiled on emsdk-v3.1.47, but it is also an exception.

1. Compile and Build

1.1 for Native

  • First, make a build directory
mkdir build
cd build
  • Second, Generate the *.sln(Visual Studio 2022) project file
cmake ..
  • Last, Build
cmake --build .

1.3 for Web

  • First, make a build directory
mkdir dist
cd dist
  • Second, Generate the Ninja project file

Replace the value of the parameter "- DCMAKE-TOOLCHAIN-FILE" with the absolute path of your Emscripten.cmake file.

  • Note:
    • If emscripten tool chain(or call it "emsdk") is not installed, you need to first download and install it according to this instructions: https://emscripten.org/docs/getting_started/downloads.html;
    • If there is no Ninja in your system env, you need to first download a from https://github.com/ninja-build/ninja/releases and configure system environment variables for it!
    • The default configuration parameter "-DIE_ONLY_EMSCRIPTEN=ON" means using WebGPU implementation provided by emscripten(emsdk). If you want to use the WebGPU implementation provided by wgpu-native, you need to manually specify specified "-DIE_WGPU_EMSCRIPTEN=ON" configuration parameters. However with the 3.1.60 version of emsdk, it doesn 't work yet, you can track this #issue16 for checking more details.
cmake .. -DCMAKE_TOOLCHAIN_FILE="C:/env/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" -G "Ninja"
  • Last, Build
ninja

2. Run

If you want to use the native executable application, it is located in the "examples/native/lib/Debug” directory. Double click it to run. If you want to use the web application, you can install the following steps:

  • First, Install dependencies
pmpm i
  • Second, use the app

After executing the command bellow, you can use the app by opening the url http://localhost:3070/ in browser.

npm start

About

A tiny real-time graphics rendering engine based on opengl, webgpu and webassembly.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages