dropping boundary

This commit is contained in:
micuat 2020-10-26 10:49:40 +01:00
parent 1e3498fbdb
commit 577e093f96
2 changed files with 14 additions and 16 deletions

View file

@ -176,20 +176,21 @@ void main() {
vec3 dispColor = vec3(0, 0, 0);
vec4 pointCloudColor = texture(u_ofcam, st);
float maxVal = 0;
float minVal = 1;
for (int i=0; i < 9; i++){
float tmp = texture(u_buffer1, st2 + offset[i]/2).r > 0.5 ? 1 : 0;
maxVal = max(maxVal, tmp);
minVal = min(minVal, tmp);
}
// float maxVal = 0;
// float minVal = 1;
// for (int i=0; i < 9; i++){
// float tmp = texture(u_buffer1, st2 + offset[i]/2).r > 0.5 ? 1 : 0;
// maxVal = max(maxVal, tmp);
// minVal = min(minVal, tmp);
// }
if(maxVal - minVal >= 0.5) {
dispColor.rgb = vec3(1);
}
// if(maxVal - minVal >= 0.5) {
// dispColor.rgb = vec3(1);
// }
gl_FragColor = vec4(dispColor, 1.0);
gl_FragColor.rgb += pointCloudColor.rgb; // not good
// gl_FragColor = vec4(dispColor, 1.0);
// gl_FragColor.rgb += pointCloudColor.rgb; // not good
gl_FragColor = vec4(mix(vec3(0), pointCloudColor.rgb, pointCloudColor.a), 1.0);
#endif

View file

@ -259,11 +259,8 @@ void ofApp::drawMain()
boundShader.setUniform1i("u_init", 1);
boundShader.render();
boundShader.setUniform1i("u_init", 0);
for (int i = 0; i < 30; i++)
{
boundShader.render();
}
}
void ofApp::drawDebug()
{