This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as THREE from 'three' | |
| import vertexShader from './shaders/vertex-shader.glsl' | |
| import fragmentShader from './shaders/generator-shader.glsl' | |
| export class WorleyNoiseAtlas extends THREE.Data3DTexture { | |
| constructor(renderer) { | |
| const camera = new THREE.OrthographicCamera() | |
| const geometry = new THREE.BufferGeometry() | |
| geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array([-1, -1, 3, -1, -1, 3]), 2)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CameraControls { | |
| foo = { bar: true } | |
| constructor(...args) { | |
| console.log('impl construct', [...args]) | |
| } | |
| dispose() { | |
| console.log('impl disposed', this) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data:text/html,%3Cstyle%3E*%7Bmargin%3A0%3Bwidth%3A100%25%3Bheight%3A100%25%3Boverflow%3Ahidden%3B%7D%3C%2Fstyle%3E%3Cscript%20type%3Dmodule%3Econst%20n%3Ddocument.body.appendChild(document.createElement(%22canvas%22))%2Ce%3Dn.getContext(%22webgl2%22)%2Cc%3De.createShader(e.VERTEX_SHADER)%3Be.shaderSource(c%2C%22%23version%20300%20es%5Cnout%20vec2%20a%3Bconst%20vec2%20b%5B3%5D%3Dvec2%5B%5D(vec2(-1)%2Cvec2(3%2C-1)%2Cvec2(-1%2C3))%3Bconst%20vec2%20c%5B3%5D%3Dvec2%5B%5D(vec2(0)%2Cvec2(2%2C0)%2Cvec2(0%2C2))%3Bvoid%20main()%7Bgl_Position%3Dvec4(b%5Bgl_VertexID%5D%2C0%2C1)%3Ba%3Dc%5Bgl_VertexID%5D%3B%7D%22)%3Be.compileShader(c)%3Bconst%20r%3De.createShader(e.FRAGMENT_SHADER)%3Be.shaderSource(r%2C%22%23version%20300%20es%5Cnprecision%20lowp%20float%3Buniform%20float%20d%3Bin%20vec2%20a%3Bout%20vec4%20e%3Bvoid%20main()%7Be%3Dvec4(.3%2C.2%2C.5%2C1)%3Be.rgb%2B%3D.5%2B.3*cos(a.xyx%2Bd)%3B%7D%22)%3Be.compileShader(r)%3Bconst%20o%3De.createProgram()%3Be.attachShader(o%2Cc)%3Be.attachShader(o%2Cr)%3Be.linkProgram(o)%3Be.us |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://twitter.com/Cody_J_Bennett/status/1633002580635799553 | |
| import * as React from 'react' | |
| import Reconciler from 'react-reconciler' | |
| import { DefaultEventPriority, ConcurrentRoot } from 'react-reconciler/constants.js' | |
| function toString(styles) { | |
| if (typeof styles === 'string') return styles | |
| else if (styles === null || typeof styles !== 'object') return | |
| let string = '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function createWorker(fn: Function): Worker { | |
| const blob = new Blob([`(${fn})()`], { type: 'application/javascript' }) | |
| const uri = URL.createObjectURL(blob) | |
| return new Worker(uri) | |
| } | |
| const worker = createWorker(() => { | |
| function clientWaitAsync( | |
| gl: WebGL2RenderingContext, | |
| sync: WebGLSync, |
OlderNewer