Home

Awesome

SWGPU

<p align="center"> <a href="https://swgpu.github.io/docs">Documentation</a> - <a href="https://swgpu.github.io/">Demos</a> - <a href="https://warme-engine.com/?Screenshots">Screenshots</a> - <a href="https://discord.gg/9PcFvg5f7P">Join our discord !</a> </p>

Langage License Compatibility

SWGPU is a simple 2D/3D game library written in TypeScript and powered by the latest web APIs. It offers an easy and complete way to create classic games in a non-opinionated but recommanded coding style. From the start, we chose to embrace the future with pure WebGPU 3D rendering pipeline as the name suggests. Below the stack we've choice for this work:

APIDomainDescription
WebGPU3DA modern 3D graphics API designed to provide high-performance rendering and compute capabilities directly in web browsers.
Canvas2D2DA 2D graphics API designed to provide shapes, text, and images drawing.
CSS3UIThe best way to build powerful and hightly maintenable user-interface.
Web AudioSoundAn Audio API for playing sounds.
Rapier3D3D PhysicsFast 3D physics engine.
Rapier2D2D PhysicsFast 2D physics engine.

Table of content

Getting started

Clone and install the starter-kit from this repository:

# git clone https://github.com/jay19240/SWGPU-StarterKit.git
# cd SWGPU-StarterKit
# npm install
# npm run dev

Edit the ''src/game_screen'' and start writing your game. Go to http://localhost:5173.

Compatible tools

Features

Blender plugin

Download the exporter here.
Install it on Blender by going to Edit -> Preferences -> Add-ons -> Install... -> Select the zip.
Push "n", and click on WarmeY2K Exporter to see the exportation panel.
Please, before export check if:

  1. Your Blender scene is saved.
  2. You've set the output path in the right panel -> output -> output path.

Click on the mesh and select Export JSM.
Congratulation, your static mesh is now exported !

Examples

This framework come with 16 common game templates and 9 utils templates.
Each one is thinking to represent a common game style like platformer, fighting, fps or rpg.
Template are written in typescript/javascript and build to be clean and extensible.

List of templates that you can test here:

List of examples:

Contributors

  1. Crisxzu - Contribute to the Wiki, typedoc converter and Triple Triad demo.
  2. zuda - Contribute to Triple Triad demo.
  3. luciedefraiteur - Contribute to the fog.
  4. thetinyspark - Contribute to the binary space partition.
  5. Impre-visible - Contribute to 2D tutorial.

Some parts taken for this work

Changelog

- [Ver. 1.6.0] Aseprite support added.
- [Ver. 1.6.0] Tilekit support added.
- [Ver. 1.5.0]  Pack archivage added.
- [Ver. 1.5.0]  New mesh shader hook added.
- [Ver. 1.5.0]  Engine manager added.
- [Ver. 1.5.0]  ECS Components check optimized with the use of Set.
- [Ver. 1.5.0]  ECS query is added.
- [Ver. 1.5.0]  ECS nice sugar methods is added.
- [Ver. 1.5.0]  Fix offset factor on all sprite classes.
- [Ver. 1.5.0]  Tile collision method added to Gfx2TileMap.
- [Ver. 1.5.0]  Platformer template added.
- [Ver. 1.2.0]  Binary format for 3D files added.
- [Ver. 1.1.14] Tilemap SpriteFusion format added.
- [Ver. 1.1.13] Cylinder collision class added.
- [Ver. 1.1.12] Fix and optimize jnm.
- [Ver. 1.1.10] Some added to fps demo.
- [Ver. 1.1.7]  Mipmap added.
- [Ver. 1.1.5]  Export as npm module added.
- [Ver. 1.1.1]  Outline post-process effect added.
- [Ver. 1.1.1]  Normals, id and depth rendering buffer added.
- [Ver. 1.1.1]  Object pooling added.
- [Ver. 1.1.0]  Move physics to dedicated folder and redesign JNM.
- [Ver. 1.1.0]  Rapier has been added.
- [Ver. 1.0.3]  Playstation one post-process effect has been added.
- [Ver. 1.0.3]  Post-processing effects has been added.
- [Ver. 1.0.3]  Camera WASD has been added.
- [Ver. 1.0.3]  Camera orbit has been added.

License

SWGPU is released under the MIT license.