Skip to content

Instantly share code, notes, and snippets.

View Reedbeta's full-sized avatar

Nathan Reed Reedbeta

View GitHub Profile
@Reedbeta
Reedbeta / hobbit.txt
Last active December 10, 2015 10:59
Hobbit review
I went to see the Hobbit in HFR 3D IMAX OMGWTF today. Movie verdict: 3 hours is too long to sit in
the theater. It's not necessarily too long for home viewing where you can get up and move around,
or pause the movie and take a break, but it's too long for the theater. That said, it's a well-made
film and PJ keeps the story moving along, so you'll be entertained, even if your eyes and butt are
sore as hell by the end of it!
Stereo 3D verdict: yep, I still hate it. Kill it with fire. Especially the parts where they flick
stuff at your face - it's such a stupid, cheap trick.
HFR verdict: really interesting experience. The picture is great - very clear and smooth and BRIGHT
if (FAILED(D3D11CreateDevice(
NULL,
D3D_DRIVER_TYPE_HARDWARE,
NULL,
#if _DEBUG
D3D11_CREATE_DEVICE_DEBUG,
#else
0,
#endif
NULL,
@Reedbeta
Reedbeta / gist:5794189
Last active December 18, 2015 13:59
Beckmann HLSL test
float beckmann1(float m : M, float NdotH : NDOTH) : SV_Target0
{
float oneOverMSquared = 1.0 / (m*m);
float NdotHSquared = NdotH * NdotH;
return exp((NdotHSquared - 1.0) / NdotHSquared * oneOverMSquared) * oneOverMSquared * (1.0 / 3.141592654) / (NdotHSquared * NdotHSquared);
}
mad r0.x, v0.y, v0.y, l(-1.000000)
mul r0.yz, v0.xxyx, v0.xxyx
div r0.x, r0.x, r0.z
@Reedbeta
Reedbeta / sierpinski.py
Created June 29, 2014 05:08
Sierpinski carpet generator in Python
# Sierpinski carpet generator, in Python using Numpy and Pillow.
# Written by Nathan Reed, June 2014.
# This code is released into the public domain.
import numpy as np
from PIL import Image
numLevels = 6
imageSize = 3**numLevels
@Reedbeta
Reedbeta / indexable-temps.hlsl
Created July 8, 2014 21:24
Indexable temporaries tests in HLSL
// This works (compiled with: fxc /T ps_5_0 /E main foo.hlsl)
float main (in uint x:X) : SV_Target0
{
float a[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
// Put some things in the array
a[x] = 47.0;
a[x&7] = 42.0;
a[(x+1)%12] = 3.14159;
@Reedbeta
Reedbeta / antialias-test.py
Created July 25, 2014 06:03
Antialiasing test program
# Tests for antialiasing a high-frequency image in various ways
# Nathan Reed, July 2014
# Written for Python 3.4; requires numpy and Pillow to be installed
import concurrent.futures
import math
import multiprocessing
import numpy as np
import optparse
import random
# Simulator for depth comparison error (i.e. z-fighting)
# Nathan Reed, June 2015
# Written for Python 3.4; requires numpy
import math
import numpy as np
import optparse
# Parse command-line options
parser = optparse.OptionParser()
<?php
/*************************************************************************************
* hlsl.php
* -----
* Author: Nick Darnell (NickDarnell@gmail.com)
* Copyright: (c) 2010 Nick Darnell (NickDarnell@gmail.com)
* Release Version: 1.0
* Date Started: 6/30/2010
*
* HLSL language file for GeSHi.

Programming Language Evaluation

A list of simple tasks to perform when learning or evaluating a new language. Each of these should be able to be completed in a few hours, and will help to get the feel of the language and its standard libraries. A well-rounded set of evaluation tasks will help ensure all parts of the language are exercised. You might also write some tests to demonstrate implementation correctness.

Basics

  1. Hello world
  2. Read lines from a text file and output them in sorted order
  3. Read numbers from a text file and output the mean and standard deviation
  4. Given an amount of money and a list of coin denominations provided on the command line, output all the possible ways to make change
@Reedbeta
Reedbeta / cool-game-programming-blogs.opml
Last active May 5, 2024 18:07
List of cool blogs on game programming, graphics, theoretical physics, and other random stuff
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Graphics, Games, Programming, and Physics Blogs</title>
</head>
<body>
<outline text="Tech News" title="Tech News">
<outline type="rss" text="Ars Technica" title="Ars Technica" xmlUrl="http://feeds.arstechnica.com/arstechnica/index/" htmlUrl="https://arstechnica.com"/>
<outline type="rss" text="Polygon - Full" title="Polygon - Full" xmlUrl="http://www.polygon.com/rss/index.xml" htmlUrl="https://www.polygon.com/"/>
<outline type="rss" text="Road to VR" title="Road to VR" xmlUrl="http://www.roadtovr.com/feed" htmlUrl="https://www.roadtovr.com"/>