Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix depth alpha #316

Merged
merged 3 commits into from
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions test/integration/depth_camera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ void DepthCameraTest::DepthCameraBoxes(
EXPECT_EQ(0u, mr);
EXPECT_EQ(0u, mg);
EXPECT_GT(mb, 0u);
EXPECT_EQ(255u, ma);

// Far left and right points should be red (background color)
float lc = pointCloudData[pcLeft + 3];
Expand All @@ -268,7 +267,6 @@ void DepthCameraTest::DepthCameraBoxes(
EXPECT_EQ(255u, lr);
EXPECT_EQ(0u, lg);
EXPECT_EQ(0u, lb);
EXPECT_EQ(255u, la);

float rc = pointCloudData[pcRight + 3];
uint32_t *rrgba = reinterpret_cast<uint32_t *>(&rc);
Expand All @@ -280,7 +278,16 @@ void DepthCameraTest::DepthCameraBoxes(
EXPECT_EQ(255u, rr);
EXPECT_EQ(0u, rg);
EXPECT_EQ(0u, rb);
EXPECT_EQ(255u, ra);

// Note: internal texture format used is RGB with no alpha channel
// We observed the values can be either 255 or 0 but graphics card
// drivers are free to fill it with any value they want.
// This should be fixed in ogre 2.2 in ign-rendering6 which forbids
// forbids the use of RGB format.
iche033 marked this conversation as resolved.
Show resolved Hide resolved
// see https://github.com/ignitionrobotics/ign-rendering/issues/315
EXPECT_TRUE(255u == ma || 0u == ma);
EXPECT_TRUE(255u == la || 0u == la);
EXPECT_TRUE(255u == ra || 0u == ra);
}

// Check that for a box really close it returns it is not seen
Expand Down
17 changes: 10 additions & 7 deletions test/integration/render_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ void RenderPassTest::DepthGaussianNoise(const std::string &_renderEngine)
EXPECT_NEAR(0u, mr, colorNoiseTol);
EXPECT_NEAR(0u, mg, colorNoiseTol);
EXPECT_GT(mb, 0u);
EXPECT_EQ(255u, ma);

// Far left and right points should be red (background color)
float lc = pointCloudData[pcLeft + 3];
Expand All @@ -367,7 +366,6 @@ void RenderPassTest::DepthGaussianNoise(const std::string &_renderEngine)
EXPECT_NEAR(255u, lr, colorNoiseTol);
EXPECT_NEAR(0u, lg, colorNoiseTol);
EXPECT_NEAR(0u, lb, colorNoiseTol);
EXPECT_EQ(255u, la);

float rc = pointCloudData[pcRight + 3];
uint32_t *rrgba = reinterpret_cast<uint32_t *>(&rc);
Expand All @@ -379,7 +377,16 @@ void RenderPassTest::DepthGaussianNoise(const std::string &_renderEngine)
EXPECT_NEAR(255u, rr, colorNoiseTol);
EXPECT_NEAR(0u, rg, colorNoiseTol);
EXPECT_NEAR(0u, rb, colorNoiseTol);
EXPECT_EQ(255u, ra);

// Note: internal texture format used is RGB with no alpha channel
// We observed the values can be either 255 or 0 but graphics card
// drivers are free to fill it with any value they want.
// This should be fixed in ogre 2.2 in ign-rendering6 which forbids
// forbids the use of RGB format.
iche033 marked this conversation as resolved.
Show resolved Hide resolved
// see https://github.com/ignitionrobotics/ign-rendering/issues/315
EXPECT_TRUE(255u == ma || 0u == ma);
EXPECT_TRUE(255u == la || 0u == la);
EXPECT_TRUE(255u == ra || 0u == ra);
}

// Clean up
Expand All @@ -399,11 +406,7 @@ TEST_P(RenderPassTest, GaussianNoise)
}

/////////////////////////////////////////////////
#ifdef __APPLE__
TEST_P(RenderPassTest, DISABLED_DepthGaussianNoise)
#else
TEST_P(RenderPassTest, DepthGaussianNoise)
#endif
{
DepthGaussianNoise(GetParam());
}
Expand Down