Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

🌐🌱 A starter repo for building WebGL applications.
https://github.com/alaingalvan/webgl-seed

graphics introduction seed webgl

Last synced: 2 months ago
JSON representation

🌐🌱 A starter repo for building WebGL applications.

Awesome Lists containing this project

README

        

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

# WebGL Seed

[![License][license-img]][license-url]
[![Unit Tests][travis-img]][travis-url]
[![Dependency Status][david-img]][david-url]
[![devDependency Status][david-dev-img]][david-dev-url]

A simple hello triangle example you could use to as a basis when starting WebGL.

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

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

## 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/webgl-seed

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

# πŸ”¨ Start building the project
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
β”‚ β”œβ”€ πŸ“„ renderer.ts # πŸ”Ί Triangle Renderer
β”‚ └─ πŸ“„ main.ts # 🏁 Application Main
β”œβ”€ πŸ“„ .gitignore # πŸ‘οΈ Ignore certain files in git repo
β”œβ”€ πŸ“„ package.json # πŸ“¦ Node Package File
β”œβ”€ πŸ“„ license.md # βš–οΈ Your License (Unlicense)
└─ πŸ“ƒreadme.md # πŸ“– Read Me!
```

Some key dependencies are:

- [gl-matrix](http://glmatrix.net/) - WebGL's best linear algebra library, perfect for people used to linear algebra libraries like [GLM](https://glm.g-truc.net/0.9.9/index.html) or the built in GLSL data structures.

- [Webpack](https://webpack.js.org/) - Compiles our TypeScript files and creates binaries for us to use.

- [TypeScript](https://github.com/microsoft/typescript) - JavaScript with types, makes it significantly easier to program web apps with instant autocomplete and type checking.

[license-img]: https://img.shields.io/:license-unlicense-blue.svg?style=flat-square
[license-url]: https://unlicense.org/
[david-url]: https://david-dm.org/alaingalvan/webgl-seed
[david-img]: https://david-dm.org/alaingalvan/webgl-seed/status.svg?style=flat-square
[david-dev-url]: https://david-dm.org/alaingalvan/webgl-seed#info=devDependencies
[david-dev-img]: https://david-dm.org/alaingalvan/webgl-seed/dev-status.svg?style=flat-square
[travis-img]: https://img.shields.io/travis/com/alaingalvan/webgl-seed.svg?style=flat-square
[travis-url]:https://www.travis-ci.com/github/alaingalvan/webgl-seed