Skip to content

Instantly share code, notes, and snippets.

@beugnen
beugnen / MyDualFramebufferView.cpp
Created May 20, 2012 00:22
Creating a Render to Texture Secondary Framebuffer for iOS OpenGL ES 2
GLsizei cxFBO;
GLsizei cyFBO;
GLuint _frameBufferID;
GLuint _colorRenderBuffer;
GLuint _depthRenderBuffer;
GLuint _fboTextureID;
void MyDualFramebufferView::Resize(GLfloat width, GLfloat height, GLfloat scale)
{
_scale = scale;
@arvearve
arvearve / gist:4158578
Created November 28, 2012 02:01
Mathematics: What do grad students in math do all day?

Mathematics: What do grad students in math do all day?

by Yasha Berchenko-Kogan

A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.

The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.

What can you say?

@roxlu
roxlu / VideoSurface.cpp
Created January 29, 2013 11:25
Fast texture uploads using pixel buffer objects. Improved upload of a 768x1366 texture from 16-20ms to 1-3ms (we can improve the performance a bit more by using GPU default pixel formats)
#include <shared/VideoSurface.h>
GLuint VideoSurface::prog = 0;
GLint VideoSurface::u_pm = 0;
GLint VideoSurface::u_mm = 0;
GLint VideoSurface::u_tex = 0;
GLfloat VideoSurface::pm[16] = {0};
VideoSurface::VideoSurface()
:width(0)
@clifff
clifff / dogs.markdown
Created October 9, 2013 20:48
dog gifs

@jmakitalo
jmakitalo / gist:93102107bb44d66f83d5
Last active December 23, 2015 00:44
Resource manager
#ifndef MANAGER_HH
#define MANAGER_HH
#include <cstdint.h>
#include <vector>
#include <queue>
#include <map>
// CVar and CVarGroup classes.
#include "var.hh"
Below I collected relevant links and papers more or less pertaining to the subject of tetrahedral meshes.
It's an ever-growing list.
------------------------------
Relevant links:
http://en.wikipedia.org/wiki/Types_of_mesh
http://en.wikipedia.org/wiki/Tetrahedron
http://en.wikipedia.org/wiki/Simplicial_complex
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active July 2, 2024 07:48
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@sheredom
sheredom / VkComputeSample
Created May 29, 2016 19:14
A simple Vulkan compute sample
// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
//
// In jurisdictions that recognize copyright laws, the author or authors
// of this software dedicate any and all copyright interest in the
// software to the public domain. We make this dedication for the benefit
@jhaberstro
jhaberstro / gpu_arch_resources
Last active October 26, 2023 00:14
GPU Architecture Learning Resources
http://courses.cms.caltech.edu/cs179/
http://www.amd.com/Documents/GCN_Architecture_whitepaper.pdf
https://community.arm.com/graphics/b/blog
http://cdn.imgtec.com/sdk-documentation/PowerVR+Hardware.Architecture+Overview+for+Developers.pdf
http://cdn.imgtec.com/sdk-documentation/PowerVR+Series5.Architecture+Guide+for+Developers.pdf
https://www.imgtec.com/blog/a-look-at-the-powervr-graphics-architecture-tile-based-rendering/
https://www.imgtec.com/blog/the-dr-in-tbdr-deferred-rendering-in-rogue/
http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/opencl-optimization-guide/#50401334_pgfId-412605
https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index/
https://community.arm.com/graphics/b/documents/posts/moving-mobile-graphics#siggraph2015
@romainguy
romainguy / d_ggx.glsl
Last active October 26, 2023 06:18
D_GGX in mediump/half float
// From https://github.com/google/filament
float D_GGX(float linearRoughness, float NoH, const vec3 h) {
// Walter et al. 2007, "Microfacet Models for Refraction through Rough Surfaces"
// In mediump, there are two problems computing 1.0 - NoH^2
// 1) 1.0 - NoH^2 suffers floating point cancellation when NoH^2 is close to 1 (highlights)
// 2) NoH doesn't have enough precision around 1.0
// Both problem can be fixed by computing 1-NoH^2 in highp and providing NoH in highp as well
// However, we can do better using Lagrange's identity: