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
const gl = canvas.getContext('webgl2', { | |
alpha: false, | |
depth: false, | |
antialias: false | |
}); | |
const glVariable0 = gl.createProgram(); | |
const glVariable1 = gl.createShader(gl.VERTEX_SHADER); | |
gl.shaderSource(glVariable1, `attribute vec4 vPosition; | |
attribute vec2 texCoord0; | |
varying vec2 texCoord; |
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
let chunkSize = 15; | |
let inputWidth = 25; | |
let image.dims = { | |
w: 1920, | |
h: 1080 | |
} | |
const myFunc = gpu.createKernel( | |
function(imageTexture, offsetY, offsetX) { | |
return imageTexture[this.thread.y + offsetY][this.thread.x + offsetX]; |
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
const gl = canvas.getContext('webgl2', { | |
alpha: false, | |
depth: false, | |
antialias: false | |
}); | |
const glVariable0 = gl.getParameter(gl.RENDERER); | |
const glVariables1 = gl.getExtension('EXT_color_buffer_float'); | |
const glVariables2 = gl.getExtension('OES_texture_float_linear'); | |
const glVariables3 = gl.getExtension('EXT_color_buffer_float'); | |
gl.enable(gl.SCISSOR_TEST); |
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
const { GPU } = require('gpu.js'); | |
const gpu = new GPU(); | |
gpu.addFunction(function hash3D(x, y, z) { | |
const ix = (Math.floor(x/this.output.x)) + 1e5, | |
iy = (Math.floor(y/this.output.x)) + 1e5, | |
iz = (Math.floor(z/this.output.x)) + 1e5; | |
return ((ix * 10223) + (iy * 12919) + (iz * 16127)) % 1e6; | |
}); |
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
/** | |
* A highly readable very forgiving micro-parser for a glsl function that gets argument types | |
* @param {String} source | |
* @returns {{types: String[], names: String[]}} | |
*/ | |
function parseGLSLArgumentTypes(source) { | |
const types = []; | |
const names = []; | |
const states = []; | |
const isStartingVariableName = /^[a-zA-Z_]/; |
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
<html> | |
<head></head> | |
<body> | |
<canvas></canvas> | |
<script> | |
var canvas = document.querySelector('canvas'); | |
var gl = canvas.getContext('webgl'); | |
const extension0 = gl.getExtension("WEBGL_draw_buffers"); | |
gl.getSupportedExtensions(); | |
gl.getError(); |
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
<html> | |
<head></head> | |
<body> | |
<canvas></canvas> | |
<script> | |
var canvas = document.querySelector('canvas'); | |
var gl = canvas.getContext('webgl'); | |
const extension0 = gl.getExtension("WEBGL_draw_buffers"); | |
gl.getSupportedExtensions(); | |
gl.getError(); |
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
const gl = require("./index")(64, 64); | |
const extension0 = gl.getExtension("WEBGL_draw_buffers"); | |
gl.getSupportedExtensions(); | |
gl.getError(); | |
gl.getParameter(extension0.MAX_COLOR_ATTACHMENTS_WEBGL); | |
gl.getError(); | |
gl.getError(); | |
gl.getParameter(extension0.MAX_DRAW_BUFFERS_WEBGL); | |
gl.getError(); | |
gl.getParameter(extension0.MAX_COLOR_ATTACHMENTS_WEBGL); |
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
/*eslint-disable */ | |
var _windowShim = require("../lib/shims/window-shim"); | |
var _documentShim = require("../lib/shims/document-shim"); | |
var _canvasShim = require("../lib/shims/canvas-shim"); | |
var _imageShim = require("../lib/shims/image-shim"); | |
var _rafShim = require("../lib/shims/raf-shim"); | |
var _RESOURCES = require("./resources.json"); | |
function extensions_webgl_draw_buffers(ENVIRONMENT) { | |
var HTMLElement = function() {}; |
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
static GLubyte* toPixels(int width, int height) { | |
GLubyte bytes[width * height * 4]; | |
(reinterpret_cast<PFNGLREADPIXELSPROC>(eglGetProcAddress("glReadPixels")))(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bytes); | |
std::ofstream file; | |
file.open("test-google-angle.ppm"); | |
file << "P3\n"; | |
file << "# gl.ppm\n"; | |
file << width; | |
file << " "; |