• Stars
    star
    117
  • Rank 301,828 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 1 year ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A web-based 3D virtual space lightweight framework with high flexibility, extensibility, and easy hosting, built on ECS architecture

Tiny Web Metaverse

Latest NPM release

Tiny Web Metaverse is a Web-based multi-user 3D virtual space lightweight framework with high flexibility and extensibility. It is built on web standards, making it familiar and easy to use for developers with Web development experience.

Tiny Web Metaverse adopts an ECS architecture. This architecture makes it easy to add or modify features without having to modify existing code.

Tiny Web Metaverse uses Docker containers to reduce the overhead of environment setup.

Online Demo

Online Demo

Click to enter a room, and then share the URL (with ?room_id=xxx) with your friends to meet up with in a room.

Built on this framework, this demo offers the following features:

  • 3D Exploration: Walk around and rotate the 3D space
  • Collaborative Object Manipulation: Collaborate with remote users to manipulate objects in the 3D space
  • Audio and Text Chat: Communicate with remote users via audio or text
  • Mobile-Friendly: Good support for mobile devices
  • VR/AR Experience: Experience the 3D space in a realistic way using VR/AR devices
  • AI Model Generation: Generate 3D models automatically using generative AI

Screenshots



AI Demo videos

One of the features of Tiny Web Metaverse is that it is easy to add features due to its high extensibility. For example, it is easy to add features that leverage generative AI, which is rapidly growing recently. I have actually added some features locally and recorded videos. You can watch them here.

What this framework provides

This framework makes it easy to create and deploy multiplayer virtual 3D space web apps that reflect user ideas in a free way.

The advent of WebGL and WebGPU, as well as JavaScript 3D graphics libraries that use them, has made 3D rendering easier in browsers. Also, WebXR, WebSocket, and WebRTC have made it possible to create web apps with VR/AR, and real-time network processing.

Many people are interested in developing multiplayer virtual 3D space web apps that could realize new forms of human interaction, such as open online games and virtual events.

However, developing them can be surprisingly laborious. You need to develop both the client and the server, and you need knowledge of hosting and Web APIs. Network synchronization is especially troublesome. These processes can be cumbersome.

There are ways to use existing platforms to create custom content, but they can be restrictive, as custom logic can be difficult to add, and you may need to register with the platforms.

To address these challenges, I created a framework that is easy to modify, extend, and self-host.

The framework handles the cumbersome processing of the Web APIs and networking, so you can focus on your own custom logic and content creation. It is also built on technologies that are commonly used in web app development, such as JavaScript and TypeScript, so you can develop with a familiar development environment and workflow.

Features

  • Extendibility and flexibility with ECS architecture
  • Easy self-hosting with Docker
  • 3D space rendering with WebGL
  • VR/AR support with WebXR
  • Real-time network synchronization with WebSocket
  • Real-time Audio/Video communication with WebRTC
  • Audio effects with WebAudio
  • Support for mobile devices
  • Accelerates development with standard Web technologies

Example use cases

  • Multiplay 3D games: Develop online multiplay virtual 3D games.
  • Virtual meeting rooms: Host online meetings and conferences in 3D spaces with avatars and interactive elements.
  • Art galleries and museums: Showcase virtual exhibitions and collections for immersive viewing and interaction.
  • Online Music Festivals: Host online music live events in 3D spaces where many people connect with music lovers.
  • Educational simulations: Create virtual environments for learning about various topics, like history, science, or technology.
  • 3D model viewer and builder: Develop a platform for users to create and share 3D models within the virtual 3D platform.
  • Collaborative art projects: Create shared spaces where multiple users can contribute to a virtual artwork or project.

Architecture overview

Client:

  • bieECS resource management
  • 3D graphics rendering using WebGL
  • VR/AR processing using WebXR, such as positional tracking
  • Network synchronization of object states with remote clients using WebSockets via State server
  • Audio and video communication with remote clients using WebRTC via Stream server
  • Input handling from input devices such as mouse, keyboard, touchscreen, VR headset, and so on

Stream server:

  • SFU WebRTC server for client-to-client audio and video communication
  • Reduces the burden on the publisher, and also saves the number of WebRTC connections

State server:

  • A Pub/Sub server for synchronizing object state between clients
  • Adopts a Pub/Sub architecture, which makes it loosely coupled and scalable

Database:

  • Used by the state server to store object state

Sub-projects

This project consists of the sub projects. See packages directory.

Documents

We strongly recommend starting with the Getting Started documentation.

How to build

$ git clone https://github.com/takahirox/tiny-web-metaverse.git
$ cd tiny-web-metaverse
$ npm run install:all
$ npm run build:all

How to run Demo locally

Prerequirements:

# Terminal 1
$ cd packages/stream_server
$ npm run server

# Terminal 2
$ cd packages/state_server
$ mix deps.get
$ mix deps.compile
$ mix ecto.create
$ mix ecto.migrate
$ mix phx.server

# Terminal 3
$ cd packages/demo
$ npm run server

And access http://localhost:8080 on your browser.

How to run Demo locally with Docker

Prerequirements:

$ ./deploy/up.sh

And access http://localhost:8080 on your browser.

