Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alaingalvan/webgpu-seed

πŸ”ΊπŸŒ± An example on how to render a hello triangle with WebGPU.
https://github.com/alaingalvan/webgpu-seed

definitions dts types typescript typescript-definitions typings webgpu

Last synced: 20 days ago
JSON representation

πŸ”ΊπŸŒ± An example on how to render a hello triangle with WebGPU.

Awesome Lists containing this project

README

        

![Cover Art](https://alain.xyz/blog/raw-webgpu/assets/cover.jpg)

# πŸ”Ί WebGPU Seed

[![License][license-img]][license-url]
[![Unit Tests][travis-img]][travis-url]

A WebGPU repo you can use to get started with your own renderer.

- [πŸ”³ Codepen Example](https://codepen.io/alaingalvan/pen/GRgvLGw)

- [πŸ’¬ Blog Post](https://alain.xyz/blog/raw-webgpu)

## Setup

First install:

- [Git](https://git-scm.com/)

- [Node.js](https://nodejs.org/en/)

- A Text Editor such as [Visual Studio Code](https://code.visualstudio.com/).

Then type the following in any terminal your such as [VS Code's Integrated Terminal](https://code.visualstudio.com/docs/editor/integrated-terminal).

```bash
# πŸ‘ Clone the repo
git clone https://github.com/alaingalvan/webgpu-seed

# πŸ’Ώ go inside the folder
cd webgpu-seed

# πŸ”¨ Start installing dependencies, building, and running at localhost:8080
npm start
```

> Refer to [this blog post on designing web libraries and apps](https://alain.xyz/blog/designing-a-web-app) for more details on Node.js, packages, etc.

## Project Layout

As your project becomes more complex, you'll want to separate files and organize your application to something more akin to a game or renderer, check out this post on [game engine architecture](https://alain.xyz/blog/game-engine-architecture) and this one on [real time renderer architecture](https://alain.xyz/blog/realtime-renderer-architectures) for more details.

```bash
β”œβ”€ πŸ“‚ node_modules/ # πŸ‘Ά Dependencies
β”‚ β”œβ”€ πŸ“ gl-matrix # βž• Linear Algebra
β”‚ └─ πŸ“ ... # πŸ•š Other Dependencies (TypeScript, Webpack, etc.)
β”œβ”€ πŸ“‚ src/ # 🌟 Source Files
β”‚ β”œβ”€ πŸ“„ index.html # πŸ“‡ Main HTML file
β”‚ └─ πŸ“„ renderer.ts # πŸ”Ί Triangle Renderer
β”œβ”€ πŸ“„ .gitignore # πŸ‘οΈ Ignore certain files in git repo
β”œβ”€ πŸ“„ package.json # πŸ“¦ Node Package File
β”œβ”€ πŸ“„ license.md # βš–οΈ Your License (Unlicense)
└─ πŸ“ƒreadme.md # πŸ“– Read Me!
```

[license-img]: https://img.shields.io/:license-unlicense-blue.svg?style=flat-square
[license-url]: https://unlicense.org/
[travis-img]: https://img.shields.io/travis/com/alaingalvan/webgpu-seed.svg?style=flat-square
[travis-url]:https://www.travis-ci.com/github/alaingalvan/webgpu-seed