Skip to content

Instantly share code, notes, and snippets.

@humbletim
humbletim / 00_2026.01.02 Perceptual_Physics_PostMortem.md
Last active January 2, 2026 19:45
The Goldilocks Hull Protocol: Defining Deterministic Hydro-LODs for Visceral Interoperability

Perceptual Physics: The Case for Biased Decimation

A Post-Mortem on the "Goldilocks Hull" Protocol and Visceral Interoperability

Status: Archived / Theoretical

Date: January 2, 2026

Author: humbletim (with Gemini)

@humbletim
humbletim / Blender3.2-PrincipledBSDF-to-THREEr160-MeshPhysicalMaterial.md
Created August 21, 2025 18:15
Mapping between the inputs of Blender's Principled BSDF shader node and the properties of Three.js's MeshPhysicalMaterial

Introduction

This document provides a comprehensive mapping between the inputs of Blender's Principled BSDF shader node and the properties of Three.js's MeshPhysicalMaterial. The goal is to define a "universal dialect"—an intermediate, lossless data representation—that can store the full artistic intent from Blender and translate it faithfully for rendering in Three.js.

This mapping considers Blender 3.2 with an eye towards 4.0+ compatibility and targets Three.js r160. It treats physically-based properties as a shared "universal truth" between the two systems, while acknowledging and providing strategies for Blender-specific nuances. It uses the logic of Blender's glTF 2.0 exporter as a reference for specific PBR value translations, but does not adopt its lossy, delivery-oriented structure.

Core Mapping Table

The following table breaks down each relevant Blender property, suggests a key for your universal representation, identifies the corresponding Three.js property, and explains the tr

@humbletim
humbletim / humbletim-ppng-rtc-datachannel.js
Last active June 29, 2025 04:03
ppng.io webrtc data channels snippet
// quick and dirty ppng.io signaling for p2p webrtc data channel -- 2024.09.08 humbletim
// usage -- one side specifies 'left', the other 'right'; both sides specify the same key
// dc = await QuickieDataChannel('left' /* | 'right' */, 'test')
// dc.send('hi');
//
// browser test page: https://gist.githack.com/humbletim/57f42977c939b81b0338b95a71c7a3c6/raw/index.html
async function QuickieDataChannel(side, key) {
const prefix = `https://ppng.io/humbletim-test-${key}`;
const pc = new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]});

background (Scene)

 color

fog (Scene)

 type, color, near, far, density
@humbletim
humbletim / common.js
Last active July 15, 2019 00:59
CustomAPIExample test scripts
// multicontext test script
var script = typeof Script === 'object' ? Script : { type: typeof window === 'object' ? 'browser' : 'unknown' };
var api = typeof KasenAPIExample === 'object' ? KasenAPIExample : {};
var details = {
type: script.type + '',
api: api + '',
now: api.now && api.now() + '',
};
@humbletim
humbletim / basecrm_create_lead.php
Created August 24, 2017 13:58 — forked from bmista/basecrm_create_lead.php
Create a new lead using php 5.3 and Base API v2
<?php
function createLead($accessToken, array $lead)
{
$method = 'post';
$absUrl = 'https://api.getbase.com/v2/leads';
$headers = array(
'User-Agent: BaseCRM/PHP Sample',
'Authorization: Bearer ' . $accessToken,
'Accept: application/json',

Keybase proof

I hereby claim:

  • I am humbletim on github.
  • I am htio (https://keybase.io/htio) on keybase.
  • I have a public key ASAavTyTo5Al-oomVMaBaSnjLSLM0lIQ22LyD-sHkC_17go

To claim this, I am signing this object:

@humbletim
humbletim / test-parented-overlay-children.js
Last active June 24, 2017 00:10
Test Entity / Overlay models with parented children
// test Client script to compare Model Overlay vs. Model Entity behavior for attached child Overlays
// humbletim @ 2017.06.23
var overlayProps = {
url: MyAvatar.skeletonModelURL,
position: Vec3.sum(Quat.getForward(MyAvatar.orientation), MyAvatar.position),
scale: 1,
};
var ids = {
overlays: [
(function(){
var teleport;
var portalDestination;
var animationURL;
var position;
function playSound(entityID) {
print("playing teleport sound");
if (teleport.downloaded) {
if(!position) {
@humbletim
humbletim / testEntityResourceLeaks-entity.js
Last active March 15, 2017 00:02
Entity unload resource leaks
(function() {
var TROMBONE_URL = "https://s3.amazonaws.com/hifi-public/tony/audio/sad-trombone.wav";
return {
_resource: SoundCache.prefetch(TROMBONE_URL),
_sound: undefined,
_onStateChanged: function() {
var resource = this._resource;
if (resource.state === Resource.State.FINISHED) {
resource.stateChanged.disconnect(this, '_onStateChanged');
this._sound = SoundCache.getSound(TROMBONE_URL);