Skip to content

Instantly share code, notes, and snippets.

View Reedbeta's full-sized avatar

Nathan Reed Reedbeta

View GitHub Profile
@Reedbeta
Reedbeta / cool-game-programming-blogs.opml
Last active June 15, 2026 11:55
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"/>
@Reedbeta
Reedbeta / srgb.glsl
Created August 3, 2018 16:52
Conversion between sRGB and linear color encoding
vec3 sRGBToLinear(vec3 rgb)
{
// See https://gamedev.stackexchange.com/questions/92015/optimized-linear-to-srgb-glsl
return mix(pow((rgb + 0.055) * (1.0 / 1.055), vec3(2.4)),
rgb * (1.0/12.92),
lessThanEqual(rgb, vec3(0.04045)));
}
vec3 LinearToSRGB(vec3 rgb)
{
# 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()
Windows Registry Editor Version 5.00
; Visual Studio context menu items
[-HKEY_CLASSES_ROOT\Directory\shell\AnyCode]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode]
; Share with Skype
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked]
"{776DBC8D-7347-478C-8D71-791E12EF49D8}"=""
@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 / interesting-libs.txt
Last active July 4, 2023 02:38
Interesting libraries I might like to use in a project
Interesting libraries I might like to use in a project...
Asset loading:
assetsys.h - virtual filesystem with ZIP backing, overlaying, etc https://github.com/mattiasgustavsson/libs/blob/master/docs/assetsys.md
cute_filewatch.h - file modification watching, for runtime reloading etc https://github.com/RandyGaul/cute_headers/blob/master/cute_filewatch.h
flatbuffers - data serialization, zero-copy deserialization, extensible schemas https://github.com/google/flatbuffers
stb_image - https://github.com/nothings/stb/blob/master/stb_image.h
tinyexr - https://github.com/syoyo/tinyexr
tinygltf - https://github.com/syoyo/tinygltf
tinyobjloader - https://github.com/syoyo/tinyobjloader

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
// Derived from: https://github.com/Cyan4973/xxHash
// Specialized version of XXH64 for 64-bit inputs
constexpr uint64_t XXH_PRIME64_1 = 0x9E3779B185EBCA87ULL;
constexpr uint64_t XXH_PRIME64_2 = 0xC2B2AE3D27D4EB4FULL;
constexpr uint64_t XXH_PRIME64_3 = 0x165667B19E3779F9ULL;
constexpr uint64_t XXH_PRIME64_4 = 0x85EBCA77C2B2AE63ULL;
constexpr uint64_t XXH_PRIME64_5 = 0x27D4EB2F165667C5ULL;
inline uint64_t XXH64_round(uint64_t acc, uint64_t input)
@Reedbeta
Reedbeta / nested-lists.md
Last active April 26, 2022 13:28
Nested lists markdown
  • Item 1

  • Item 2

  • Item 3
    second line

    • Item 3a
    • Item 3b
    • Item 3c

    Item 3 continue

@Reedbeta
Reedbeta / comptr.hpp
Created July 7, 2016 06:19
GPU PRNG & hash-function testbed
// COM pointer - wraps a COM object and automatically calls AddRef() / Release() as necessary
#pragma once
template <typename T>
class comptr
{
public:
comptr ()