Skip to content

Instantly share code, notes, and snippets.

@tilkinsc
tilkinsc / main.cpp
Last active February 19, 2025 03:24
WGL Full Demo
/**
*
* MIT License
*
* Copyright (c) 2017-2022 Cody Tilkins
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active October 26, 2025 23:01
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

WARNING: Article moved to separate repo to allow users contributions: https://github.com/raysan5/custom_game_engines

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](https:

@pezcode
pezcode / projection.hpp
Last active October 22, 2025 20:19
Reversed Z + infinite far plane projection matrices with GLM
// these matrices are for left-handed coordinate systems, with depth mapped to [1;0]
// the derivation for other matrices is analogous
// to get a perspective matrix with reversed z, simply swap the near and far plane
glm::mat4 perspectiveFovReverseZLH_ZO(float fov, float width, float height, float zNear, float zFar) {
return glm::perspectiveFovLH_ZO(fov, width, height, zFar, zNear);
};
// now let zFar go towards infinity
glm::mat4 infinitePerspectiveFovReverseZLH_ZO(float fov, float width, float height, float zNear) {
@Erkaman
Erkaman / taa.frag
Last active August 10, 2025 02:11
rudimentary temporal anti-aliasing solution, that is good as a starting point for more advanced TAA techniques.
/*
The MIT License (MIT)
Copyright (c) 2018 Eric Arnebäck
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@alexsr
alexsr / gl_texture_format_util.hpp
Created July 4, 2018 20:24
OpenGL internal texture format conversion
enum class format : GLenum {
r = GL_RED,
g = GL_GREEN,
b = GL_BLUE,
rg = GL_RG,
rgb = GL_RGB,
bgr = GL_BGR,
rgba = GL_RGBA,
bgra = GL_BGRA,
r_int = GL_RED_INTEGER,
@Ginurx
Ginurx / pbr.txt
Last active August 22, 2023 02:01
PBR Online Resources
A Basic Introduction to BRDF-Based Lighting [RECOMMANED]
https://www.cs.princeton.edu/courses/archive/fall06/cos526/tmp/wynn.pdf
A Reflectance Model for Computer Graphics
http://www.graphics.cornell.edu/~westin/consortium-home/cook-tog.pdf
SIGGRAPH 2012 Course: Practical Physically Based Shading in Film and Game Production
http://blog.selfshadow.com/publications/s2012-shading-course/#course_content
SIGGRAPH 2013 Course: Physically Based Shading in Theory and Practice
@Kos
Kos / formats.txt
Last active April 18, 2025 02:28
OpenGL image formats along with their unsized variants and preferred formats for pixel transfer (Written by hand, needs verification) Pixel store for compressed textures not provided because there are glCompressedTexImage and family for them. EXT_texture_compression_s3tc formats not included.
| Image format (sized) | Unsized | Compr | Pixel format | Pixel type |
|---------------------------------------|--------------------|-------|--------------------|-----------------------------------|
| GL_R8 | GL_RED | False | GL_RED | GL_UNSIGNED_BYTE |
| GL_R8_SNORM | GL_RED | False | GL_RED | GL_BYTE |
| GL_R16 | GL_RED | False | GL_RED | GL_UNSIGNED_SHORT |
| GL_R16_SNORM | GL_RED | False | GL_RED | GL_SHORT |
| GL_R32F | GL_RED | False | GL_RED | GL_FLOAT |
| GL_R8I | GL_RED | False | GL_RED_INTEGER | GL_INT |