Skip to content

Instantly share code, notes, and snippets.

@sirisian
sirisian / occupancytree256.html
Created June 29, 2026 23:22
Occupancy Tree Example (Claude Opus 4.8)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>WebGPU · per-pixel nested 4³ 3D-DDA volume</title>
<style>
:root{
--bg:#0a0c10;--panel:#12151c;--panel2:#161a23;--line:#1e2430;--line2:#2a3242;
--ink:#e9eef6;--mut:#8b95a7;--faint:#5b6473;--acc:#38bdf8;--acc2:#f0a830;--ray:#ff3d71;
@sirisian
sirisian / painterlyshader.html
Last active June 8, 2026 19:01
Painterly shader (Claude 4.8 Max assisted)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<title>Painterly Cube — WebGPU (Phases 0–2)</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap" rel="stylesheet" />
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Value Noise</title>
<script type="text/javascript">
// Canvas
var canvas = null;
var context2D = null;
var tiledcanvas = null;
@sirisian
sirisian / 1-negate.js
Last active February 13, 2026 20:41
negate and subset check for JSON Schema 2020-12
/**
* JSON Schema 2020-12 Negation Implementation
* Computes ¬(schema) for any JSON schema
*/
const TYPE_SPECIFIC_KEYWORDS = {
string: new Set(['minLength', 'maxLength', 'pattern', 'format', 'contentEncoding', 'contentMediaType']),
number: new Set(['minimum', 'maximum', 'exclusiveMinimum', 'exclusiveMaximum', 'multipleOf']),
integer: new Set(['minimum', 'maximum', 'exclusiveMinimum', 'exclusiveMaximum', 'multipleOf']),
boolean: new Set([]),
@sirisian
sirisian / Vector234.js
Created April 24, 2025 23:41
roguelike map gen
"use strict";
class Vector2
{
constructor(x = 0, y = 0)
{
this.x = x;
this.y = y;
}
Add(v)
@sirisian
sirisian / uiinput.interface.ts
Created March 18, 2025 18:31
input web component interface
type Option<T> = {
label: string;
value: T;
}
type Options<T> =
| Record<string, T>
| Option<T>[]
| (() => Option<T>[]);
@sirisian
sirisian / webworker.js
Created January 26, 2023 06:08
web worker examples
async function SingleWorkerExample(data, param1, param2) {
return new Promise(resolve => {
const blobURL = URL.createObjectURL(new Blob(['(', function() {
onmessage = e => {
const { data, param1, param2 } = e.data;
// Do work with data which is a SharedArrayBuffer
postMessage('done');
};
}.toString(), ')()'], { type: 'application/javascript' }));
const worker = new Worker(blobURL);
@sirisian
sirisian / Shaders.hlsl
Created June 9, 2022 07:25
part of a box model shader system
cbuffer worldMatrix : register(b0)
{
matrix worldmat;
};
cbuffer viewMatrix : register(b1)
{
matrix viewmat;
};
@sirisian
sirisian / IntersectionFunctions.hpp
Created March 14, 2020 02:21
IntersectionFunctions.hpp
#pragma once
#include <vector>
#include <cmath>
#include "Vector2.hpp"
namespace IntersectionFunctions
{
struct IntersectionObject
@sirisian
sirisian / FreeList.cs
Created March 4, 2020 06:08
C# FreeList
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FreeListClass
{
public class FreeList<T>
{
private class FreeListItem<T>