|
Unravel Engine C++ Reference
|
Class for physically-based rendering (PBR) materials. More...
#include <material.h>
Public Member Functions | |
| auto | clone () const -> std::shared_ptr< material > override |
| auto | get_base_color () const -> const math::color & |
| Gets the base color of the material. | |
| void | set_base_color (const math::color &val) |
| Sets the base color of the material. | |
| auto | get_subsurface_color () const -> const math::color & |
| Gets the subsurface color of the material. | |
| void | set_subsurface_color (const math::color &val) |
| Sets the subsurface color of the material. | |
| auto | get_emissive_color () const -> const math::color & |
| Gets the emissive color of the material. | |
| void | set_emissive_color (const math::color &val) |
| Sets the emissive color of the material. | |
| auto | get_emissive_intensity () const -> float |
| void | set_emissive_intensity (float val) |
| auto | get_roughness () const -> float |
| Gets the roughness of the material. | |
| void | set_roughness (float roughness) |
| Sets the roughness of the material. | |
| auto | get_metalness () const -> float |
| Gets the metalness of the material. | |
| void | set_metalness (float metalness) |
| Sets the metalness of the material. | |
| auto | get_bumpiness () const -> float |
| Gets the bumpiness of the material. | |
| void | set_bumpiness (float bumpiness) |
| Sets the bumpiness of the material. | |
| auto | get_alpha_mode () const -> alpha_mode |
| Gets the alpha mode (opaque / mask / blend). | |
| void | set_alpha_mode (alpha_mode mode) |
| Sets the alpha mode. | |
| auto | get_alpha_cutoff () const -> float |
| Gets the alpha cutoff used when alpha_mode is alpha_mode::mask. | |
| void | set_alpha_cutoff (float cutoff) |
| Sets the alpha cutoff for alpha_mode::mask materials. | |
| auto | uses_alpha_cutout () const -> bool |
| True when alpha_mode is alpha_mode::mask (hard alpha clip + cutout shadows). | |
| auto | casts_shadow () const -> bool |
| True when this material should contribute to shadow maps. | |
| auto | make_shadow_cutout_state () const -> shadow_cutout_state |
| Snapshot of shader state needed by the shadow cutout pass. | |
| void | infer_alpha_mode_from_legacy_cutoff () |
| Infer alpha_mode when loading legacy assets that only stored a cutoff value. | |
| auto | get_surface_data () const -> const math::vec4 & |
| Gets the surface data of the material. | |
| auto | get_surface_data2 () const -> math::vec4 |
| Gets additional surface data for the material. | |
| auto | metalness_roughness_combined () const -> bool |
| auto | get_tiling () const -> const math::vec2 & |
| Gets the tiling factor of the material. | |
| void | set_tiling (const math::vec2 &tiling) |
| Sets the tiling factor of the material. | |
| auto | get_dither_threshold () const -> const math::vec2 & |
| Gets the dither threshold of the material. | |
| void | set_dither_threshold (const math::vec2 &threshold) |
| Sets the dither threshold of the material. | |
| auto | get_color_map () const -> const asset_handle< gfx::texture > & |
| Gets the color map of the material. | |
| void | set_color_map (const asset_handle< gfx::texture > &val) |
| Sets the color map of the material. | |
| auto | get_normal_map () const -> const asset_handle< gfx::texture > & |
| Gets the normal map of the material. | |
| void | set_normal_map (const asset_handle< gfx::texture > &val) |
| Sets the normal map of the material. | |
| auto | get_roughness_map () const -> const asset_handle< gfx::texture > & |
| Gets the roughness map of the material. | |
| void | set_roughness_map (const asset_handle< gfx::texture > &val) |
| Sets the roughness map of the material. | |
| auto | get_metalness_map () const -> const asset_handle< gfx::texture > & |
| Gets the metalness map of the material. | |
| void | set_metalness_map (const asset_handle< gfx::texture > &val) |
| Sets the metalness map of the material. | |
| auto | get_ao_map () const -> const asset_handle< gfx::texture > & |
| Gets the ambient occlusion map of the material. | |
| void | set_ao_map (const asset_handle< gfx::texture > &val) |
| Sets the ambient occlusion map of the material. | |
| auto | get_emissive_map () const -> const asset_handle< gfx::texture > & |
| Gets the emissive map of the material. | |
| void | set_emissive_map (const asset_handle< gfx::texture > &val) |
| Sets the emissive map of the material. | |
Public Member Functions inherited from crtp_meta_type< pbr_material, material > | |
| virtual auto | get_meta_type () const -> entt::meta_type |
| auto | is () const -> bool |
| auto | is (const entt::meta_type &type) const -> bool |
| virtual auto | as_derived () -> entt::meta_any |
Additional Inherited Members | |
Static Public Member Functions inherited from crtp_meta_type< pbr_material, material > | |
| static auto | get_static_meta_type () -> entt::meta_type |
Class for physically-based rendering (PBR) materials.
Definition at line 111 of file material.h.
|
nodiscard |
True when this material should contribute to shadow maps.
Definition at line 117 of file material.cpp.
|
override |
Definition at line 85 of file material.cpp.
|
inline |
Gets the alpha cutoff used when alpha_mode is alpha_mode::mask.
Definition at line 252 of file material.h.
|
inline |
Gets the alpha mode (opaque / mask / blend).
Definition at line 239 of file material.h.
|
inline |
Gets the ambient occlusion map of the material.
Definition at line 417 of file material.h.
|
inline |
Gets the base color of the material.
Definition at line 122 of file material.h.
|
inline |
Gets the bumpiness of the material.
Definition at line 222 of file material.h.
|
inline |
Gets the color map of the material.
Definition at line 345 of file material.h.
|
inline |
Gets the dither threshold of the material.
Definition at line 327 of file material.h.
|
inline |
Gets the emissive color of the material.
Definition at line 158 of file material.h.
|
inline |
Definition at line 172 of file material.h.
|
inline |
Gets the emissive map of the material.
Definition at line 435 of file material.h.
|
inline |
Gets the metalness of the material.
Definition at line 204 of file material.h.
|
inline |
Gets the metalness map of the material.
Definition at line 399 of file material.h.
|
inline |
Gets the normal map of the material.
Definition at line 363 of file material.h.
|
inline |
Gets the roughness of the material.
Definition at line 186 of file material.h.
|
inline |
Gets the roughness map of the material.
Definition at line 381 of file material.h.
|
inline |
Gets the subsurface color of the material.
Definition at line 140 of file material.h.
|
inline |
Gets the surface data of the material.
Definition at line 278 of file material.h.
|
inline |
Gets additional surface data for the material.
Definition at line 287 of file material.h.
|
inline |
Gets the tiling factor of the material.
Definition at line 309 of file material.h.
| void unravel::pbr_material::infer_alpha_mode_from_legacy_cutoff | ( | ) |
Infer alpha_mode when loading legacy assets that only stored a cutoff value.
Definition at line 134 of file material.cpp.
|
nodiscard |
Snapshot of shader state needed by the shadow cutout pass.
Definition at line 122 of file material.cpp.
|
inline |
Definition at line 300 of file material.h.
| void unravel::pbr_material::set_alpha_cutoff | ( | float | cutoff | ) |
Sets the alpha cutoff for alpha_mode::mask materials.
Definition at line 97 of file material.cpp.
| void unravel::pbr_material::set_alpha_mode | ( | alpha_mode | mode | ) |
Sets the alpha mode.
Definition at line 91 of file material.cpp.
|
inline |
Sets the ambient occlusion map of the material.
| val | The ambient occlusion map asset handle to set. |
Definition at line 426 of file material.h.
|
inline |
Sets the base color of the material.
| val | The base color to set. |
Definition at line 131 of file material.h.
|
inline |
Sets the bumpiness of the material.
| bumpiness | The bumpiness value to set. |
Definition at line 231 of file material.h.
|
inline |
Sets the color map of the material.
| val | The color map asset handle to set. |
Definition at line 354 of file material.h.
|
inline |
Sets the dither threshold of the material.
| threshold | The dither threshold to set. |
Definition at line 336 of file material.h.
|
inline |
Sets the emissive color of the material.
| val | The emissive color to set. |
Definition at line 167 of file material.h.
|
inline |
Definition at line 177 of file material.h.
|
inline |
Sets the emissive map of the material.
| val | The emissive map asset handle to set. |
Definition at line 444 of file material.h.
|
inline |
Sets the metalness of the material.
| metalness | The metalness value to set. |
Definition at line 213 of file material.h.
|
inline |
Sets the metalness map of the material.
| val | The metalness map asset handle to set. |
Definition at line 408 of file material.h.
|
inline |
Sets the normal map of the material.
| val | The normal map asset handle to set. |
Definition at line 372 of file material.h.
|
inline |
Sets the roughness of the material.
| roughness | The roughness value to set. |
Definition at line 195 of file material.h.
|
inline |
Sets the roughness map of the material.
| val | The roughness map asset handle to set. |
Definition at line 390 of file material.h.
|
inline |
Sets the subsurface color of the material.
| val | The subsurface color to set. |
Definition at line 149 of file material.h.
|
inline |
Sets the tiling factor of the material.
| tiling | The tiling factor to set. |
Definition at line 318 of file material.h.
|
nodiscard |
True when alpha_mode is alpha_mode::mask (hard alpha clip + cutout shadows).
Definition at line 112 of file material.cpp.