Register

handmade.network Library

Most Popular

Game Engine Black Books (Wolfenstein and DOOM)
★ 4 0
Thorough walkthroughs of the code for famous id Software games. Available as free PDFs or inexpensive print versions.
Linux Applications Performance (ZeroHTTPd)
★ 3 0
A series of articles exploring low-level Linux programming by creating a simple web server with a variety of architectures. By Shuveb Hussain.
The Beauty of Bresenham's Algorithm
★ 2 0
This page introduces a compact and efficient implementation of Bresenham's algorithm to plot lines, circles, ellipses and Bézier curves.
Extreme SIMD: Optimized Collision Detection in Titanfall
★ 2 0
GDC presentation by Earl Hammon at Respawn Entertainment on how they made collision detection code (that was already fast) twice as fast.
Inigo Quilez' Youtube
Math,
★ 2 0
Inigo Quilez teaches signed distance functions, raymarching and how to make art using math. His articles and video tutorials are a treasure trove.
Writing Tools Faster
★ 2 0
Niklas Gray of Our Machinery walks through the design failings of their previous game engines (Bitsquid and Stingray) and how they applied those lessons to their new engine. Topics include frameworks, data definition, and UI.
Writing a Simple Operating System from Scratch
★ 2 0
How-to book on implementing a basic operating system.

Latest Additions

