Nathan Reed
reedbeta.com · Personal blog · on HN since 2013
Nathan Reed writes about computer graphics, GPU programming, texture compression, hashing, and Unicode.
What HN saysHN links it for GPU hash functions, quadrilateral interpolation, and Unicode; a commenter also includes him in a list of blogs worth reading.
23HN people shared it
11linked it in comments
20stories submitted
624story points
9 months agolast shared
2013people per year2026
Most-shared posts
- 1Hash Functions for GPU Rendering3 people · 43 points · first shared 2021 · 8 comments on HN
- 2Understanding BCn Texture Compression Formats (2012)3 people · 1 points · first shared 2018 · discussion on HN
- 3A Programmer’s Introduction to Unicode2 people · 299 points · first shared 2017 · 60 comments on HN
- 4Depth Precision Visualized2 people · 33 points · first shared 2015 · 1 comments on HN
- 5Quick and easy GPU random numbers2 people · 3 points · first shared 2026 · discussion on HN
- 6Quadrilateral interpolation part 22 people · first shared 2017
- 7Antialiasing: To Splat or Not1 people · 79 points · first shared 2014 · 9 comments on HN
- 8Data-Oriented Hash Table1 people · 76 points · first shared 2015 · 9 comments on HN
- 9Making Your Own Container Compatible with C++20 Ranges1 people · 74 points · first shared 2021 · 10 comments on HN
- 10Why Do Quaternions Double-Cover?1 people · 5 points · first shared 2025 · discussion on HN
- 11Mesh Shader Possibilities1 people · 2 points · first shared 2018 · discussion on HN
- 12The Shunting-Yard Algorithm (2011)1 people · 2 points · first shared 2023 · discussion on HN
- 13Python-Like enumerate() in C++171 people · 2 points · first shared 2018 · discussion on HN
- 14Data-Oriented Hash Table1 people · 1 points · first shared 2023 · discussion on HN
- 15Normals and the Inverse Transpose, Part 1: Grassmann Algebra1 people · 1 points · first shared 2018 · discussion on HN
What HN people wrote when they linked it
mattnewport · 2018-06-11
There are some efforts underway to standardize using SIMD but this is really a separate problem to providing a short vector math library suitable for the kind of linear algebra useful for 3D graphics and physics.
Making your vec4f type a SIMD register type is not a good way to make use of SIMD hardware. The best approach is generally an SoA (Struct of Arrays) rather than an AoS (Array of Structs) and the best CPU programming model for that is something like ispc[1].
Nathan Reed has a good summary of why "naïve" SIMD libraries after not the way to go for short vector math: http://www.reedbeta.com/blog/on-vector-math-libraries/#how-to-simd-and…
On some platforms alignment issues become a big problem for naïve vector math libraries too, though this is less of an issue on current generation x64 hardware.
[1] https://ispc.github.io/ispc.html
ino · 2017-09-07
Recently I came across http://iquilezles.org/www/articles/ibilinear/ibilinear.htm when researching how to draw textured non-parallelogram quadrilaterals, without affine texture mapping, with WebGL / OpenGL ES 2.
I was disappointed to learn that OpenGL wouldn't do it and we have to calculate it on our own and send in a 3rd texture coordinate to each vertex for extra calculation on the shader.
Sadly, there isn't much useful info on this subject on the internet (I'm not talking about projective mapping, but bilinear interpolation).
I've found this: http://www.reedbeta.com/blog/quadrilateral-interpolation-part-2/ that I think will work for my case.
My problem is that I also use normals to do "fake" parallel lighting on quads and it accentuates even more the affine errors on non parallelogram quadrilaterals. It's easier to just subdivide the quad to minimize the affine artifacts.
If anyone knows a better way to solve it, I'd love to learn.
panic · 2017-07-25
Here are a bunch of blogs from my RSS reader that I think are worth reading. Some of them haven't updated in a while, but the archives may be worth a look anyway.
* Blogs with a math focus:
http://blog.sigfpe.com
http://bit-player.org
http://mathr.co.uk/blog/
https://www.johndcook.com/blog/
* Blogs with a programming languages focus:
https://existentialtype.wordpress.com
https://bluishcoder.co.nz
http://blog.ezyang.com
http://akkartik.name
http://lambda-the-ultimate.org
http://mrale.ph
* Blogs with a UI design focus:
http://www.brandonwalkin.com/blog/
http://ignorethecode.net/blog/
http://interuserface.net
* Blogs with a graphics / 3D rendering focus:
http://c0de517e.blogspot.com
http://diaryofagraphicsprogrammer.blogspot.com
https://directtovideo.wordpress.com
http://graphicrants.blogspot.com
http://www.reedbeta.com
http://www.realtimerendering.com/blog/
https://blog.demofox.org
http://eelpi.gotdns.org/blog.wiki.html
* Other interesting / more general programming blogs (many of these have a "systems" focus):
http://danluu.com
http://ewontfix.com
http://chneukirchen.org/blog/
http://neverworkintheory.org
http://apenwarr.ca/log/
https://www.snellman.net/blog/
https://www.pvk.ca
http://psy-lob-saw.blogspot.com
https://randomascii.wordpress.com
http://fastcompression.blogspot.com
https://fgiesen.wordpress.com
http://blog.plover.com
http://chneukirchen.org/trivium/
http://rachelbythebay.com/w/
masklinn · 2017-03-09
> Unicode is fucked. All these bullshit emojis
Ah yes, all those bloody emoji taking the place of better worthier characters, those dastardly pictures taking up all of one half of one 16th of one Unicode plane (which has only 16 of those, and only 14 public).
And the gall they have, actually being used and lighting up their section of plane 1 like a christmas tree while the rest of the plane lies in the darkness: http://reedbeta.com/blog/programmers-intro-to-unicode/heatmap-wiki+twe… what a disgrace, not only existing but being found useful, what has the world come to.
And then of course there's the technical side of things: emoji actually forced western developers — and especially anglo ones — to stop fucking up non-ASCII let alone non-BMP codepoints. I don't think it's a coincidence that MySQL finally added support for astral characters once emoji started getting prominent.
In fact, I have a pet theory that the rash of combining emoji in the latest revisions is in part a vehicle to teach developers to finally stop fucking up text segmentation and stop assuming every codepoint is a grapheme cluster.
Atrix256 · 2023-09-07
Here's the source. Nathan Reed references a jcgt paper, which references a paper form 2012.
https://www.reedbeta.com/blog/hash-functions-for-gpu-rendering/
corysama · 2023-04-21
https://www.reedbeta.com/blog/understanding-bcn-texture-compression-fo…
BC1-5 have been standard practice since before the original XBox. I think when people here are talking about "uncompressed assets" they mean "not applying variable-rate zip style compression on top of BCn compression."
rasz · 2020-06-24
It has been said PS5 uses Kraken. If its this http://www.radgametools.com/oodlekraken.htm then nothing really changes. PS4 games use RAD Kraken today. Texture assets themselves have standardized long time ago, currently on the desktop we are at http://www.reedbeta.com/blog/understanding-bcn-texture-compression-for… with history going all the way back to 1990 patents for Apple Video 'road pizza' codec, later ripped off by S3 and re-patented as S3TC texture compression in 1997.
CountHackulus · 2013-04-12
This is probably the simplest article about the subject:
http://www.reedbeta.com/blog/2013/01/12/quick-and-easy-gpu-random-numb…
Frotag · 2026-01-31
> Quaternions are the same idea just in 3 dimensions (so with 3 imaginary units i j k, not just i, one per plane).
I justify quaternions to myself with the intuition from [1]. In essence quaternions represent rotations in 4D, where multiplying by a "unit" (i,j,k), rotates two distinct planes by 90 degrees. The reason introducing a single unit j doesn't work is the same reason this rotation-is-multiplication trick doesn't work in 1D (or really any odd-number of dimensions). Anyways if we call this 4th axis w and pick a simple rule like ij = k then we get some nice properties like
- multiplying by i rotates xy + zw planes by 90 degrees
- j rotates xz + yw
- k rotates xw + yz
- 1 rotates nothing
Notably this definition covers all 6 unique planes. But if we want to rotate only a single plane, we have to make up a new property, something that lets us rotate say xz by 90 and yw by -90. So we make up another rule that multiplying by a unit on the right does this, which algebraically looks like ij = -ji. This is incidentally why the rotation formulas have 1/2 everywhere, because if we want to rotate xy by 90, we multiply on the left by i/2 then on the right by -i/2.
[1] https://www.reedbeta.com/blog/why-quaternions-double-cover/
Jasper_ · 2018-10-28
The DS "GPU" is indeed very bizarre and shares more in common with the GBA 2D rasterizer than a modern 3D GPU architecture. That it's a scanline renderer that can handle quads directly should be a pretty big tell :)
I implemented a cheap subset of it used in Super Mario 64 DS for my online model viewer ( https://noclip.website/#sm64ds/44;-517.89,899.85,1300.08,0.37,-0.34,0.… ), but implementing all of the quirks and the weird featuresets might be nearly impossible to do in a modern graphics API. 2D rasterizers don't have to be slow (as SwiftShader and ryg show), and you can get the bizarre conditions exactly correct. I'm not sure what a GPU-based implementation would even add.
EDIT: The math to be able to handle the bilinear quad interpolation on a GPU was worked out by reedbeta last year: http://reedbeta.com/blog/quadrilateral-interpolation-part-2/ . That's a big roadblock gone, but there's still a lot of other questionable things.