Skip to content

Instantly share code, notes, and snippets.

View elliotwoods's full-sized avatar

Elliot Woods elliotwoods

View GitHub Profile
@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!
}
@elliotwoods
elliotwoods / LightField.hpp
Created May 20, 2016 02:47
Light Field rendering techniques
Texture2D RayStart : PREVIOUS;
Texture2D RayTransmit;
Texture2D MirrorData;
class Ray {
bool valid;
float3 s;
float3 t;
int mirrorIndex;
The C compiler identification is MSVC 19.0.23506.0
The CXX compiler identification is MSVC 19.0.23506.0
Check for working C compiler using: Visual Studio 14 2015 Win64
Check for working C compiler using: Visual Studio 14 2015 Win64 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 14 2015 Win64
Check for working CXX compiler using: Visual Studio 14 2015 Win64 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
#pragma once
#include <stdint.h>
namespace ofxSquashBuddies {
struct Packet {
enum {
PacketSize = 4096,
HeaderSize = 9,
MaxPayloadSize = PacketSize - HeaderSize
#version 150
uniform sampler2DRect tex0;
in vec2 texCoordVarying;
out vec4 outputColor;
uniform float minimum;
uniform float maximum;
#include "SoundEffects.h"
//----------
void SoundEffects::audioOut(ofSoundBuffer & out) {
auto numFrames = out.getNumFrames();
const auto interval = this->getInterval();
const auto intervalFrames = 44100 * interval;
for(int i=0; i<numFrames; i++) {
out[i * 2 + 0] = 0.0f;
#region usings
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using VVVV.PluginInterfaces.V1;
using VVVV.PluginInterfaces.V2;
const int output = 13;
const int highDuration = 50;
const int lowDuration = 30;
void setup() {
pinMode(output, OUTPUT);
Serial.begin(9600);
}
2>..\..\..\openFrameworks\3d\of3dPrimitives.cpp(149): warning C4267: 'argument': conversion from 'size_t' to 'ofIndexType', possible loss of data
2>..\..\..\openFrameworks\3d\of3dPrimitives.cpp(153): warning C4267: 'argument': conversion from 'size_t' to 'ofIndexType', possible loss of data
2>..\..\..\openFrameworks\3d\ofMesh.cpp(757): warning C4267: 'initializing': conversion from 'size_t' to 'ofIndexType', possible loss of data
2>..\..\..\openFrameworks\3d\ofMesh.cpp(1049): warning C4267: 'argument': conversion from 'size_t' to 'ofIndexType', possible loss of data
2>..\..\..\openFrameworks\3d\ofMesh.cpp(1064): warning C4267: 'argument': conversion from 'size_t' to 'ofIndexType', possible loss of data
2>..\..\..\openFrameworks\3d\ofMesh.cpp(1071): warning C4267: 'argument': conversion from 'size_t' to 'ofIndexType', possible loss of data
2>..\..\..\openFrameworks\3d\ofMesh.cpp(1084): warning C4267: 'argument': conversion from 'size_t' to 'ofIndexType', possible loss of data
2>..\..\..\openFrameworks\3d\ofMes
@elliotwoods
elliotwoods / MyTestNode.cpp
Created April 20, 2015 13:31
Rulr workshop #1 : example node
#include "MyTestNode.h"
#include "ofxDigitalEmulsion/Item/Board.h"
using namespace ofxDigitalEmulsion;
//----------
MyTestNode::MyTestNode() {
OFXDIGITALEMULSION_NODE_INIT_LISTENER;
}