A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.
| Name | Stars | Last Commit | Description |
|---|---|---|---|
| three.js | ![GitHub |
A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.
| Name | Stars | Last Commit | Description |
|---|---|---|---|
| three.js | ![GitHub |
| #!/usr/bin/env node | |
| var fs = require('fs'); | |
| var http = require('http'); | |
| var path = require('path'); | |
| var rollup = require('rollup'); | |
| var rollupConfig = require('../rollup.config'); | |
| var CONTENT_TYPES = { | |
| '.html': 'text/html', |
| /* makes sizing simpler */ | |
| *, | |
| *::before, | |
| *::after { | |
| box-sizing: border-box; | |
| } | |
| /* remove default spacing */ | |
| /* force styling of type through styling, rather than elements */ |
| import imagemin from 'imagemin'; | |
| import imageminWebp from 'imagemin-webp'; | |
| import imageminPngquant from 'imagemin-pngquant'; | |
| const produceWebP = async () => { | |
| const outputFolder = './images/webp'; | |
| await imagemin(['images/*.png'], { | |
| destination: outputFolder, | |
| plugins: [ |
| function isTranferable(obj) { | |
| try { | |
| return ( | |
| obj instanceof ArrayBuffer || | |
| obj instanceof MessagePort || | |
| obj instanceof ImageBitmap || // safari 15+ ios 15+ | |
| obj instanceof OffscreenCanvas // safari 16.4+ ios 16.4+ | |
| ); | |
| } catch { | |
| return false; |
| const isFn = (a) => typeof a === 'function'; | |
| export function addObjectPool(objtype, resetFunction, maxSize = Number.MAX_SAFE_INTEGER) { | |
| const pool = []; | |
| function newObject() { | |
| return new objtype(); | |
| } | |
| if (isFn(resetFunction)) { |
| const isRunningInBrowser = typeof window !== 'undefined'; | |
| function runWhenBrowserEnvReady(fn) { | |
| if (isRunningInBrowser) { | |
| const doc = document; | |
| doc.readyState[0] === 'l' ? doc.addEventListener('DOMContentLoaded', fn) : fn(); | |
| } else { | |
| fn(); | |
| } | |
| } |
| /* | |
| * Based on example code by Stefan Gustavson ([email protected]). | |
| * Optimisations by Peter Eastman ([email protected]). | |
| * Better rank ordering method by Stefan Gustavson in 2012. | |
| * | |
| * This code was placed in the public domain by its original author, | |
| * Stefan Gustavson. You may use it as you see fit, but | |
| * attribution is appreciated. | |
| */ |
| // returns a number with the fractional part of the given number | |
| function fract(num) { | |
| return num - Math.floor(num); | |
| } | |
| // hash2d - not repeatable or stable between platforms | |
| function hash2d(x, y) { | |
| return fract(43758.5453 * Math.sin(x * 78.233 - 12.9898 * y)); | |
| } | |
| function Semaphore() { | |
| // controllable promise | |
| let _resolve; | |
| let _reject; | |
| const promiseSemaphore = new Promise((resolve, reject) => { | |
| _resolve = resolve; | |
| _reject = reject; | |
| }); |