Deploy Demo to Cloud servers

Refer to the documents.

How to support the project

  • Test and Report bugs
  • Make Pull requests to fix bugs or add new features
  • Monthly or one-time support via GitHub sponsors: T.B.D.
  • Make a support contract: T.B.D.

More Repositories

1

riscv-rust

RISC-V processor emulator written in Rust+WASM
Rust
595
star
2

nes-js

JavaScript NES(Famicom) emulator
JavaScript
205
star
3

nes-rust

NES emulator written in Rust + WASM
Rust
204
star
4

toho-like-js

Touhou style danmaku shooter game which runs on your chrome.
JavaScript
176
star
5

online-wgsl-editor

A tiny WGSL online editor
JavaScript
174
star
6

webgpu-devtools

JavaScript
172
star
7

mmd-viewer-js

MMD model dances on your chrome with WebGL.
JavaScript
158
star
8

wgpu-rust-renderer

A tiny WebGPU renderer written in Rust
JavaScript
138
star
9

THREE.WebGPURenderer

Experimental Three.js WebGPU renderer
JavaScript
132
star
10

three-gltf-extensions

Unofficial Three.js glTF loader/exporter plugins
JavaScript
118
star
11

MMDLoader-app

sample applications for THREE.MMDLoader
HTML
111
star
12

WebAssembly-benchmark

HTML
89
star
13

a-mmd

A-Frame MMD component
JavaScript
83
star
14

ThreeNetwork

Network sync library for Three.js
JavaScript
72
star
15

glTF-Blender-IO-materials-variants

Blender3D addon for glTF KHR_materials_variants extension
Python
71
star
16

ecs-rust

Tiny ECS library in Rust
JavaScript
60
star
17

three.wasm-experimental

Experimental Three.js WASM (WIP)
JavaScript
55
star
18

glTF-Blender-IO-EXT-mesh-gpu-instancing

Python
52
star
19

mmd-parser

NPM MMD parser package
JavaScript
48
star
20

webgpu-trial

WebGPU trial
HTML
48
star
21

pdp11-js

PDP-11 emulator implemented with JavaScript. UNIX V6 runs on your chrome.
JavaScript
43
star
22

aframe-rain

A-Frame Rainfall effect component
JavaScript
41
star
23

aframe-outline

Two-pass Outline effect component for A-Frame
JavaScript
34
star
24

aframe-instancing

A-Frame instancing component
JavaScript
24
star
25

EXT_skeleton_humanoid

21
star
26

THREE.Math-WASM

Three.js Math library in WASM
JavaScript
20
star
27

aframe-webrtc

A-Frame WebRTC component
JavaScript
17
star
28

takahirox.github.io

JavaScript
16
star
29

glTF-Blender-IO-MSFT-lod

Python
16
star
30

glTF-Transform-lod-script

JavaScript
15
star
31

aframe-deferred-renderer

A-Frame Deferred Renderer component
JavaScript
15
star
32

THREE.ZipLoader

Zip archived model file Loading helper for Three.js
JavaScript
14
star
33

THREE.TextureUploader

Experimental Less-blocking Texture uploader for Three.js
10
star
34

EXT_texture_video

8
star
35

nes-rust-ecsy

NES emulator + ECSY + Webpack bundle
JavaScript
7
star
36

KHR_lights_shadows

glTF exntension to specify which nodes can cast or receive shadows
6
star
37

EXT_copyrights

glTF copyrights extension
5
star
38

AsyncGLTFLoader

JavaScript
5
star
39

binary-viewer

Easy online binary dump tool.
HTML
5
star
40

Basis-Texture-Viewer

JavaScript
4
star
41

Vulkan-glTF-viewer-trial

C++
4
star
42

WebWorkers-benchmark

HTML
4
star
43

Hubs-glTF-Test-Models

3
star
44

WebAssemblyThread-benchmark

JavaScript
3
star
45

vr-tours

3
star
46

WebGL-CPU-Profiler-Extension

WebExtension profiling CPU elapsed time for WebGL
JavaScript
3
star
47

web_ai_chat

AI chat with on-device and in-browser inference
TypeScript
3
star
48

EXT_mesh_lod

2
star
49

charset-encoder-js

Simple charset encoder with JavaScript
JavaScript
2
star
50

KHR_parallel_shader_compile_test

GLSL
2
star
51

YouTube-Auto-Ad-Skipper

JavaScript
2
star
52

custom-shader

2
star
53

license-info-js

JavaScript
2
star
54

js-arguments-test

HTML
2
star
55

rust-tiny-os

Rust
2
star
56

libsquish-js

JavaScript libsquish compiled with emscripten
C++
2
star
57

EXT_text

glTF text extension
2
star
58

whisper-web-extension

JavaScript
2
star
59

ios-webaudio-test

JavaScript
1
star
60

ios-video-test

Test purpose
HTML
1
star
61

MyPersonalTodos

1
star
62

texImage2D-gl-test

HTML
1
star
63

SIMDJS-benchmark

HTML
1
star
64

pannernode-test

HTML
1
star
65

MOZ_lightmap

1
star
66

system_trade

Easy algorithmic trading tool on Lubuntu for myself.
Shell
1
star