Skip to content

Instantly share code, notes, and snippets.

@rygorous
rygorous / gist:2144712
Created March 21, 2012 05:20
half->float variants
// half->float variants.
// by Fabian "ryg" Giesen.
//
// I hereby place this code in the public domain.
//
// half_to_float_fast: table based
// tables could be done in a more compact fashion (in particular, can store tab2 in low word of tab1!)
// but something of a dead end since not very SIMD-friendly. pretty much abandoned at this point.
//
// half_to_float_fast2: use FP adder hardware to deal with denormals.
@rygorous
rygorous / gist:2156668
Last active April 16, 2024 11:18
float->half variants
// float->half variants.
// by Fabian "ryg" Giesen.
//
// I hereby place this code in the public domain, as per the terms of the
// CC0 license:
//
// https://creativecommons.org/publicdomain/zero/1.0/
//
// float_to_half_full: This is basically the ISPC stdlib code, except
// I preserve the sign of NaNs (any good reason not to?)
package computer;
// Referenced classes of package computer:
// KeyMapping
public class AWTKeyMapping extends KeyMapping
{
public AWTKeyMapping()
package computer;
// Referenced classes of package computer:
// KeyMapping
public class AWTKeyMapping extends KeyMapping
{
public AWTKeyMapping()
@DanielKeep
DanielKeep / HIT_HMD2043.txt
Created April 26, 2012 03:35
Harold Innovation Technologies - HMD2043 and HMU1440 spec sheets
HIT_HMD2043
__ __
|| ||
||==|| I T
_|| ||_
Harold Innovation Technologies
"If it ain't a HIT, it's a piece of..."
@Entity2D
Entity2D / kulog_k8581.txt
Created April 26, 2012 21:15
Kulog K8581 (DCPU-16 sound chip spec sheet proposal)
KULOG_K8581 (v.1.1)
|| //
||//
||\\
|| \\ULOG HARDWARE TECHNOLOGIES
"Bringing 'fun' back into functionality"
@JackNova
JackNova / JavascriptMonads.js
Created December 19, 2012 18:28
Monads Implementation in javascript, as seen in crockford presentation at yui conf 2012
//BASIC PIECES, 3 functions: unit, bind and the bind argument
//function unit(value)
//function bind(monad, function(value))
//all three functions return a monad
/* The unit function is a constructor (returns a monad object)
* The magic is in the bind function
*
* There are AXIOMS:
* bind(unit(value)), f) === f(value)
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active May 3, 2024 08:26
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);