Skip to content

Commit

Permalink
Collada transparency is opposite. (#152)
Browse files Browse the repository at this point in the history
Signed-off-by: Nate Koenig <[email protected]>

Co-authored-by: Nate Koenig <[email protected]>
  • Loading branch information
nkoenig and Nate Koenig authored Jan 20, 2021

Verified

This commit was signed with the committer’s verified signature. The key has expired.
aramase Anish Ramasekar
1 parent 733b50b commit af8a83f
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion graphics/include/ignition/common/Material.hh
Original file line number Diff line number Diff line change
@@ -151,10 +151,12 @@ namespace ignition
public: math::Color Emissive() const;

/// \brief Set the transparency percentage (0..1)
/// \param[in] _t The amount of transparency (0..1)
/// \param[in] _t The amount of transparency (0..1) where a value of 1
/// is fully transparent and 0 is not transparent.
public: void SetTransparency(double _t);

/// \brief Get the transparency percentage (0..1)
/// A value of 1 is fully transparent and 0 is not transparent.
/// \return The transparency percentage
public: double Transparency() const;

4 changes: 3 additions & 1 deletion graphics/src/ColladaExporter.cc
Original file line number Diff line number Diff line change
@@ -723,7 +723,9 @@ void ColladaExporterPrivate::ExportEffects(
specularXml->LinkEndChild(colorXml);

// transparency
double transp = material->Transparency();
// In Collada, a transparency value of 1 is not transparent and 0 is
// fully transparent.
double transp = 1.0 - material->Transparency();

tinyxml2::XMLElement *transparencyXml =
_libraryEffectsXml->GetDocument()->NewElement("transparency");

0 comments on commit af8a83f

Please sign in to comment.