3.11.2023 ~
ofShader + interaction mix and match example prototypes in openFrameworks for my Capstone project!
- shader : .frag + .vert files
- fragment shader : gradients and pixel colors between vertices by math
- vertex shader : physical displacement of vertices
- Fbo : Framebuffer objects; think of it as a box that can carry shader/img/video textures
- shadersGL3 for macOS, shadersES2 for raspberry Pi
gl_Position
: .vert position outputgl_FragCoord
: .frag fragment coord inputgl_FragColor
: [#version 120] .frag color outputout vec4 outputColor;
: [#version 150] .frag color outputuniform float time;
: time input; input time value in ofApp.cpp withshader.setUniform1f("time", ofGetElapsedTimef());
uniform sampler2DRect tex0;
: texture input; input tex value in ofApp.cpp withshader.setUniformTexture("tex0", tex0Fbo.getTexture(), 1 );
maskTex.setTextureWrap(GL_CLAMP_TO_BORDER,GL_CLAMP_TO_BORDER);
: define no texture repetition
(use numkeys to switch between examples)
- Shader 1 + Shader 2 with alpha brush draw Fbo
Modified fragment shader codes 1, 2 by guil and ofShader example #7 to fit with openFrameworks setting.
- Shader 1 + Shader 2 with alpha shadow mov file
Modified fragment shader codes by wutzhuhn, guil, and ofShader example #7 to fit with openFrameworks setting.
Shadow mov clips from golanlevin.
With palette (reduces box noise)
ffmpeg -i example1.mov -vf scale=flags=lanczos,palettegen example1.palette.png -y
ffmpeg -i example1.mov -i example1.palette.png -filter_complex “fps=12,scale=360:-1:flags=lanczos[x],[x][1:v]paletteuse” example1.gif -y
Without palette
ffmpeg -i example1.mov -vf "fps=12, scale=360:-1" example1.gif