Skip to content

Instantly share code, notes, and snippets.

@gafferongames
gafferongames / delta_compression.cpp
Last active May 13, 2024 06:38
Delta Compression
/*
Delta Compression by Glenn Fiedler.
This source code is placed in the public domain.
http://gafferongames.com/2015/03/14/the-networked-physics-data-compression-challenge/
*/
#include <stdint.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
@aras-p
aras-p / GraphicsCapsGLES.h
Created April 26, 2015 07:56
Part of runtime flags that kick in different things on our GL implementaton
int maxAASamplesConst; // gles2 img/apple/ext extensions all use different constants (facepalm)
int halfConst; // gles2 and gles3 have different constants for half float type
int texSRGBAConst; // gles2 (without 'internal format' ext) and gles3 have different constants for SRGB RGBA texture type
int texSRGBConst; // gles2 (without 'internal format' ext) and gles3 have different constants for SRGB RGB texture type
int etcFormatConst; // gles2/gles3 have different standard etc formats
bool isPvrGpu;
bool isMaliGpu;
bool isAdrenoGpu;
bool isTegraGpu;
// This assumes the occluder AABB and camera position are in the same space.
// You can either then transform the planes into world space, or transform the
// box verts and camera pos into world space before building the planes, but
// after finding the silhouette.
int makeOccluderPlanes(Vec4 planes[9], Vec3 bmin, Vec3 bmax, Vec3 camPos)
{
static const uint8_t s_silhouettes[43][6] = {
{ }, // 0
{ 0, 4, 6, 2 }, // 1: -x
{ 1, 3, 7, 5 }, // 2: +x
/* ===========================================================================
*
* LIBRARY
*
* =========================================================================== */
/* Proof of Concept GUI:
* - PoC UI implementation in ~2.5kLOC of C89 (ANSI C)
* => Core solutions has no external dependencies (removing standard library dependency is trival)
* => Does not use or require any special language constructs or macro constructs just pointers and enums
* - Combines both "retained" and "immediate mode" UI by providing control over update frequency

State of Roblox graphics API across all platforms, with percentage deltas since EOY 2017. Updated December 17 2018

Windows

API Share
Direct3D 11+ 80% (+3%)
Direct3D 10.1 10% (-1%)
Direct3D 10.0 8% (-1%)
Direct3D 9 2% (-1%)