Skip to content

threedalpeng/dalpeng

Repository files navigation

dalpeng

Web Game Engine with simple composable scripting API

About dalpeng

Basic 3D Objects Demo

Supporting Features

Now on development, supporting below features:

  • Basic 3D objects
  • Directional and point lights
  • PBR Material, with basic properties(base color, metallic, roughness, emissive)
  • Composable scripting API, inspired by modern web frameworks(React, Vue...)

Getting Started

The latest version of node and npm should be installed in your environment.

Install the packages

npm i dalpeng

Or install the core part without a scripting API

npm i @dalpeng/core

Usage

You can define App, Scene, and GameEntity with function form.

defineGameEntity(() => {
  withName("Box");

  const transform = useComponent(Transform);
  transform.position = vec3(0, 0, 0);

  const renderer = useBox();
  renderer.material.baseColor = vec3(0, 1, 1);
  renderer.material.metallic = 0.2;
  renderer.material.roughness = 0.4;
});

You can group or preconfigure components with composable scripting API.

const useBox = () => {
  const renderer = useComponent(MeshRenderer);
  renderer.mesh = MeshBuilder.box();
  return renderer;
};

Check out demo for details.

How to run demo

The latest version of node and pnpm should be installed in your environment.

  1. Clone this repository.

    git clone https://github.com/threedalpeng/dalpeng
  2. Install the packages

    pnpm i
  3. Prebuild internal packages using turbo

    pnpm turbo build
  4. Run the demo you want

    cd demo/basic-3d-objects
    pnpm run dev

About subpackages

  • dalpeng: Scripting API wrapper of @dalpeng/core.
  • @dalpeng/core: Core part of this game engine.
  • @dalpeng/math: Supporting math for 3D Graphics, including Vector, Matrix and Quaternion.

License

Acknowledgement

I learned computer graphics and was inspired by many amazing materials:

and several more...

I presented to other students what I learned and experienced through this project. Check out here(Only in Korean/한국어) and click the '게임엔진을 만들어보자!' tab if you're interested.

About

A Web Game Engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published