Skip to content

Instantly share code, notes, and snippets.

View mrbid's full-sized avatar

James William Fletcher mrbid

View GitHub Profile
@mrbid
mrbid / mrbid-itch-mirror.md
Last active April 8, 2024 00:30
[Itch.io Mirror] Share your favourite sources of free 3D content for games.
@mrbid
mrbid / text-to-3d_manual_setup.txt
Last active March 13, 2024 03:09
manually configuring a text-to-3d pipeline
Zero123plus (https://github.com/SUDO-AI-3D/zero123plus) output views are a fixed set of camera poses:
Azimuth (relative to input view): 30, 90, 150, 210, 270, 330.
Elevation (absolute): 30, -20, 30, -20, 30, -20.
To generate the images from Zero123++ it's easier to just use:
https://huggingface.co/spaces/sudo-ai/zero123plus-demo-space
and enable both background removals
StableSAM is usually used to remove backgrounds:
@mrbid
mrbid / esAux6.h
Last active January 23, 2024 09:11
A simple helper library for OpenGL ES / WebGL applications.
/*
--------------------------------------------------
James William Fletcher (github.com/mrbid)
January 2024 - esAux6.h v6.0
--------------------------------------------------
A pretty good color converter: https://www.easyrgb.com/en/convert.php
Lambertian fragment shaders make a difference, but only if you normalise the
vertNorm in the fragment shader. Most of the time you won't notice the difference.
@mrbid
mrbid / ptf2.c
Last active May 16, 2024 18:18
Converts ASCII PLY file to C OpenGL buffers for esAux5.h and above.
/*
James William Fletcher (github.com/mrbid)
October 2022 - December 2023
Converts ASCII PLY (.ply) file to C OpenGL buffers.
This is specifically made for:
esAux5.h: https://gist.github.com/mrbid/34c1b23d292033eefd63cffe8a5a2e96
esAux6.h: https://gist.github.com/mrbid/8563c765116f2dce3d4461adea15fdd1
@mrbid
mrbid / esAux5.h
Last active January 10, 2024 19:05
A simple helper library for OpenGL ES / WebGL applications.
/*
--------------------------------------------------
James William Fletcher (github.com/mrbid)
January 2024 - esAux5.h v5.0
--------------------------------------------------
A pretty good color converter: https://www.easyrgb.com/en/convert.php
Lambertian fragment shaders make a difference, but only if you normalise the
vertNorm in the fragment shader. Most of the time you won't notice the difference.
@mrbid
mrbid / osc.c
Last active March 12, 2024 02:44
Additive Oscillators with Cutoff & Resonance
/*
James William Fletcher (github.com/mrbid)
April 2023
These are oscillators that have Cutoff and Resonance
as a pre/before-fact filter rather than a post/after-fact
filter.
We do this by constructing a Sawtooth or Squarewave from
additive synthesis of sinusoids. This allows us to get
@mrbid
mrbid / esAux4.h
Last active January 10, 2024 14:57
A simple helper library for OpenGL ES / WebGL applications.
/*
--------------------------------------------------
James William Fletcher (github.com/mrbid)
February 2023 - esAux4.h v4.0
--------------------------------------------------
A pretty good color converter: https://www.easyrgb.com/en/convert.php
Lambertian fragment shaders make a difference, but only if you normalise the
vertNorm in the fragment shader. Most of the time you won't notice the difference.
@mrbid
mrbid / rand_bench.c
Last active October 10, 2024 20:30
Favorite random functions and benchmark.
/*
James William Fletcher (github.com/mrbid)
Feb 2023
Bench of my favorite random functions.
Benching like this never reflects real world scenarios,
but it does give you a rough idea of the costs involved.
gcc rand_bench.c -lm -mrdrnd -mrdseed -Ofast -o rand
@mrbid
mrbid / mytanh.c
Last active February 5, 2023 09:15
tanh implementations
// James William Fletcher (github.com/mrbid) (June 2022)
#include <stdio.h>
#include <math.h>
static inline float mycosh(float f)
{
return (powf(2.718281746F, f)*0.5f) + (powf(2.718281746F, -f)*0.5f);
}
static inline float mysinh(float f)
@mrbid
mrbid / neural_unitvector.c
Last active March 1, 2024 18:01
Neural Unit Vector Computation & Benchmarks (just for fun)
// github.com/jcwml
// https://github.com/jcwml/neural_unitvector
// gcc neural_unitvector.c -lm -Ofast -mfma -o main
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdint.h>
#include <time.h>
#include <sys/time.h>
#include <x86intrin.h>