Let's Learn x86-64 Assembly! Part 0 - Setup and First Steps
★ 0 0
Modern introduction to programming in assembly, focusing on Windows x86-64 specifically.
Bare-Metal MCU #9 - Review; ATTiny85 from scratch
★ 0 0
Brief review of the full series, learn to program an AVR microcontroller without needing the Arduino IDE/environment.
Pointers and Memory
★ 1 0
This document explains how pointers and memory work and how to use them—from the basic concepts through all the major programming techniques. For each topic there is a combination of discussion, sample C code, and drawings.
Data Structures Part 1: Bulk Data
★ 1 0
Looking at how to to implement common day to day data structures - specifically implementing a "bulk data" data structure.
A Comparison of Modern Graphics APIs
★ 1 0
Looking at how Low level Graphics APIs such as Vulkan, DirectX, Metal, and WebGPU are converging to a model similar to the way GPUs are currently built, and how they compare with older graphics APIs such as OpenGL in their design and data structures.
The Beauty of Bresenham's Algorithm
★ 2 0
This page introduces a compact and efficient implementation of Bresenham's algorithm to plot lines, circles, ellipses and Bézier curves.
Extreme SIMD: Optimized Collision Detection in Titanfall
★ 2 0
GDC presentation by Earl Hammon at Respawn Entertainment on how they made collision detection code (that was already fast) twice as fast.
Introduction to Digital Video
★ 0 0
A visual and interactive introduction to digital video encoding. Covers basic terminology, principles of video compression, details of video codecs, and more.
Markov Chains Explained Visually
★ 0 0
Basic explanation of Markov chains with interactive visualizations.
Decimal Precision of Binary Floating-Point Numbers
★ 1 0
In depth blog post exploring the question "How many decimal digits of precision does a binary floating-point number have? "
X Window System Basics
★ 0 0
Under the hood explanation and walk through about how the basics of X Window system works.
Proceedings of the ACM on Programming Languages - Volume 4, Issue HOPL June 2020
★ 1 0
A collection of papers on the history of several programming languages (C++, JavaScript, F#, Verilog and more)

Subtopics

Article

  • Interactive Guide to Buffer Overflow Exploitation
    ★ 1 0
    "A Buffer Overflow is a bug class in a program typically written in a memory unsafe language like C or C++. Buffer Overflow bugs from user-input can often allow someone to overwrite some data in memory they weren't supposed to. Before we dive into how to exploit Buffer Overflow bugs, we will do a quick introduction to Assembly."
  • SIMD for C++ Developers
    ★ 1 1
  • (How to Write a (Lisp) Interpreter (in Python)) by Peter Norvig
    ★ 0 0
    Programming a basic Lisp interpreter in Python.
  • Avoiding branchy loops in lexers with FSMs
    ★ 0 0
    aka Some Strategies For Fast Lexical Analysis when Parsing Programming Languages, by Sean Barrett
  • Eli Bendersky: Parsing Expressions by Precedence Climbing
    ★ 0 0
    "It's not necessary to be familiar with the other algorithms for expression parsing in order to understand precedence climbing. In fact, I think that precedence climbing is the simplest of them all. To explain it, I want to first present what the algorithm is trying to achieve. After this, I will explain how it does this, and finally will present a fully functional implementation in Python."
  • How to Write a Lisp Interpreter in JavaScript by Mary Rose Cook
    ★ 0 0
    "Little Lisp is an interpreter that supports function invocation, lambdas, lets, ifs, numbers, strings, a few library functions, and lists. I wrote it for a lightning talk at the Recurse Center to show how easy it is to write an interpreter. The code is 116 lines of JavaScript. I will explain how it works." There is also a video version of this article: https://youtu.be/hqnTvuvXPCc
  • Point in Polygon Detection Strategies
    ★ 0 0
    Testing whether a point is inside a polygon is a basic operation in computer graphics. Graphics Gems presents an algorithm for testing points against convex polygons (Badouel 1990). This Gem provides algorithms which are from 1.6 to 9 or more times faster for convex polygons. It also presents algorithms for testing non-convex polygons and discusses the advantages and drawbacks of each. Faster, more memory intensive algorithms are also presented, along with an O(log n) algorithm for convex polygons. Code is included for the algorithms discussed.
  • Square/Disc Mappings
    ★ 0 0
    Various methods to convert a point on a unit square to a point on a unit disc.
  • The Perils of Future-Coding
    ★ 0 0
    Advice about programming effectively by solving the problems you actually have.
  • Why Vanilla ECS is not Enough
    ★ 0 0
    Discusses some shortcomings frequently found in Entity Component System implementations and suggests solutions.

Article Series

  • My First Language Frontend with LLVM Tutorial
    ★ 0 0
    "Requirements: This tutorial assumes you know C++, but no previous compiler experience is necessary. [...] Here we run through the implementation of a simple language [...]This tutorial will get you up and running fast and show a concrete example of something that uses LLVM to generate code."

Blog

  • Interactive Guide to Buffer Overflow Exploitation
    ★ 1 0
    "A Buffer Overflow is a bug class in a program typically written in a memory unsafe language like C or C++. Buffer Overflow bugs from user-input can often allow someone to overwrite some data in memory they weren't supposed to. Before we dive into how to exploit Buffer Overflow bugs, we will do a quick introduction to Assembly."
  • Eli Bendersky: Parsing Expressions by Precedence Climbing
    ★ 0 0
    "It's not necessary to be familiar with the other algorithms for expression parsing in order to understand precedence climbing. In fact, I think that precedence climbing is the simplest of them all. To explain it, I want to first present what the algorithm is trying to achieve. After this, I will explain how it does this, and finally will present a fully functional implementation in Python."
  • How to Write a Lisp Interpreter in JavaScript by Mary Rose Cook
    ★ 0 0
    "Little Lisp is an interpreter that supports function invocation, lambdas, lets, ifs, numbers, strings, a few library functions, and lists. I wrote it for a lightning talk at the Recurse Center to show how easy it is to write an interpreter. The code is 116 lines of JavaScript. I will explain how it works." There is also a video version of this article: https://youtu.be/hqnTvuvXPCc
  • Why Vanilla ECS is not Enough
    ★ 0 0
    Discusses some shortcomings frequently found in Entity Component System implementations and suggests solutions.

Book

  • Fractal Curves
    ★ 0 0
    A complete taxonomy of plane-filling (a.k.a space-filling) curves. E.g. Hilbert curve, Peano curve, Morton curve, etc...
  • Programming Languages: Application and Interpretation by Shriram Krishnamurthi
    ★ 0 0
    Abstract: "Programming language ‘‘paradigms’’ are a moribund and tedious legacy of a bygone age. Modern language designers pay them no respect, so why do our courses slavishly adhere to them? This paper argues that we should abandon this method of teaching languages, offers an alternative, reconciles an important split in programming language education, and describes a textbook that explores these matters."
  • Programming and Programming Languages
    ★ 0 0
    From the introduction: "Many people would regard this as being two books in one. One book is an introduction to programming, teaching you basic concepts of organizing data and the programs that operate over them, ending in the investigation of universally useful algorithms. The other book is an introduction to programming languages: a study, from one level up, of the media by which we structure these data and programs. Obviously, these are not unrelated topics. We learn programming through one or more languages, and the programs we write then become natural subjects of study to understand languages at large. Nevertheless, these are considered sufficiently different topics that they are approached separately. This is how we approached them, too." by Shriram Krishnamurthi, Benjamin S. Lerner, Joe Gibbs Politz

Online Book

  • C FAQ
    ★ 0 0
    Content from the book "C Programming FAQs: Frequently Asked Questions"
  • Fractal Curves
    ★ 0 0
    A complete taxonomy of plane-filling (a.k.a space-filling) curves. E.g. Hilbert curve, Peano curve, Morton curve, etc...
  • Free programming books
    ★ 0 0
    Collection of free programming books
  • Programming Languages: Application and Interpretation by Shriram Krishnamurthi
    ★ 0 0
    Abstract: "Programming language ‘‘paradigms’’ are a moribund and tedious legacy of a bygone age. Modern language designers pay them no respect, so why do our courses slavishly adhere to them? This paper argues that we should abandon this method of teaching languages, offers an alternative, reconciles an important split in programming language education, and describes a textbook that explores these matters."
  • Programming and Programming Languages
    ★ 0 0
    From the introduction: "Many people would regard this as being two books in one. One book is an introduction to programming, teaching you basic concepts of organizing data and the programs that operate over them, ending in the investigation of universally useful algorithms. The other book is an introduction to programming languages: a study, from one level up, of the media by which we structure these data and programs. Obviously, these are not unrelated topics. We learn programming through one or more languages, and the programs we write then become natural subjects of study to understand languages at large. Nevertheless, these are considered sufficiently different topics that they are approached separately. This is how we approached them, too." by Shriram Krishnamurthi, Benjamin S. Lerner, Joe Gibbs Politz
  • Tiny Raycaster
    ★ 0 0
    "This text is written for those who only make first steps in programming. The main idea is to show, step by step, how to make a game à la Wolfenstein 3D. Attention, I am not going to compete with Carmack, he is a genius and his code is stunning. I aim a different goal: I'm using the huge computing power of modern computers to allow my students to create fun projects in very short time (typically few days), without getting stuck in the optimization nightmare."
  • Tiny Raytracer
    ★ 0 0
    "There are plenty of raytracing articles on the web; however the problem is that almost all of them show finished software that can be quite difficult to understand. Take, for example, the very famous businness card ray tracer challenge. It produces very impressive programs, but it's very difficult to understand how this works. Rather than showing that I can do renders, I want to tell you in detail how you can do it by yourself."
  • theForger's Win32 API Programming Tutorial
    ★ 0 0
    "This tutorial attempts to get you started developing with the Win32 API as quickly and clearly as possible."

Other

Paper

  • A Low-Distortion Map Between Triangle and Square
    ★ 0 0
    Abstract: We introduce a low-distortion map between triangle and square. This mapping yields an area-preserving parameterization that can be used for sampling random points with a uniform density in arbitrary triangles. This parameterization presents two advantages compared to the square-root parameterization typically used for triangle sampling. First, it has lower distortions and better preserves the blue noise properties of the input samples. Second, its computation relies only on arithmetic operations(+, *), which makes it faster to evaluate.
  • Bidirectional Path Tracing and Multiple Importance Sampling (2 Minute Papers)
    ★ 0 0
    With a classical unidirectional path tracer, we'll have some scenes where it is difficult to connect to the light source, and therefore many of our computed samples will be wasted. What if we would start not only one light path from the camera, but one also from the light source, and connect the two together? It turns out that we get a much more robust technique that can render a variety of "packed" scenes with lots of occlusions with ease.
  • Mappings between Sphere, Disc, and Square
    ★ 0 0
    A variety of mappings between a sphere and a disc and between a disc and a square, as well as combinations of both, are used in computer graphics applications, resulting in mappings between spheres and squares. Many options exist for each type of mapping; to pick the right methods for a given application requires knowledge about the nature and magnitude of mapping distortions. This paper provides an overview of forward and inverse mappings between a unit sphere, a unit disc, and a unit square. Quality measurements relevant for computer graphics applications are derived from tools used in the field of map projection, and a comparative analysis of the mapping methods is given.
  • Matrix row-column sampling for the many-light problem
    ★ 0 0
    Computing global illumination using the many-lights approach is expensive, this algorithm presents a method ("exploration") for reducing the amount of lights to be sampled.
  • Metropolis Light Transport (2 Minute Papers)
    ★ 0 0
    Metropolis Light Transport is a powerful technique that can outperform the convergence speed of Bidirectional Path Tracing on most difficult scenes (what makes a scene difficult is a story on its own). It promises optimal importance sampling "along multiple steps" in the stationary distribution of the Markov chain.
  • Parsing Gigabytes of JSON per Second
    ★ 0 0
    Abstract: JavaScript Object Notation or JSON is aubiquitous data exchange format on the Web. Ingesting JSON documents can become a performance bottleneck due to the sheer volume of data. We are thus motivated to make JSON parsing as fast as possible. Despite the maturity of the problem of JSON parsing, we show that substantial speedups are possible. We present the first standard-compliant JSON parser to process gigabytes of data per second on a single core, using commodity processors.
  • Photon Mapping (2 Minute Papers)
    ★ 0 0
    Describes the Photon Mapping solution to light transport.
  • Producing Wrong Data Without Doing Anything Obviously Wrong!
    ★ 0 0
    A paper exploring measurement bias in program profiling. From the abstract: "Changing a seemingly innocuous aspect of an experimental setup can cause a systems researcher to draw wrong conclusions from an experiment...Our results demonstrate that measurement bias is significant and commonplace in computer system evaluation."
  • Sampling with Hammersley and Halton Points
    ★ 0 0
    Abstract: The Hammersley and Halton point sets, two well known low discrepancy sequences, have been used for quasi-Monte Carlo integration in previous research. A deterministic formula generates a uniformly distributed and stochastic-looking sampling pattern, at low computational cost. The Halton point set is also useful for incremental sampling. In this paper, we discuss detailed implementation issues and our experience of choosing suitable bases of the point sets, not just on the 2D plane,but also on a spherical surface. The sampling scheme is also applied to ray tracing, with a significant improvement in error.
  • Stochastic Lightcuts
    ★ 0 0
    A solution to the global illumination problem by sampling from many lights. Stochastic Lightcuts is an improvement on the earlier Lightcuts algorithm. Presentation at HPG 2019.
  • Stochastic Progressive Photon Mapping (2 Minute Papers)
    ★ 0 0
    Describes improvements to Photon Mapping, called Progressive Photon Mapping, Stochastic Photon Mapping, and their combination.

Repository

  • Tiny Raycaster
    ★ 0 0
    "This text is written for those who only make first steps in programming. The main idea is to show, step by step, how to make a game à la Wolfenstein 3D. Attention, I am not going to compete with Carmack, he is a genius and his code is stunning. I aim a different goal: I'm using the huge computing power of modern computers to allow my students to create fun projects in very short time (typically few days), without getting stuck in the optimization nightmare."
  • Tiny Raytracer
    ★ 0 0
    "There are plenty of raytracing articles on the web; however the problem is that almost all of them show finished software that can be quite difficult to understand. Take, for example, the very famous businness card ray tracer challenge. It produces very impressive programs, but it's very difficult to understand how this works. Rather than showing that I can do renders, I want to tell you in detail how you can do it by yourself."
  • Windows Classic Samples
    ★ 0 0
    "This repo contains samples that demonstrate the API used in Windows classic desktop applications. These samples demonstrate the functionality and programming model for Windows and Windows Server. This repo contains Visual Studio solution (SLN) files for each sample, along with the source files, assets, resources, and metadata needed to compile and run the sample. For more info about the programming models, platforms, languages, and APIs demonstrated in these samples, check out the documentation on the Windows Dev Center."

Website

  • Lights and Shadows
    ★ 1 0
    Discussion and explanation of lights, shadows and the functions for modelling them.
  • C FAQ
    ★ 0 0
    Content from the book "C Programming FAQs: Frequently Asked Questions"
  • Fractal Curves
    ★ 0 0
    A complete taxonomy of plane-filling (a.k.a space-filling) curves. E.g. Hilbert curve, Peano curve, Morton curve, etc...
  • Programming Languages: Application and Interpretation by Shriram Krishnamurthi
    ★ 0 0
    Abstract: "Programming language ‘‘paradigms’’ are a moribund and tedious legacy of a bygone age. Modern language designers pay them no respect, so why do our courses slavishly adhere to them? This paper argues that we should abandon this method of teaching languages, offers an alternative, reconciles an important split in programming language education, and describes a textbook that explores these matters."
  • Programming and Programming Languages
    ★ 0 0
    From the introduction: "Many people would regard this as being two books in one. One book is an introduction to programming, teaching you basic concepts of organizing data and the programs that operate over them, ending in the investigation of universally useful algorithms. The other book is an introduction to programming languages: a study, from one level up, of the media by which we structure these data and programs. Obviously, these are not unrelated topics. We learn programming through one or more languages, and the programs we write then become natural subjects of study to understand languages at large. Nevertheless, these are considered sufficiently different topics that they are approached separately. This is how we approached them, too." by Shriram Krishnamurthi, Benjamin S. Lerner, Joe Gibbs Politz
  • theForger's Win32 API Programming Tutorial
    ★ 0 0
    "This tutorial attempts to get you started developing with the Win32 API as quickly and clearly as possible."
  • x86/x64 SIMD Instruction List (with register diagrams)
    ★ 0 0
    A table holding most common x86/x64 SIMD with useful diagrams (infer at a glance what it does).

YouTube Series

YouTube Video

  • Writing Tools Faster
    ★ 2 0
    Niklas Gray of Our Machinery walks through the design failings of their previous game engines (Bitsquid and Stingray) and how they applied those lessons to their new engine. Topics include frameworks, data definition, and UI.
  • Revision 2020: Physically Based Shading Without Locking Yourself In
    ★ 1 0
    Implementing a physically based shading model without locking yourself in
  • Advanced Global Illumination Using Photon Mapping
    ★ 0 0
    Photon mapping provides a practical way of efficiently simulating global illumination including interreflections, caustics, color bleeding, participating media and subsurface scattering in scenes with complicated geometry and advanced material models. This class will provide the insight necessary to efficiently implement and use photon mapping to simulate global illumination in complex scenes. The presentation will briefly cover the fundamentals of photon mapping including efficient techniques and datastructures for managing large numbers of rays and photons. In addition, we will describe how to integrate the information from the photon maps in shading algorithms to render global illumination.
  • Bidirectional Path Tracing and Multiple Importance Sampling (2 Minute Papers)
    ★ 0 0
    With a classical unidirectional path tracer, we'll have some scenes where it is difficult to connect to the light source, and therefore many of our computed samples will be wasted. What if we would start not only one light path from the camera, but one also from the light source, and connect the two together? It turns out that we get a much more robust technique that can render a variety of "packed" scenes with lots of occlusions with ease.
  • Daniel Shiffman's Youtube
    ★ 0 0
    Daniel Shiffman teaches creative coding. Mostly using high level languages but certainly worth a peek or two.
  • How to Write a Lisp Interpreter in JavaScript by Mary Rose Cook
    ★ 0 0
    "Little Lisp is an interpreter that supports function invocation, lambdas, lets, ifs, numbers, strings, a few library functions, and lists. I wrote it for a lightning talk at the Recurse Center to show how easy it is to write an interpreter. The code is 116 lines of JavaScript. I will explain how it works." There is also a video version of this article: https://youtu.be/hqnTvuvXPCc
  • How we fit an NES game into 40 Kilobytes
    ★ 0 0
    A short video listing the tricks developers can use to fit a game into a small NES cartridge.
  • Matrix row-column sampling for the many-light problem
    ★ 0 0
    Computing global illumination using the many-lights approach is expensive, this algorithm presents a method ("exploration") for reducing the amount of lights to be sampled.
  • Metropolis Light Transport (2 Minute Papers)
    ★ 0 0
    Metropolis Light Transport is a powerful technique that can outperform the convergence speed of Bidirectional Path Tracing on most difficult scenes (what makes a scene difficult is a story on its own). It promises optimal importance sampling "along multiple steps" in the stationary distribution of the Markov chain.
  • Path Tracing and Next Event Estimation (2 Minute Papers)
    ★ 0 0
    A description of Path Tracing, a ray tracing solution to the rendering equation, and one of its traditional optimizations, Next Event Estimation.
  • Photon Mapping (2 Minute Papers)
    ★ 0 0
    Describes the Photon Mapping solution to light transport.
  • Practical Global Illumination with Irradiance Caching
    ★ 0 0
    Lighting usually only changes smoothly over a surface, Irradiance Caching is a classic approach to reduce the computational cost by only computing lighting at points where it changes quickly.
  • Radiosity
    ★ 0 0
    Lecture describing how to solve the radiosity equations used to compuse diffuse global illumination.
  • Ray-Traced Irradiance Fields (Real-Time Light Probe Rendering)
    ★ 0 0
    [...] how to combine glossy reflection ray tracing with diffuse ray-traced irradiance field probes. This creates a complete dynamic global illumination solution that scales across all DXR GPUs and minimizes light leaking without requiring manual per-probe or lightmap work by artists.
  • Revision 2020: Modern 64k Intro Compression
    ★ 0 0
    Squishy is a new 64k intro compressor used by top groups in 7 productions at revision 2019, 3 of them meteorik-nominated 64k intros, and it has recently been released in the wild. This talk start by an intro to 64k intros and executable compression, and will continue with a deep-dive into squishy's internals, what makes it special, and some tips on how you can start making your own executable compressors.
  • Scott Meyers: Cpu Caches and Why You Care
    ★ 0 0
  • Stochastic Lightcuts
    ★ 0 0
    A solution to the global illumination problem by sampling from many lights. Stochastic Lightcuts is an improvement on the earlier Lightcuts algorithm. Presentation at HPG 2019.
  • Stochastic Progressive Photon Mapping (2 Minute Papers)
    ★ 0 0
    Describes improvements to Photon Mapping, called Progressive Photon Mapping, Stochastic Photon Mapping, and their combination.

Other

  • Code for Concentric Map
    ★ 0 0
    Concentric mapping is a commonly used method for mapping points on a unit square to a unit disc. These are some code samples.