Skip to content

Commit

Permalink
Use Anti-aliasing SDF element when setting up camera
Browse files Browse the repository at this point in the history
Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
  • Loading branch information
WilliamLewww committed Mar 24, 2022
1 parent 9747cc1 commit 7741aa7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gazebo/rendering/Camera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ Camera::Camera(const std::string &_name, ScenePtr _scene,

this->dataPtr->node = transport::NodePtr(new transport::Node());
this->dataPtr->node->Init();

this->dataPtr->antiAliasingValue = 4;
}

//////////////////////////////////////////////////
Expand All @@ -143,6 +145,8 @@ void Camera::Load()
this->imageHeight = imgElem->Get<int>("height");
this->imageFormat = this->OgrePixelFormat(
imgElem->Get<std::string>("format"));

this->dataPtr->antiAliasingValue = imgElem->Get<int>("anti_aliasing");
}
else
gzthrow("Camera has no <image> tag.");
Expand Down Expand Up @@ -1480,7 +1484,7 @@ void Camera::CreateRenderTexture(const std::string &_textureName)
RenderEngine::Instance()->FSAALevels();

// check if target fsaa is supported
unsigned int targetFSAA = 4;
unsigned int targetFSAA = this->dataPtr->antiAliasingValue;
auto const it = std::find(fsaaLevels.begin(), fsaaLevels.end(), targetFSAA);
if (it != fsaaLevels.end())
fsaa = targetFSAA;
Expand Down
3 changes: 3 additions & 0 deletions gazebo/rendering/CameraPrivate.hh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ namespace gazebo

/// \brief Fixed axis to yaw around.
public: ignition::math::Vector3d yawFixedAxis;

/// \brief Anti-aliasing value
public: uint32_t antiAliasingValue;
};
}
}
Expand Down

0 comments on commit 7741aa7

Please sign in to comment.