toji / one-triangle-web

Rendering one triangle, the WebGL/WebGPU way

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

One Triangle, Web graphics APIs edition

This repo contains two files that each contain all of the code to render a single triangle with the web graphics API in question, WebGL or WebGPU. It's meant to serve as a simple (and certainly not comprehensive) comparison between the two APIs and their styles.

Neither example is commented in detail, contains error handling, or should be seen as demonstrating best practices. Additionally, there are ways to reduce the overall code length (such as not using a vertex buffer with WebGPU). Clarity and simplicity is favored over anything particularly clever.

About

Rendering one triangle, the WebGL/WebGPU way


Languages

Language:HTML 100.0%