Giter Site home page Giter Site logo

monfera / webgpu-wgsl-hello-triangle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from morzel85/webgpu-wgsl-hello-triangle

0.0 0.0 0.0 11 KB

An example of how to render a triangle with WebGPU using WebGPU Shading Language - the "Hello world!" of computer graphics.

License: MIT License

JavaScript 69.88% HTML 30.12%

webgpu-wgsl-hello-triangle's Introduction

WebGPU/WGSL Hello Triangle!

An example of how to render a triangle with WebGPU using WebGPU Shading Language - the "Hello World!" of computer graphics. Details in blog post: https://en.morzel.net/post/webgpu-wgsl-hello-triangle

What it does?

If your browser supports WebGPU and WGSL, you should be able to see a gray square with a green triangle in the center. And that's it.

Live example: https://morzel85.github.io/webgpu-wgsl-hello-triangle/index.html

WebGPU and WGSL are work in progress!

Please mind that WebGPU and WGSL specs are not finalized and implementations are changing! Visit webgpu.io to check current status.

Keep it simple!

WebGPU is a low-level API so its “Hello World!” can’t be a one-liner, nevertheless this repo is meant to be as simple as possible. Just two files: one for HTML and one for JavaScript - no Node.js, Weback etc.

Is it possible to simplify the code further? Teach me how! :)

Test results (2021-03-25)

  • Renders properly and without warnings in Chrome Canary v91.0.4457.2 x64 Win 10 with --enable-unsafe-webgpu flag set.

Credits

Code is based on https://github.com/austinEng/webgpu-samples

webgpu-wgsl-hello-triangle's People

Contributors

morzel85 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.