dropping boundary
This commit is contained in:
parent
1e3498fbdb
commit
577e093f96
2 changed files with 14 additions and 16 deletions
|
@ -176,20 +176,21 @@ void main() {
|
||||||
vec3 dispColor = vec3(0, 0, 0);
|
vec3 dispColor = vec3(0, 0, 0);
|
||||||
vec4 pointCloudColor = texture(u_ofcam, st);
|
vec4 pointCloudColor = texture(u_ofcam, st);
|
||||||
|
|
||||||
float maxVal = 0;
|
// float maxVal = 0;
|
||||||
float minVal = 1;
|
// float minVal = 1;
|
||||||
for (int i=0; i < 9; i++){
|
// for (int i=0; i < 9; i++){
|
||||||
float tmp = texture(u_buffer1, st2 + offset[i]/2).r > 0.5 ? 1 : 0;
|
// float tmp = texture(u_buffer1, st2 + offset[i]/2).r > 0.5 ? 1 : 0;
|
||||||
maxVal = max(maxVal, tmp);
|
// maxVal = max(maxVal, tmp);
|
||||||
minVal = min(minVal, tmp);
|
// minVal = min(minVal, tmp);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if(maxVal - minVal >= 0.5) {
|
// if(maxVal - minVal >= 0.5) {
|
||||||
dispColor.rgb = vec3(1);
|
// dispColor.rgb = vec3(1);
|
||||||
}
|
// }
|
||||||
|
|
||||||
gl_FragColor = vec4(dispColor, 1.0);
|
// gl_FragColor = vec4(dispColor, 1.0);
|
||||||
gl_FragColor.rgb += pointCloudColor.rgb; // not good
|
// gl_FragColor.rgb += pointCloudColor.rgb; // not good
|
||||||
|
gl_FragColor = vec4(mix(vec3(0), pointCloudColor.rgb, pointCloudColor.a), 1.0);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -259,10 +259,7 @@ void ofApp::drawMain()
|
||||||
boundShader.setUniform1i("u_init", 1);
|
boundShader.setUniform1i("u_init", 1);
|
||||||
boundShader.render();
|
boundShader.render();
|
||||||
boundShader.setUniform1i("u_init", 0);
|
boundShader.setUniform1i("u_init", 0);
|
||||||
for (int i = 0; i < 30; i++)
|
|
||||||
{
|
|
||||||
boundShader.render();
|
boundShader.render();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ofApp::drawDebug()
|
void ofApp::drawDebug()
|
||||||
|
|
Loading…
Reference in a new issue