Skip to content
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.

Commit

Permalink
Added OSC communication (Duration & karmaSoundAnalyser), a PureData s…
Browse files Browse the repository at this point in the history
…ound analyser, some new effects, a new scene setup with new ressources, + lots of overall improvements.
  • Loading branch information
Daandelange committed May 28, 2015
1 parent 6f66ad1 commit 32644bc
Show file tree
Hide file tree
Showing 64 changed files with 4,982 additions and 433 deletions.
22 changes: 22 additions & 0 deletions bin/data/effects/imageEffect/imageShader.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#version 120

#ifdef GL_ES
precision highp float;
#endif

// this is how we receive the texture
uniform sampler2DRect tex0;
uniform vec2 imageResolution;
uniform vec2 canvasResolution;

varying vec2 varyingtexcoord;
//varying vec4 outputColor;

void main()
{
//vec2 innerPos =
//gl_FragCoord = coordinates of current pixel
//gl_FragColor = vec4(varyingtexcoord.x,0,0,1);
//gl_FragColor = texture2DRect(tex0, gl_FragCoord.xy);//gl_TexCoord[0].st);//varyingtexcoord);
gl_FragColor = texture2DRect(tex0, gl_FragCoord.xy);
}
35 changes: 35 additions & 0 deletions bin/data/effects/imageEffect/imageShader.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#version 120

// these are for the programmable pipeline system and are passed in
// by default from OpenFrameworks
uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 textureMatrix;
uniform mat4 modelViewProjectionMatrix;

attribute vec4 position;
attribute vec4 color;
attribute vec4 normal;
attribute vec2 texcoord;
// this is the end of the default functionality

// this is something we're creating for this shader
varying vec2 varyingtexcoord;

// this is coming from our C++ code
uniform float mouseX;

void main()
{
// vec4 pos = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;

// here we move the texture coordinates
varyingtexcoord = texcoord;//vec2(gl_MultiTexCoord0.x, gl_MultiTexCoord0.y);

// send the vertices to the fragment shader
//gl_Position = modelViewProjectionMatrix * position;
//gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;

gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = ftransform();
}
41 changes: 41 additions & 0 deletions bin/data/effects/imageEffect/imageShaderGL3.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#version 150

#ifdef GL_ES
precision highp float;
#endif

// incoming variables
// no need to declare these, use this as a list
layout(origin_upper_left) in vec4 gl_FragCoord;// <-- pixel position (layout fixes inverted y)
// in bool gl_FrontFacing;
// in vec2 gl_PointCoord;// <-- position of the vertex that created this pixel
// in float gl_FragDepth;// <-- gl_FragCoord.z, if DEPTH enabled

// these are our textures from OF
uniform sampler2DRect tex0;
uniform vec2 tex0Resolution; // w,h
uniform vec2 fboCanvas; // w,h
uniform vec4 shapeBoundingBox; // x,y,w,h
uniform int fitMode; // 0=fit to screen, 1=fit-to-shape, 2=crop-to-shape
uniform float opacity;

// this comes from the vertex shader
in vec2 texCoordVarying;
in vec4 texColor;

// this is the output of the fragment shader
out vec4 outputColor;

void main(){

// get rgb from tex0
vec2 pos;
if(fitMode==1) pos = ((gl_FragCoord.xy-shapeBoundingBox.xy) / floor(shapeBoundingBox.zw) ) * tex0Resolution; // fit tex to shape
else pos = ( (gl_FragCoord.xy-shapeBoundingBox.xy) / shapeBoundingBox.zw) * tex0Resolution; // fit tex to screen

outputColor = vec4(texture(tex0, pos).rgb, texColor.a*opacity);

//outputColor = vec4(offset.x, offset.y,0,1);


}
46 changes: 46 additions & 0 deletions bin/data/effects/imageEffect/imageShaderGL3.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#version 150

// reference (GLSL, but still useful)
// https://www.opengl.org/wiki/Built-in_Variable_%28GLSL%29

// these are for the programmable pipeline system and are passed in
// by default from OpenFrameworks
uniform mat4 orientationMatrix;
uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 textureMatrix;
uniform mat4 modelViewProjectionMatrix;

// build-in incoming variables
//in int gl_VertexID;// <-- vertex index
//in int gl_InstanceID;// <-- not always set

// build-in variables you can alter
//vec4 gl_Position;// <-- vertex position
//float gl_PointSize;// <-- size/width (px) of current vertex
//float gl_ClipDistance[];// <-- clipping stuf

// from of-bound textures
in vec4 position;
in vec2 texcoord;
in vec4 color;
in vec4 normal;

// texture coordinates are sent to fragment shader
out vec2 texCoordVarying;
out vec4 texColor;

void main()
{
// build-in input variables
// gl_VertexID
// gl_InstanceID

// Output variables
// gl_PointSize
// gl_Position

texColor = color;
texCoordVarying = texcoord;
gl_Position = modelViewProjectionMatrix * position;
}
28 changes: 28 additions & 0 deletions bin/data/effects/lineEffect/fadeOutAlpha.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#version 150

#ifdef GL_ES
precision highp float;
#endif

// incoming variables
// no need to declare these, use this as a list
layout(pixel_center_integer​) in vec4 gl_FragCoord;// <-- pixel position
// in bool gl_FrontFacing;
// in vec2 gl_PointCoord;// <-- position of the vertex that created this pixel
// in float gl_FragDepth;// <-- gl_FragCoord.z, if DEPTH enabled

// these are our textures from OF
uniform float alphaMultiplier;

// this is the output of the vertex shader
in vec4 myColor;

out vec4 outputColor;

void main(){
//outputColor.a *= 0.1f;
//outputColor = vec4(1,0,0,0.99f);
//outputColor = vec4(myColor.r, myColor.g, myColor.b, 0);
outputColor = vec4(0,1,0,1);
//outputColor = ve4(1,0,0,1);
}
13 changes: 13 additions & 0 deletions bin/data/effects/lineEffect/fadeOutAlpha.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#version 150

uniform mat4 modelViewProjectionMatrix;

in vec4 position;
in vec4 color;

out vec4 myColor;

void main(void) {
myColor = color;
gl_Position = modelViewProjectionMatrix * position;
}
23 changes: 23 additions & 0 deletions bin/data/effects/videoEffect/videoShader.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#version 330

#ifdef GL_ES
precision highp float;
#endif

uniform sampler2DRect tex0; // video layer
uniform vec2 resolution;
uniform vec2 textureResolution;
uniform vec2 shapeCenterOffset;
uniform float textureScale;

in vec2 vertexTexCoord;
in vec4 gl_FragCoord;

out vec4 outputColor;

void main()
{
//outputColor = vec4( texture(tex0, gl_FragCoord.xy/resolution.xy ).rgb, 1);
outputColor = vec4( texture(tex0, mod( (vertexTexCoord-shapeCenterOffset)/resolution*textureResolution*textureScale, textureResolution) ).rgb, 1);//outputColor.a);
//outputColor.r += 0.15f; // debugging
}
14 changes: 14 additions & 0 deletions bin/data/effects/videoEffect/videoShader.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#version 330

uniform mat4 modelViewProjectionMatrix; // This is provide by openFrameworks
in vec2 texcoord; // This is provide by openFrameworks
in vec4 position;
out vec2 vertexTexCoord;

void main()
{
// Absolute window position: gl_FragCoord.x / windowWidth
//gl_Position.xy;//
vertexTexCoord = position.xy;
gl_Position = modelViewProjectionMatrix * position;
}
Loading

0 comments on commit 32644bc

Please sign in to comment.