Skip to content

Instantly share code, notes, and snippets.

@slimbuck
slimbuck / webgpu_metal_capture.txt
Created May 13, 2024 08:47
Capturing WebGPU metal trace on MacOS
1) Clone and build WebKit
git clone https://github.com/WebKit/WebKit.git WebKit
cd WebKit
Tools/Scripts/build-webkit -cmakeargs="-DENABLE_WEBGPU_BY_DEFAULT=1" --debug
2) Run your app
__XPC_METAL_CAPTURE_ENABLED=1 Tools/Scripts/run-minibrowser --debug --url http://localhost:5000/index.html#/loaders/gsplat

Rendering High-Resolution Meridian Outputs

Meridian is a generative art project deployed on Ethereum, and distributed as unique, artist-signed tokens. This creates an interesting scenario where the value and acquisition of the art project is not tied to the scarcity of access to its media (such as high-resolution PNGs and fine art prints of the algorithm's output). And so, I've created some tools to help all audiences—whether collectors of the tokens or not—export high-resolution outputs of a given Meridian for personal and non-commercial means. For example: fine art printing to hang a Meridian on your walls, or using it as a social media avatar or banner, or including it in a blog post.

First, open the following page and scroll to the interactive component, showing the Meridian software: https://meridian.mattdesl.com/

In that page, open your DevTools Console in the browser, in Chrome it is under View > Developer > JavaScript Console. Each time you click the artwork, it

@raysan5
raysan5 / custom_game_engines_small_study.md
Last active July 10, 2025 04:43
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

WARNING: Article moved to separate repo to allow users contributions: https://github.com/raysan5/custom_game_engines

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like [Unreal](https:

@AlvarBer
AlvarBer / Toon Lit.shader
Last active June 1, 2025 18:30
Toon lit & unlit "uber" shader
// TODO: Do fresnel the ronja way
Shader "HCF/3D/Toon Lit" {
Properties {
_MainTex("Albedo (RGB)", 2D) = "white" {}
_Tint("Tint", Color) = (1, 1, 1, 1)
[Header(Lighting)]
[Toggle]
_UseRampText("Use Ramp Texture", Float) = 0
[NoScaleOffset]
_RampTex("Ramp Texture (Greyscale)", 2D) = "white" {}
@sketchpunk
sketchpunk / quaternion.glsl
Created September 3, 2018 14:31
Quaternion Vector Rotation in GLSL
vec3 vecQuatRotation(vec4 q, vec3 v){
return v + cross(2.0 * q.xyz, cross(q.xyz, v) + q.w * v);
}
@sketchpunk
sketchpunk / catenary.js
Last active January 19, 2023 06:26
Catenary Curve for 2D / 3D in Javascript
// How to increment using the slope and offset comes from tasaboia's example but did not have a solution for A
// But found a way to calc for A from a ruby Wire Tool plugin, but it's incrementing did not work as well as tasaboia
// So mixing the two results in a good implementation of the Catenary Curve. All Credit belongs to those two developers.
// All I did is mash the code together and fixed / optimized it - SketchpunkLabs
// https://github.com/tasaboia/Procedural-Rope-Generator/blob/master/Assets/CatenaryTeste/Scripts/Catenary.cs
// http://rhin.crai.archi.fr/rld/plugin_details.php?id=990
function catenary(a, x){ return a * Math.cosh( x / a ); }
catenary.MAX_TRIES = 100;
catenary.getA = function(vecLen, maxLen){
@meshula
meshula / 3d-formats.md
Last active March 30, 2022 18:45
3d file formats, last mile vs. interchange
@mattdesl
mattdesl / point-to-line-2d.js
Created March 22, 2018 00:36
2D Point to Line Segment distance function
// Taken From:
// https://stackoverflow.com/questions/849211/shortest-distance-between-a-point-and-a-line-segment
function sqr (x) {
return x * x;
}
function dist2 (v, w) {
return sqr(v[0] - w[0]) + sqr(v[1] - w[1]);
}

texture loading

A utility for loading texture in ThreeJS. Will upload to GPU as soon as the texture is loaded, ensuring that it won't cause jank later in your application.

Example:

const loadTexture = require('./loadTexture');

// Returns a THREE.Texture object