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

Implement Hlms custom pieces swap for Objects & Terrain #545

Merged
merged 17 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ namespace ignition
/// Used by e.g. Segmentation camera mode
IORM_SOLID_COLOR,

/// \brief Like IORM_SOLID_COLOR, but if CustomParameter 2u
/// is present, raw diffuse texture will be multiplied against
/// the solid colour.
///
/// Also Unlit will behave as if IORM_NORMAL
///
/// Used by thermal camera
IORM_SOLID_THERMAL_COLOR_TEXTURED,

/// \brief Total number of rendering modes
IORM_COUNT,
};
Expand Down
21 changes: 11 additions & 10 deletions ogre2/include/ignition/rendering/ogre2/Ogre2MaterialSwitcher.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

#include <map>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

#include <ignition/math/Color.hh>
#include "ignition/rendering/config.hh"
Expand Down Expand Up @@ -80,17 +83,15 @@ namespace ignition
/// renderable name
private: std::map<unsigned int, std::string> colorDict;

/// \brief A map of ogre sub item pointer to their original hlms material
private: std::map<Ogre::SubItem *, Ogre::HlmsDatablock *> datablockMap;
/// \brief A map of ogre datablock pointer to their original blendblocks
private: std::unordered_map<Ogre::HlmsDatablock *,
const Ogre::HlmsBlendblock *> datablockMap;

/// \brief Ogre v1 material consisting of a shader that changes the
/// appearance of item to use a unique color for mouse picking
private: Ogre::MaterialPtr plainMaterial;

/// \brief Ogre v1 material consisting of a shader that changes the
/// appearance of item to use a unique color for mouse picking. In
/// addition, the depth check and depth write properties disabled.
private: Ogre::MaterialPtr plainOverlayMaterial;
/// \brief A map of ogre sub item pointer to their original low level
/// material.
/// Most objects don't use one so it should be almost always empty.
private:
std::vector<std::pair<Ogre::SubItem *, Ogre::MaterialPtr>> materialMap;

/// \brief Increment unique color value that will be assigned to the
/// next renderable
Expand Down
Loading