Skip to content

Instantly share code, notes, and snippets.

I am attesting that this GitHub handle mantissa is linked to the Tezos account tz1cRCnQwxuxJF1fq8jakYSk45nLQojJ6VuZ for tzprofiles
sig:edsigtensTFxwNMcWJGwZruEZ2zbTMftJ7dx42SqbLLaPxe44pYarskEhmf6mbvKQbbsWRczTN6pKW8JTJw8gkZoP5nJtR6R7M5
@mantissa
mantissa / TextureArrayShader.frag
Last active May 14, 2022 10:17
GL_TEXTURE_2D_ARRAY in OpenFrameworks
#version 150
#define MAX_TEXTURES 2
uniform sampler2DArray textures;
uniform int texID;
in vec2 vTexCoord;
@mantissa
mantissa / DrawInstances.frag
Created April 26, 2015 19:26
Drawing instanced meshes using matrices contained in textures (OpenFrameworks)
#version 120
#extension GL_EXT_gpu_shader4 : require
void main(){
gl_FragColor = gl_Color;
}
@mantissa
mantissa / FrustumCulling.frag
Created April 6, 2014 01:03
Frustrum Culling with Shaders in OF
#version 120
uniform sampler2DRect pointsTexture;
uniform sampler2DRect resultsTexture;
uniform vec4 viewport;
uniform float width;
uniform mat4 mvMatrix;
varying vec4 texCoord0;
@mantissa
mantissa / KeepAppAlive.plist
Last active February 3, 2018 12:28
Automatically launch OF apps upon system startup ... and restart them on crash (using OSX)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>AllOver.restart</string>
@mantissa
mantissa / instanced.frag
Last active August 9, 2018 02:51
Demonstrates how to use perform rotations on instances drawn with ofVBOMesh::drawInstances(). Also uses per pixel lighting and color.
#version 120
#extension GL_EXT_gpu_shader4 : require
varying vec3 vertex_light_position;
varying vec3 vertex_normal;
void main(){
// calculate the shading based on the normal
float diffuse_value = max(dot(vertex_normal, vertex_light_position), 0.0);