Register

handmade.network Library

Latest Additions

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.
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.
Square/Disc Mappings
★ 0 0
Various methods to convert a point on a unit square to a point on a unit disc.
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.
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.
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.
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.
Revision 2020: Physically Based Shading Without Locking Yourself In
★ 1 0
Implementing a physically based shading model without locking yourself in
C FAQ
★ 0 0
Content from the book "C Programming FAQs: Frequently Asked Questions"

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."
  • (How to Write a (Lisp) Interpreter (in Python)) by Peter Norvig
    ★ 0 0
    Programming a basic Lisp interpreter in Python.
  • 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.

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

Book

  • 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"
  • 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.
  • 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.
  • 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.
  • 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.

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

  • C FAQ
    ★ 0 0
    Content from the book "C Programming FAQs: Frequently Asked Questions"
  • 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."

YouTube Series

YouTube Video

  • Revision 2020: Physically Based Shading Without Locking Yourself In
    ★ 1 0
    Implementing a physically based shading model without locking yourself in
  • Writing Tools Faster
    ★ 1 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.
  • 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.
  • 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

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.