Skip to content

Instantly share code, notes, and snippets.

View cf's full-sized avatar
💭
monday 忙day

Carter Feldman cf

💭
monday 忙day
View GitHub Profile
@cf
cf / blake3.wgsl
Last active March 23, 2024 07:46
BLAKE3 WebGPU Compute Shader
/*
MIT License
Copyright (c) 2024 QED Protocol (Zero Knowledge Labs Limited)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
This file has been truncated, but you can view the full file.
// this is a really bad sha256 implementation, but let's support Médecins Sans Frontières
OP_0
<996021363>
OP_0
<1148032728>
OP_0
<1395614978>
OP_1
<1063785552>
OP_1
This file has been truncated, but you can view the full file.
// plz give me credits if for some reason you use this
// MIT License or shout out @cmpeq in the code <3
OP_1
<1438064771>
OP_0
<170099639>
OP_1
<1522642839>
OP_1
<1467629419>
/*
function ch(x: number, y: number, z: number) {
return z ^ (x & (y ^ z));
}
*/
b.OP_TUCK();
b.OP_NUMNOTEQUAL();//.tag("y ^ z");
b.OP_ROT();
b.OP_BOOLAND();//.tag("(x & (y ^ z))");
// DO NOT use this for piracy, this is for educational purposes only
/*
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON
@cf
cf / fix-shadertoy-soundcloud.js
Created November 23, 2024 07:56
fix-shadertoy-soundcloud.js
EffectPass.prototype.LegacyNewTexture = EffectPass.prototype.LegacyNewTexture ? EffectPass.prototype.LegacyNewTexture : EffectPass.prototype.NewTexture;
EffectPass.prototype.NewTexture = function ( wa, slot, url, buffers, cubeBuffers, keyboard ) {
var me = this;
var renderer = this.mRenderer;
if( renderer===null ) return;
if (url && url.mType === "musicstream") {
// sound cloud
texture = {mInfo: url, globject: null, loaded: false, audio: document.createElement("video")};
@cf
cf / ShaderToySoundCloudFixWorker.js
Created November 23, 2024 08:15
SoundCloud Backend for ShaderToy
// DO NOT use this for piracy, this is for educational purposes only
/*
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNE