* Author: numtel <ben@latenightsketches.com>
* License: MIT
*/
- // Vertext Shader
+ // Vertex Shader
static #vsSource = `#version 300 es
precision highp float;
layout (location=0) in vec4 position;
// Pixel data is multipled by threshold test result (0 or 1)
// First 4 bytes insignificant, only calculate digest of second 4 bytes
- fragColor = mix(
- fragColor,
- vec4(
- float(x_index + 1u)/255., // +1 to distinguish from 0 (unsuccessful) pixels
- float(y_index + 1u)/255., // Same as previous
- float(x_pos)/255., // Return the 2 custom bytes used in work value
- float(y_pos)/255. // Second custom byte
- ),
- float((BLAKE2B_IV32_1 ^ v[1] ^ v[17]) > threshold)
- );
- //}
+ fragColor = mix(
+ fragColor,
+ vec4(
+ float(x_index + 1u)/255., // +1 to distinguish from 0 (unsuccessful) pixels
+ float(y_index + 1u)/255., // Same as previous
+ float(x_pos)/255., // Return the 2 custom bytes used in work value
+ float(y_pos)/255. // Second custom byte
+ ),
+ float((BLAKE2B_IV32_1 ^ v[1] ^ v[17]) > threshold)
+ );
}`
/** Used to set canvas size. Must be a multiple of 256. */