Skip to content

Instantly share code, notes, and snippets.

View MrSmith33's full-sized avatar

Andrey Penechko MrSmith33

View GitHub Profile
@Longor1996
Longor1996 / generator.py
Last active March 21, 2022 11:18
Merges multiple fonts and generates a multi-channel signed-distance-field font bitmap.
import re
import sys
import fontforge
print(f"MSDF Multi-Font Merger & Generator! Python {sys.version}")
merged = None
#merged = fontforge.font()
#merged.fontname = "merged"
#merged.encoding = "UnicodeFull"
@gingerBill
gingerBill / metal_in_odin.odin
Last active April 11, 2024 18:12
Metal in Odin Natively
package objc_test
import NS "vendor:darwin/Foundation"
import MTL "vendor:darwin/Metal"
import CA "vendor:darwin/QuartzCore"
import SDL "vendor:sdl2"
import "core:fmt"
import "core:os"

WIDL compiler incompatibilities with Windows SDK

I attempted to compile the IDL files distributed in https://github.com/microsoft/win32metadata/tree/master/generation/WinSDK/RecompiledIdlHeaders using the latest (7.0.1-rc.1) version of the Wine IDL compiler, called WIDL. Unlike Microsoft's MIDL compiler which ships with Visual Studio, WIDL is open source.

More importantly, WIDL contains patches to generated header files that make e.g. COM calling conventions compatible with mingw-w64 and clang when targetting GNU ABI.

@h3r2tic
h3r2tic / restir-meets-surfel-lighting-breakdown.md
Created November 23, 2021 02:15
A quick breakdown of lighting in the `restir-meets-surfel` branch of my renderer

A quick breakdown of lighting in the restir-meets-surfel branch of my renderer, where I revive some olde surfel experiments, and generously sprinkle ReSTIR on top.

General remarks

Please note that this is all based on work-in-progress experimental software, and represents a single snapshot in development history. Things will certainly change 😛

Due to how I'm capturing this, there's frame-to-frame variability, e.g. different rays being shot, TAA shimmering slightly. Some of the images come from a dedicated visualization pass, and are anti-aliased, and some show internal buffers which are not anti-aliased.

Final images

@pdarragh
pdarragh / papers.md
Last active April 17, 2024 19:29
Approachable PL Papers for Undergrads

Approachable PL Papers for Undergrads

On September 28, 2021, I asked on Twitter:

PL Twitter:

you get to recommend one published PL paper for an undergrad to read with oversight by someone experienced. the paper should be interesting, approachable, and (mostly) self-contained.

what paper do you recommend?

// See <https://gist.github.com/pervognsen/b58108d134824e61caedffcc01004e03> for
// Per Vognsen gist on value speculation.
//
// I compile this on linux with
//
// $ clang --version
// clang version 12.0.0
// Target: x86_64-unknown-linux-gnu
// $ clang -static -Wall -O3 value-speculation-linux.c -o value-speculation-linux
//
INLINE
u32 index(Ref r) {
return r >> 4;
}
INLINE
u32 tag(Ref r) {
return r & 15;
}
@x0nu11byt3
x0nu11byt3 / elf_format_cheatsheet.md
Created February 27, 2021 05:26
ELF Format Cheatsheet

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation

// Length-segregated string tables for length < 16. You use a separate overflow table for length >= 16.
// By segregating like this you can pack the string data in the table itself tightly without any padding. The datapath
// is uniform and efficient for all lengths < 16 by using unaligned 16-byte SIMD loads/compares and masking off the length prefix.
// One of the benefits of packing string data tightly for each length table is that you can afford to reduce the load factor
// on shorter length tables without hurting space utilization too much. This can push hole-in-one rates into the 95% range without
// too much of a negative impact on cache utilization.
// Since get() takes a vector register as an argument with the key, you want to shape the upstream code so the string to be queried
// is naturally in a vector. For example, in an optimized identifier lexer you should already have a SIMD fast path for length < 16
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active May 28, 2024 15:33
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d