- 2011 - A trip through the Graphics Pipeline 2011
- 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
- 2020 - GPU ARCHITECTURE RESOURCES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
// From http://forum.unity3d.com/threads/68390-PID-controller | |
// Thank you andeeeee | |
public class PID | |
{ | |
public float pFactor, iFactor, dFactor; | |
float integral; | |
float lastError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- triangle rasterizer | |
#define SUBPIXEL_SHIFT 8 | |
#define SUBPIXEL_SCALE (1 << SUBPIXEL_SHIFT) | |
static RADINLINE S64 det2x2(S32 a, S32 b, S32 c, S32 d) | |
{ | |
S64 r = (S64) a*d - (S64) b*c; | |
return r >> SUBPIXEL_SHIFT; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if 0 // self-compiling code | |
gcc -std=c99 -Wall -Wextra -pedantic -Werror -g -O4 -march=native $0 -lm || exit 1 | |
exec time ./a.out | |
#endif | |
// Blue Noise texture generation using the void-and-cluster algorithm | |
// implemented by Martin Fiedler <keyj@emphy.de> | |
// using an algorithm description written by Alan Wolfe: | |
// https://blog.demofox.org/2019/06/25/generating-blue-noise-textures-with-void-and-cluster/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SPC | |
SPC: find file | |
, switch buffer | |
. browse files | |
: MX | |
; EX | |
< switch buffer | |
` eval | |
u universal arg | |
x pop up scratch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hyperboloc functions by toneburst from | |
// https://machinesdontcare.wordpress.com/2008/03/10/glsl-cosh-sinh-tanh/ | |
// These are missing in GLSL 1.10 and 1.20, uncomment if you need them | |
/* | |
/// COSH Function (Hyperbolic Cosine) | |
float cosh(float val) | |
{ | |
float tmp = exp(val); | |
float cosH = (tmp + 1.0 / tmp) / 2.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To compile with gcc: (tested on Ubuntu 14.04 64bit): | |
// g++ sdl2_opengl.cpp -lSDL2 -lGL | |
// To compile with msvc: (tested on Windows 7 64bit) | |
// cl sdl2_opengl.cpp /I C:\sdl2path\include /link C:\path\SDL2.lib C:\path\SDL2main.lib /SUBSYSTEM:CONSOLE /NODEFAULTLIB:libcmtd.lib opengl32.lib | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <assert.h> | |
#include <SDL2/SDL.h> | |
#include <SDL2/SDL_opengl.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define STB_IMAGE_IMPLEMENTATION | |
#define STB_IMAGE_WRITE_IMPLEMENTATION | |
#define STBI_ONLY_PNG | |
#define STBI_ONLY_JPEG | |
#define STBI_ONLY_BMP | |
#define STBI_ONLY_GIF | |
#include "stb_image.h" | |
#include "stb_image_write.h" |
Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative
float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Something relating to a falling sand game | |
// | |
// Usage: | |
// | |
// After opening the Processing IDE, copy it into an empty new sketch. | |
// Just as simple as that. | |
// | |
// | |
// Playing: | |
// |
NewerOlder