Skip to content

Glsl occlusion - #6299

Merged
dorodnic merged 15 commits into
realsenseai:developmentfrom
gwen2018:glsl_occlusion
Apr 27, 2020
Merged

Glsl occlusion#6299
dorodnic merged 15 commits into
realsenseai:developmentfrom
gwen2018:glsl_occlusion

Conversation

@gwen2018

Copy link
Copy Markdown
Contributor

implement occlusion removal on gpu with glsl

@dorodnic

Copy link
Copy Markdown
Contributor

Great job @nohayassin @gwen2018
I'm testing GPU version and see that the algorithm is too aggressive - invalidates also points from foreground. Not sure why yet...

@dorodnic

Copy link
Copy Markdown
Contributor

@gwen2018 - found the issue:
if (uv[i].x > uvmax)\n" needs to be if (uv[i].x > uvmax && xyz[i].z > 0.0)\n"

Comment thread src/gl/pointcloud-gl.cpp Outdated
project_fragment_text,
"position", "textureCoords",
"output_xyz", "output_uv"))
"texture_xyz", "texture_uv"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is concerning to me. It would be better to use output_xyz in occlusion shaders output_uv or texture_xyz and texture_uv in the pointcloud shader.
From what I recall, most graphic card drivers are ignoring these names and just bind first out variable to the first attachment and second to second. However, I remember in my testing I have encountered specific GPU models that failed to run unless correct out variable names were specified.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching the glsl shader over aggresive issue, fixed as suggested.

The output variable names were mismatched by mistake, texture_xyz and texture_uv output names in occlusion shader, and output_xyz and output_uv in the pointcloud shader, both should match what's defined in the shaders. I have corrected it. Thanks for catching this error.

Comment thread src/proc/occlusion-filter.cpp Outdated
{

{
scoped_timer t1("Horizontal Scan");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gwen2018 - please remove the two scoped_timers from the CPU version

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed.

@dorodnic
dorodnic merged commit f159b9d into realsenseai:development Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants