PBRMaterialKit
-
class HPS::PBRMaterialKit : public HPS::Kit
The HPS::PBRMaterialKit class is a user space object, used for grouping attribute settings related to PBR materials.
Public Functions
-
virtual bool Empty() const
Indicates whether this object has any values set on it.
- Returns
true if no values are set on this object, false otherwise.
-
bool Equals(PBRMaterialKit const &in_kit) const
Check if the source PBRMaterialKit is equivalent to this object.
- Parameters
in_kit – The source PBRMaterialKit to compare to this object.
- Returns
true if the objects are equivalent, false otherwise.
-
inline virtual HPS::Type ObjectType() const
This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).
- Returns
The declared type of the object in question, which may differ from the true, underlying type.
-
bool operator!=(PBRMaterialKit const &in_kit) const
Check if the source PBRMaterialKit is not equivalent to this object.
- Parameters
in_kit – The source PBRMaterialKit to compare to this object.
- Returns
true if the objects are not equivalent, false otherwise.
-
PBRMaterialKit &operator=(PBRMaterialKit &&in_that)
The move assignment operator transfers the underlying impl of the rvalue reference to this PBRMaterialKit thereby avoiding a copy.
- Parameters
in_that – An rvalue reference to a PBRMaterialKit to take the impl from.
- Returns
A reference to this PBRMaterialKit.
-
PBRMaterialKit &operator=(PBRMaterialKit const &in_kit)
Copies the source PBRMaterialKit into this object.
- Parameters
in_kit – The source PBRMaterialKit to copy.
- Returns
A reference to this object.
-
bool operator==(PBRMaterialKit const &in_kit) const
Check if the source PBRMaterialKit is equivalent to this object.
- Parameters
in_kit – The source PBRMaterialKit to compare to this object.
- Returns
true if the objects are equivalent, false otherwise.
-
PBRMaterialKit()
Initializes an empty kit.
-
PBRMaterialKit(PBRMaterialKit &&in_that)
The move constructor creates a PBRMaterialKit by transferring the underlying impl of the rvalue reference to this MaterialMappingKit thereby avoiding a copy and allocation.
- Parameters
in_that – An rvalue reference to a PBRMaterialKit to take the impl from.
-
PBRMaterialKit(PBRMaterialKit const &in_kit)
The copy constructor creates a new PBRMaterialKit object that contains the same settings as the source object.
- Parameters
in_kit – The source object to copy.
-
void Set(PBRMaterialKit const &in_kit)
Copies all settings from the source PBRMaterialKit into this object.
- Parameters
in_kit – The source PBRMaterialKit to copy.
-
PBRMaterialKit &SetAlphaFactor(float in_factor, bool in_mask = false)
Sets the alpha factor which scales the alpha map or acts as the alpha if no map exists.
- Parameters
in_factor – The factor to use.
in_mask – Sets if the alpha acts as a mask.
- Returns
A reference to this object.
-
PBRMaterialKit &SetBaseColorFactor(HPS::RGBAColor const &in_color)
Sets the base color factor which either scales the base color map or acts as a base color directly if no map exists.
- Parameters
in_color – The base color factor to use.
- Returns
A reference to this object.
-
PBRMaterialKit &SetBaseColorMap(char const *in_texture_name)
Sets the base color map.
- Parameters
in_texture_name – The base color factor to use.
- Returns
A reference to this object.
-
PBRMaterialKit &SetEmissiveMap(char const *in_texture_name)
Sets the emissive map.
- Parameters
in_texture_name – The base color factor to use.
- Returns
A reference to this object.
-
PBRMaterialKit &SetMetalnessFactor(float in_factor)
Sets the metalness factor which scales the metalness map or acts as the metalness if no map exists.
- Parameters
in_factor – The factor to use.
- Returns
A reference to this object.
-
PBRMaterialKit &SetMetalnessMap(char const *in_texture_name, HPS::Material::Texture::ChannelMapping in_channel = HPS::Material::Texture::ChannelMapping::Red)
Sets the metalness map.
- Parameters
in_texture_name – The base color factor to use.
in_channel – The color channel from the map to use.
- Returns
A reference to this object.
-
PBRMaterialKit &SetNormalFactor(float in_factor)
Sets the normal factor which scales the normal map.
- Parameters
in_factor – The factor to use.
- Returns
A reference to this object.
-
PBRMaterialKit &SetNormalMap(char const *in_texture_name)
Sets the normal map.
- Parameters
in_texture_name – The base color factor to use.
- Returns
A reference to this object.
-
PBRMaterialKit &SetOcclusionFactor(float in_factor)
Sets the occlusion factor which scales the occlusion map.
- Parameters
in_factor – The factor to use.
- Returns
A reference to this object.
-
PBRMaterialKit &SetOcclusionMap(char const *in_texture_name, HPS::Material::Texture::ChannelMapping in_channel = HPS::Material::Texture::ChannelMapping::Blue)
Sets the occlusion map.
- Parameters
in_texture_name – The base color factor to use.
in_channel – The color channel from the map to use.
- Returns
A reference to this object.
-
PBRMaterialKit &SetRoughnessFactor(float in_factor)
Sets the roughness factor which scales the roughness map or acts as the roughness if no map exists.
- Parameters
in_factor – The factor to use.
- Returns
A reference to this object.
-
PBRMaterialKit &SetRoughnessMap(char const *in_texture_name, HPS::Material::Texture::ChannelMapping in_channel = HPS::Material::Texture::ChannelMapping::Green)
Sets the roughness map.
- Parameters
in_texture_name – The base color factor to use.
in_channel – The color channel from the map to use.
- Returns
A reference to this object.
-
void Show(PBRMaterialKit &out_kit) const
Copies all settings from this PBRMaterialKit into the given PBRMaterialKit.
- Parameters
out_kit – The PBRMaterialKit to populate with the contents of this object.
-
bool ShowAlphaFactor(float &out_factor, bool &out_mask) const
Shows the alpha factor and alpha mask.
- Parameters
out_factor – The alpha factor if set.
out_mask – The alpha mask value.
- Returns
true if the setting is valid, false otherwise.
-
bool ShowBaseColorFactor(HPS::RGBAColor &out_color) const
Shows the base color factor.
- Parameters
out_color – The base color factor if set.
- Returns
true if the setting is valid, false otherwise.
-
bool ShowBaseColorMap(UTF8 &out_texture_name) const
Shows the base color map name.
- Parameters
out_texture_name – The base color map name if set.
- Returns
true if the setting is valid, false otherwise.
-
bool ShowEmissiveMap(UTF8 &out_texture_name) const
Shows the emissive map name.
- Parameters
out_texture_name – The emissive map name if set.
- Returns
true if the setting is valid, false otherwise.
-
bool ShowMetalnessFactor(float &out_factor) const
Shows the metalness factor.
- Parameters
out_factor – The metalness if set.
- Returns
true if the setting is valid, false otherwise.
-
bool ShowMetalnessMap(UTF8 &out_texture_name, HPS::Material::Texture::ChannelMapping &out_channel) const
Shows the metalness map name.
- Parameters
out_texture_name – The metalness map name if set.
out_channel – The channel.
- Returns
true if the setting is valid, false otherwise.
-
bool ShowNormalFactor(float &out_factor) const
Shows the normal factor.
- Parameters
out_factor – The normal factor if set.
- Returns
true if the setting is valid, false otherwise.
-
bool ShowNormalMap(UTF8 &out_texture_name) const
Shows the normal map name.
- Parameters
out_texture_name – The normal map name if set.
- Returns
true if the setting is valid, false otherwise.
-
bool ShowOcclusionFactor(float &out_factor) const
Shows the occlusion factor.
- Parameters
out_factor – The occlusion if set.
- Returns
true if the setting is valid, false otherwise.
-
bool ShowOcclusionMap(UTF8 &out_texture_name, HPS::Material::Texture::ChannelMapping &out_channel) const
Shows the occlusion map name.
- Parameters
out_texture_name – The occlusion map name if set.
out_channel – The channel.
- Returns
true if the setting is valid, false otherwise.
-
bool ShowRoughnessFactor(float &out_factor) const
Shows the roughness factor.
- Parameters
out_factor – The roughness if set.
- Returns
true if the setting is valid, false otherwise.
-
bool ShowRoughnessMap(UTF8 &out_texture_name, HPS::Material::Texture::ChannelMapping &out_channel) const
Shows the roughness map name.
- Parameters
out_texture_name – The roughness map name if set.
out_channel – The channel.
- Returns
true if the setting is valid, false otherwise.
-
PBRMaterialKit &UnsetAlphaFactor()
Removes the alpha factor from this kit type.
- Returns
A reference to this object.
-
PBRMaterialKit &UnsetBaseColorFactor()
Removes the base color factor from this kit type.
- Returns
A reference to this object.
-
PBRMaterialKit &UnsetBaseColorMap()
Removes the base color map from this kit type.
- Returns
A reference to this object.
-
PBRMaterialKit &UnsetEmissiveMap()
Removes the emissive map from this kit type.
- Returns
A reference to this object.
-
PBRMaterialKit &UnsetEverything()
Removes all settings from this object.
- Returns
A reference to this object.
-
PBRMaterialKit &UnsetMetalnessFactor()
Removes the metalness factor from this kit type.
- Returns
A reference to this object.
-
PBRMaterialKit &UnsetMetalnessMap()
Removes the metalness map from this kit type.
- Returns
A reference to this object.
-
PBRMaterialKit &UnsetNormalFactor()
Removes the normal factor from this kit type.
- Returns
A reference to this object.
-
PBRMaterialKit &UnsetNormalMap()
Removes the normal map from this kit type.
- Returns
A reference to this object.
-
PBRMaterialKit &UnsetOcclusionFactor()
Removes the occlusion factor from this kit type.
- Returns
A reference to this object.
-
PBRMaterialKit &UnsetOcclusionMap()
Removes the occlusion map from this kit type.
- Returns
A reference to this object.
-
PBRMaterialKit &UnsetRoughnessFactor()
Removes the roughness factor from this kit type.
- Returns
A reference to this object.
-
PBRMaterialKit &UnsetRoughnessMap()
Removes the roughness map from this kit type.
- Returns
A reference to this object.
-
~PBRMaterialKit()
Destroy this kit.
Public Static Functions
-
static PBRMaterialKit GetDefault()
Creates a HPS::PBRMaterialKit which contains the default settings. The returned object will not necessarily have values set for every option, but it will have settings for those options where it is reasonable to have a default.
- Returns
A PBRMaterialKit with the default settings.
Public Static Attributes
-
static const HPS::Type staticType = HPS::Type::PBRMaterialKit
-
virtual bool Empty() const