diff --git a/bin/data/AlltagTechnikUmwelt.png b/bin/data/AlltagTechnikUmwelt.png new file mode 100644 index 0000000..4dcd19b Binary files /dev/null and b/bin/data/AlltagTechnikUmwelt.png differ diff --git a/bin/data/AlltagWissenschaftUmwelt.png b/bin/data/AlltagWissenschaftUmwelt.png new file mode 100644 index 0000000..5ebe0df Binary files /dev/null and b/bin/data/AlltagWissenschaftUmwelt.png differ diff --git a/bin/data/Danke_4070_2.png b/bin/data/Danke_4070_2.png new file mode 100644 index 0000000..b18bb31 Binary files /dev/null and b/bin/data/Danke_4070_2.png differ diff --git a/bin/data/FINAL_Logo.png b/bin/data/FINAL_Logo.png new file mode 100644 index 0000000..3098330 Binary files /dev/null and b/bin/data/FINAL_Logo.png differ diff --git a/bin/data/HexAlltagTechnikUmwelt.png b/bin/data/HexAlltagTechnikUmwelt.png new file mode 100644 index 0000000..a1f0640 Binary files /dev/null and b/bin/data/HexAlltagTechnikUmwelt.png differ diff --git a/bin/data/HexAlltagWissenschaftUmwelt.png b/bin/data/HexAlltagWissenschaftUmwelt.png new file mode 100644 index 0000000..b2fc6be Binary files /dev/null and b/bin/data/HexAlltagWissenschaftUmwelt.png differ diff --git a/bin/data/HexTechnikUmwelt.png b/bin/data/HexTechnikUmwelt.png new file mode 100644 index 0000000..bd2343c Binary files /dev/null and b/bin/data/HexTechnikUmwelt.png differ diff --git a/bin/data/HexUmweltTechnik.png b/bin/data/HexUmweltTechnik.png new file mode 100644 index 0000000..59140c0 Binary files /dev/null and b/bin/data/HexUmweltTechnik.png differ diff --git a/bin/data/HexUmweltWissenschaft.png b/bin/data/HexUmweltWissenschaft.png new file mode 100644 index 0000000..5ce8e93 Binary files /dev/null and b/bin/data/HexUmweltWissenschaft.png differ diff --git a/bin/data/Hexagon.png b/bin/data/Hexagon.png new file mode 100644 index 0000000..aa9e616 Binary files /dev/null and b/bin/data/Hexagon.png differ diff --git a/bin/data/Ohm.png b/bin/data/Ohm.png new file mode 100644 index 0000000..90cf51c Binary files /dev/null and b/bin/data/Ohm.png differ diff --git a/bin/data/PktAlltagTechnikUmwelt.png b/bin/data/PktAlltagTechnikUmwelt.png new file mode 100644 index 0000000..a2eca23 Binary files /dev/null and b/bin/data/PktAlltagTechnikUmwelt.png differ diff --git a/bin/data/PktAlltagWissenschaftUmwelt.png b/bin/data/PktAlltagWissenschaftUmwelt.png new file mode 100644 index 0000000..0895063 Binary files /dev/null and b/bin/data/PktAlltagWissenschaftUmwelt.png differ diff --git a/bin/data/PktTechnikUmwelt.png b/bin/data/PktTechnikUmwelt.png new file mode 100644 index 0000000..25d6716 Binary files /dev/null and b/bin/data/PktTechnikUmwelt.png differ diff --git a/bin/data/PktUmweltTechnik.png b/bin/data/PktUmweltTechnik.png new file mode 100644 index 0000000..4bb70b9 Binary files /dev/null and b/bin/data/PktUmweltTechnik.png differ diff --git a/bin/data/PktUmweltWissenschaft.png b/bin/data/PktUmweltWissenschaft.png new file mode 100644 index 0000000..74c831c Binary files /dev/null and b/bin/data/PktUmweltWissenschaft.png differ diff --git a/bin/data/TechnikUmwelt.png b/bin/data/TechnikUmwelt.png new file mode 100644 index 0000000..d178580 Binary files /dev/null and b/bin/data/TechnikUmwelt.png differ diff --git a/bin/data/UmweltTechnik.png b/bin/data/UmweltTechnik.png new file mode 100644 index 0000000..053f379 Binary files /dev/null and b/bin/data/UmweltTechnik.png differ diff --git a/bin/data/UmweltWissenschaft.png b/bin/data/UmweltWissenschaft.png new file mode 100644 index 0000000..ecb67e3 Binary files /dev/null and b/bin/data/UmweltWissenschaft.png differ diff --git a/bin/data/Wolke.png b/bin/data/Wolke.png new file mode 100644 index 0000000..6241dcf Binary files /dev/null and b/bin/data/Wolke.png differ diff --git a/bin/data/img/beer.png b/bin/data/img/beer.png new file mode 100644 index 0000000..feeaae9 Binary files /dev/null and b/bin/data/img/beer.png differ diff --git a/bin/data/img/br.png b/bin/data/img/br.png new file mode 100644 index 0000000..270da3e Binary files /dev/null and b/bin/data/img/br.png differ diff --git a/bin/data/img/tex.png b/bin/data/img/tex.png new file mode 100644 index 0000000..ca8193a Binary files /dev/null and b/bin/data/img/tex.png differ diff --git a/bin/data/img/tr.png b/bin/data/img/tr.png new file mode 100644 index 0000000..2d86770 Binary files /dev/null and b/bin/data/img/tr.png differ diff --git a/bin/data/settings.json b/bin/data/settings.json new file mode 100644 index 0000000..b99174e --- /dev/null +++ b/bin/data/settings.json @@ -0,0 +1,24 @@ +{ + "warps": [ + { + "blend": { + "edges": "0, 0, 0.5, 0.5", + "exponent": 2.0, + "gamma": "1, 1, 1", + "luminance": "0.5, 0.5, 0.5" + }, + "brightness": 1.0, + "type": 2, + "warp": { + "columns": 2, + "control points": [ + "0, 0", + "1, 0", + "1, 1", + "0, 1" + ], + "rows": 2 + } + } + ] +} \ No newline at end of file diff --git a/bin/data/shaders/ofxWarp/ControlPoint.frag b/bin/data/shaders/ofxWarp/ControlPoint.frag new file mode 100644 index 0000000..87ef7a3 --- /dev/null +++ b/bin/data/shaders/ofxWarp/ControlPoint.frag @@ -0,0 +1,16 @@ +#version 150 + +in vec2 vTexCoord; +in vec4 vColor; + +out vec4 fragColor; + +void main(void) +{ + vec2 uv = vTexCoord * 2.0 - 1.0; + float d = dot(uv, uv); + float rim = smoothstep(0.7, 0.8, d); + rim += smoothstep(0.3, 0.4, d) - smoothstep(0.5, 0.6, d); + rim += smoothstep(0.1, 0.0, d); + fragColor = mix(vec4( 0.0, 0.0, 0.0, 0.25), vColor, rim); +} diff --git a/bin/data/shaders/ofxWarp/ControlPoint.vert b/bin/data/shaders/ofxWarp/ControlPoint.vert new file mode 100644 index 0000000..8eccc63 --- /dev/null +++ b/bin/data/shaders/ofxWarp/ControlPoint.vert @@ -0,0 +1,23 @@ +#version 150 + +// OF default uniforms and attributes +uniform mat4 modelViewProjectionMatrix; +uniform vec4 globalColor; + +in vec4 position; +in vec2 texcoord; +in vec4 color; + +// App uniforms and attributes +in vec4 iPositionScale; +in vec4 iColor; + +out vec2 vTexCoord; +out vec4 vColor; + +void main(void) +{ + vTexCoord = texcoord; + vColor = globalColor * iColor; + gl_Position = modelViewProjectionMatrix * vec4(position.xy * iPositionScale.z + iPositionScale.xy, position.zw); +} diff --git a/bin/data/shaders/ofxWarp/WarpBilinear.frag b/bin/data/shaders/ofxWarp/WarpBilinear.frag new file mode 100644 index 0000000..14597bb --- /dev/null +++ b/bin/data/shaders/ofxWarp/WarpBilinear.frag @@ -0,0 +1,57 @@ +#version 150 + +uniform sampler2D uTexture; +uniform vec4 uExtends; +uniform vec3 uLuminance; +uniform vec3 uGamma; +uniform vec4 uEdges; +uniform vec4 uCorners; +uniform float uExponent; +uniform bool uEditing; + +in vec2 vTexCoord; +in vec4 vColor; + +out vec4 fragColor; + +float map(in float value, in float inMin, in float inMax, in float outMin, in float outMax) +{ + return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin); +} + +float grid(in vec2 uv, in vec2 size) +{ + vec2 coord = uv / size; + vec2 grid = abs(fract(coord - 0.5) - 0.5) / (2.0 * fwidth(coord)); + float line = min(grid.x, grid.y); + return 1.0 - min(line, 1.0); +} + +void main(void) +{ + vec4 texColor = texture(uTexture, vTexCoord); + + vec2 mapCoord = vec2(map(vTexCoord.x, uCorners.x, uCorners.z, 0.0, 1.0), map(vTexCoord.y, uCorners.y, uCorners.w, 0.0, 1.0)); + + float a = 1.0; + if (uEdges.x > 0.0) a *= clamp(mapCoord.x / uEdges.x, 0.0, 1.0); + if (uEdges.y > 0.0) a *= clamp(mapCoord.y / uEdges.y, 0.0, 1.0); + if (uEdges.z > 0.0) a *= clamp((1.0 - mapCoord.x) / uEdges.z, 0.0, 1.0); + if (uEdges.w > 0.0) a *= clamp((1.0 - mapCoord.y) / uEdges.w, 0.0, 1.0); + + const vec3 one = vec3(1.0); + vec3 blend = (a < 0.5) ? (uLuminance * pow(2.0 * a, uExponent)) : one - (one - uLuminance) * pow(2.0 * (1.0 - a), uExponent); + + texColor.rgb *= pow(blend, one / uGamma); + + if (uEditing) + { + float f = grid(mapCoord.xy * uExtends.xy, uExtends.zw); + vec4 gridColor = vec4(1.0f); + fragColor = mix(texColor * vColor, gridColor, f); + } + else + { + fragColor = texColor * vColor; + } +} diff --git a/bin/data/shaders/ofxWarp/WarpBilinear.vert b/bin/data/shaders/ofxWarp/WarpBilinear.vert new file mode 100644 index 0000000..81e4fad --- /dev/null +++ b/bin/data/shaders/ofxWarp/WarpBilinear.vert @@ -0,0 +1,21 @@ +#version 150 + +// OF default uniforms and attributes +uniform mat4 modelViewProjectionMatrix; +uniform vec4 globalColor; + +in vec4 position; +in vec2 texcoord; +in vec4 color; + +// App uniforms and attributes +out vec2 vTexCoord; +out vec4 vColor; + +void main(void) +{ + vTexCoord = texcoord; + vColor = globalColor; + + gl_Position = modelViewProjectionMatrix * position; +} diff --git a/bin/data/shaders/ofxWarp/WarpPerspective.frag b/bin/data/shaders/ofxWarp/WarpPerspective.frag new file mode 100644 index 0000000..82c1a0b --- /dev/null +++ b/bin/data/shaders/ofxWarp/WarpPerspective.frag @@ -0,0 +1,38 @@ +#version 150 + +uniform sampler2D uTexture; +uniform vec3 uLuminance; +uniform vec3 uGamma; +uniform vec4 uEdges; +uniform vec4 uCorners; +uniform float uExponent; + +in vec2 vTexCoord; +in vec4 vColor; + +out vec4 fragColor; + +float map(in float value, in float inMin, in float inMax, in float outMin, in float outMax) +{ + return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin); +} + +void main(void) +{ + vec4 texColor = texture(uTexture, vTexCoord); + + vec2 mapCoord = vec2(map(vTexCoord.x, uCorners.x, uCorners.z, 0.0, 1.0), map(vTexCoord.y, uCorners.y, uCorners.w, 0.0, 1.0)); + + float a = 1.0; + if (uEdges.x > 0.0) a *= clamp(mapCoord.x / uEdges.x, 0.0, 1.0); + if (uEdges.y > 0.0) a *= clamp(mapCoord.y / uEdges.y, 0.0, 1.0); + if (uEdges.z > 0.0) a *= clamp((1.0 - mapCoord.x) / uEdges.z, 0.0, 1.0); + if (uEdges.w > 0.0) a *= clamp((1.0 - mapCoord.y) / uEdges.w, 0.0, 1.0); + + const vec3 one = vec3(1.0); + vec3 blend = (a < 0.5) ? (uLuminance * pow(2.0 * a, uExponent)) : one - (one - uLuminance) * pow(2.0 * (1.0 - a), uExponent); + + texColor.rgb *= pow(blend, one / uGamma); + + fragColor = texColor * vColor; +} diff --git a/bin/data/shaders/ofxWarp/WarpPerspective.vert b/bin/data/shaders/ofxWarp/WarpPerspective.vert new file mode 100644 index 0000000..81e4fad --- /dev/null +++ b/bin/data/shaders/ofxWarp/WarpPerspective.vert @@ -0,0 +1,21 @@ +#version 150 + +// OF default uniforms and attributes +uniform mat4 modelViewProjectionMatrix; +uniform vec4 globalColor; + +in vec4 position; +in vec2 texcoord; +in vec4 color; + +// App uniforms and attributes +out vec2 vTexCoord; +out vec4 vColor; + +void main(void) +{ + vTexCoord = texcoord; + vColor = globalColor; + + gl_Position = modelViewProjectionMatrix * position; +} diff --git a/bin/data/testcard.png b/bin/data/testcard.png new file mode 100644 index 0000000..d15c568 Binary files /dev/null and b/bin/data/testcard.png differ diff --git a/bin/data/xml/attractor.xml b/bin/data/xml/attractor.xml new file mode 100644 index 0000000..ffd382b --- /dev/null +++ b/bin/data/xml/attractor.xml @@ -0,0 +1,10 @@ + + 0.05 + 4 + 100 + 0 + 10 + -80 + 80 + + \ No newline at end of file diff --git a/bin/data/xml/default.xml b/bin/data/xml/default.xml new file mode 100644 index 0000000..588a2b5 --- /dev/null +++ b/bin/data/xml/default.xml @@ -0,0 +1,10 @@ + + 0.05 + 4 + 100 + 0 + 10 + -80 + 80 + + \ No newline at end of file diff --git a/bin/data/xml/detractor.xml b/bin/data/xml/detractor.xml new file mode 100644 index 0000000..ffd382b --- /dev/null +++ b/bin/data/xml/detractor.xml @@ -0,0 +1,10 @@ + + 0.05 + 4 + 100 + 0 + 10 + -80 + 80 + + \ No newline at end of file diff --git a/bin/data/xml/radial.xml b/bin/data/xml/radial.xml new file mode 100644 index 0000000..ffd382b --- /dev/null +++ b/bin/data/xml/radial.xml @@ -0,0 +1,10 @@ + + 0.05 + 4 + 100 + 0 + 10 + -80 + 80 + + \ No newline at end of file diff --git a/bin/data/xml/rain.xml b/bin/data/xml/rain.xml new file mode 100644 index 0000000..ffd382b --- /dev/null +++ b/bin/data/xml/rain.xml @@ -0,0 +1,10 @@ + + 0.05 + 4 + 100 + 0 + 10 + -80 + 80 + + \ No newline at end of file diff --git a/bin/data/xml/symbol.xml b/bin/data/xml/symbol.xml new file mode 100644 index 0000000..8223c81 --- /dev/null +++ b/bin/data/xml/symbol.xml @@ -0,0 +1,21 @@ + + 0.01 + 4.0 + 100 + 250 + 0 + ofRandom(maxAge - 5, maxAge) + -80 + 80 + (5, 241, 219) + 0.0 + 0 + 0 + 70 + false + + + + vel.set(ofRandom(-20.0, 20.0), ofRandom(-90, -100)); + + diff --git a/src/particle.cpp b/src/particle.cpp index 828a61a..5582923 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -14,6 +14,7 @@ Particle::Particle() } + // ----------------------------------- Particle::~Particle() @@ -76,6 +77,18 @@ void Particle::updateParticle(double deltaT, ofVec2f attractor, bool cloudAttrac } +//-------------------------------------------------------------- +void Particle::doMovementOfParticlesAtRain(bool tornadoIsFinished, double deltaT, float sceneSizeX) +{ + if (tornadoIsFinished == false) { //Movement of partile from bottom to top + position += vel * deltaT; + age += deltaT; + + if (position.x >= sceneSizeX) { + position.x = ofRandom(-1, -5); + } + } +} //-------------------------------------------------------------- void Particle::doMovementOfParticlesAtSymbols(double deltaT, ofVec2f &attractor)