Skip to content

Instantly share code, notes, and snippets.

View meshula's full-sized avatar
💭
Exploring liminal spaces

Nick Porcino meshula

💭
Exploring liminal spaces
View GitHub Profile
@meshula
meshula / test-nanoexrinfo.zig
Created March 15, 2023 02:04
test-nanoexroinfo.zig
const std = @import("std");
const Queue = std.mpmc.MPMCQueue;
const sync = std.sync;
const Allocator = std.heap.ArenaAllocator;
const io = std.io;
const os = std.os;
const MAX_TASKS = 100;
pub fn ThreadPool(allocator: *Allocator, num_threads: usize) anyerror!void {
@meshula
meshula / test-nanoexrinfo.rs
Created March 15, 2023 02:02
test-nanoexrinfo.rs
use std::env;
use std::path::PathBuf;
use crossbeam_channel::{Receiver, Sender};
use std::sync::{Arc, Mutex};
use std::thread;
pub struct ThreadPool {
sender: Sender<Box<dyn FnOnce() + Send + 'static>>,
}
@meshula
meshula / test_nanoexrinfo.cpp
Last active March 15, 2023 01:44
thread pool to test exr utilities
#include <algorithm>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <filesystem>
#include <fstream>
#include <functional>
#include <future>
#include <iostream>
#include <mutex>
@meshula
meshula / aswf-notes.md
Created March 10, 2023 17:33
aswf-notes.md

Windows tooling

Windows c/c++ tooling (in general) causes unnecessary pain, from dllimport/export to debug vs release crt we can establish expected practices eg aswf projects have a common pattern on how to do the adornment we can try to engage microsoft i understand they won't listen or respond in general we can explore solutions. We could bypass the CRT entirely by investigating a move to musl. There are many possibilities.

build systems

build systems as commonly practiced are slow

@meshula
meshula / osd-spec.md
Last active February 14, 2023 23:08
osd-spec.md

property

face count, integer

the number of faces in a mesh

property

face topology, array of 8 bit unsigned integers

each entry at index i corresponds to face i the value of the entry is the arity of the face; i.e. a triangle is 3 and a quad is 4

@meshula
meshula / OSKit.swift
Created January 30, 2023 20:14 — forked from nicklockwood/OSKit.swift
A lightweight approach to writing cross-platform code in SwiftUI without a lot of conditional compilation blocks
import SwiftUI
enum OSDocumentError: Error {
case unknownFileFormat
}
#if canImport(UIKit)
import UIKit
@meshula
meshula / usd-windows-2023.md
Last active January 9, 2023 20:22
usd-windows-2023.md
  • install Windows Terminal from Windows Store
  • install WSL with Ubuntu 22.04 lTS
  • start ubuntu terminal
  • sudo apt install git
  • set git to globally suppress auto-crlf, and also set your name and email address in the config
  • create a new SSH key
  • start ssh-agent
  • install visual studio 2022
  • start windows cmd terminal
  • type where python to find the monumentally inconvenient python helper
@meshula
meshula / minimal-exr.c
Created January 5, 2023 02:59
minimal-exr.c
#include "OpenEXRCore/attributes.c"
#include "OpenEXRCore/base.c"
#include "OpenEXRCore/channel_list.c"
#include "OpenEXRCore/chunk.c"
#include "OpenEXRCore/coding.c"
#include "OpenEXRCore/context.c"
#include "OpenEXRCore/debug.c"
#include "OpenEXRCore/decoding.c"
#include "OpenEXRCore/encoding.c"
@meshula
meshula / mdlmesh_normalize.swift
Created September 10, 2022 20:56
normalize an MDLMesh by using MetalKit
class PBRMesh {
var mtkMesh : MTKMesh?
var submeshes = [PBRSubmesh?]()
// create an array with 3 entries initialized to nil
// swift doesn't have fixed size object arrays
var pipeline = [PBRModel_Pipeline?](repeating: nil, count: 3)
@meshula
meshula / threetimes.md
Created September 6, 2022 17:49
threetimes.md

You need to build a system three times

  • the first time you don't know what you actually need, it's an exploration, plan to throw it away
  • the second time you think you know what you need so you over-architect, it'll be too restrictive, plan to throw it away
  • the third time you build what actually works

I like to think I came up with it at LucasArts twenty years ago, but at this point I don't know if it was generally in the zeitgeist.