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);
|
||||
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
|
||||
|
||||
|
|
|
@ -259,10 +259,7 @@ void ofApp::drawMain()
|
|||
boundShader.setUniform1i("u_init", 1);
|
||||
boundShader.render();
|
||||
boundShader.setUniform1i("u_init", 0);
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
boundShader.render();
|
||||
}
|
||||
boundShader.render();
|
||||
}
|
||||
|
||||
void ofApp::drawDebug()
|
||||
|
|
Loading…
Reference in a new issue