- 2011 - A trip through the Graphics Pipeline 2011
- 2013 - Performance Optimization Guidelines and the GPU Architecture behind them
- 2015 - Life of a triangle - NVIDIA's logical pipeline
- 2015 - Render Hell 2.0
- 2016 - How bad are small triangles on GPU and why?
- 2017 - GPU Performance for Game Artists
- 2019 - Understanding the anatomy of GPUs using Pokémon
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <assert.h> | |
| #include <string.h> | |
| #include <stdarg.h> | |
| #include <limits.h> | |
| #define cast(t,p) ((t)(p)) | |
| #define szof(a) ((int)sizeof(a)) |
| 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 |
So the technique is called Shell Mapping and I got the basics from:
Interactive Smooth and Curved Shell Mapping
https://www.cg.tuwien.ac.at/research/publications/2007/JESCHKE-2007-ISC/
The technique as documented starts with Geometry Shaders which is a really bad idea so I kept things simple and did all the pre-processing on the CPU when meshes were imported. These days I'd look at doing it on-demand in a Compute Shader. Preprocessing steps are:
- Parameterise a heightmap for your mesh.
| // NOTE: Must bind 8x single mip RWTexture views, because HLSL doesn't have .mips member for RWTexture2D. (SRVs only have .mips member) | |
| // NOTE: globallycoherent attribute is needed. Without it writes aren't guaranteed to be seen by other groups | |
| globallycoherent RWTexture2D<float> MipTextures[8]; | |
| RWTexture2D<uint> Counters[8]; | |
| groupshared uint CounterReturnLDS; | |
| [numthreads(16, 16, 1)] | |
| void GenerateMipPyramid(uint3 Tid : SV_DispatchThreadID, uint3 Group : SV_GroupId, uint Gix : SV_GroupIndex) | |
| { | |
| [unroll] |
| // | |
| // TinyCRT, revamp and TinyWin support by Don Williamson, 2011 | |
| // Based on http://www.codeproject.com/KB/library/tlibc.aspx and LIBCTINY by Matt Pietrek | |
| // | |
| #pragma once | |
| #ifdef USE_DEFAULT_CRT |
The Gilbert–Johnson–Keerthi (GJK) distance algorithm is a method of determining the minimum distance between two convex sets. The algorithm's stability, speed which operates in near-constant time, and small storage footprint make it popular for realtime collision detection.
Unlike many other distance algorithms, it has no requirments on geometry data to be stored in any specific format, but instead relies solely on a support function to iteratively generate closer simplices to the correct answer using the Minkowski sum (CSO) of two convex shapes.
For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft


