Skip to content

Instantly share code, notes, and snippets.

View robertleeplummerjr's full-sized avatar

Robert Plummer robertleeplummerjr

View GitHub Profile
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;
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];
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);
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;
});
/**
* 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_]/;
<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();
<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();
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);
/*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() {};
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 << " ";