Skip to content

Instantly share code, notes, and snippets.

View elliotwoods's full-sized avatar

Elliot Woods elliotwoods

View GitHub Profile
@elliotwoods
elliotwoods / kinect depth threshold
Created May 29, 2012 15:13 — forked from mrboni/kinect depth threshold
basic hlsl shader used with 16bit depth texture from kinect as a way of thresholding
//@author: vvvv group
//@help: this is a very basic template. use it to start writing your own effects. if you want effects with lighting start from one of the GouraudXXXX or PhongXXXX effects
//@tags:
//@credits:
// --------------------------------------------------------------------------------------------------
// PARAMETERS:
// --------------------------------------------------------------------------------------------------
//transforms
#region usings
using System;
using System.ComponentModel.Composition;
using System.Runtime.InteropServices;
using SlimDX;
using SlimDX.Direct3D9;
using VVVV.Core.Logging;
using VVVV.PluginInterfaces.V1;
using VVVV.PluginInterfaces.V2;
@elliotwoods
elliotwoods / alphafbo.cpp
Created May 26, 2016 04:40 — forked from HalfdanJ/alphafbo.cpp
ofFbo with premultiplied alpha
// Kudos to armadilly
fbo.begin();
{
///pre-multiply background color of the fbo for correct blending!
ofClear(ofColor(fboBgColor * (fboBgColor.a / 255.) , fboBgColor.a));
//Set this blending mode for anything you draw INSIDE the fbo
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
//your draw code here!
}