|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
the material asset is another wrapper for asset data which is stored in entt. It has the EngineCore::MaterialAsset::type member variable which corresponds to the component used to store the material data More...
#include <MaterialAsset.h>
Public Member Functions | |
| Material (const Asset::Path &assetPath, bool initWithDefaultData=false) | |
| template<typename T> | |
| T & | getData () |
| Method to get the material data from the ecs with the corresponding type. | |
| void | unload () override |
| Unload data. | |
| Rendering::PipelineNames | getType () const |
| Gets the material type for pipeline lookup. | |
| const std::filesystem::path & | getBaseColorTexturePath () const |
| Gets the base color texture path for this material. | |
| void | setBaseColorTexturePath (const std::filesystem::path &path) |
| Sets the base color texture path for this material. | |
| const std::filesystem::path & | getNormalTexturePath () const |
| const std::filesystem::path & | getMetallicRoughnessTexturePath () const |
| const std::filesystem::path & | getEmissiveTexturePath () const |
| const std::filesystem::path & | getLightmapTexturePath () const |
| void | setNormalTexturePath (const std::filesystem::path &path) |
| void | setMetallicRoughnessTexturePath (const std::filesystem::path &path) |
| void | setEmissiveTexturePath (const std::filesystem::path &path) |
| void | setLightmapTexturePath (const std::filesystem::path &path) |
| AlbedoTextureHandle | getBaseColorTextureHandle () const |
| Get the type-safe base color texture handle. | |
| NormalTextureHandle | getNormalTextureHandle () const |
| Get the type-safe normal texture handle. | |
| MetallicRoughnessTextureHandle | getMetallicRoughnessTextureHandle () const |
| Get the type-safe metallic-roughness texture handle. | |
| EmissiveTextureHandle | getEmissiveTextureHandle () const |
| Get the type-safe emissive texture handle. | |
| LightmapTextureHandle | getLightmapTextureHandle () const |
| Get the type-safe lightmap texture handle. | |
| void | setBaseColorTextureHandle (AlbedoTextureHandle h) |
| Set the base color texture handle (type-safe) | |
| void | setNormalTextureHandle (NormalTextureHandle h) |
| Set the normal texture handle (type-safe) | |
| void | setMetallicRoughnessTextureHandle (MetallicRoughnessTextureHandle h) |
| Set the metallic-roughness texture handle (type-safe) | |
| void | setEmissiveTextureHandle (EmissiveTextureHandle h) |
| Set the emissive texture handle (type-safe) | |
| void | setLightmapTextureHandle (LightmapTextureHandle h) |
| Set the lightmap texture handle (type-safe) | |
| Public Member Functions inherited from Asset::AssetBase | |
| AssetBase (bool initializeDefaultEntity=false) | |
| virtual | ~AssetBase () |
| CpuLoadingState | getLoadingState () |
| Gets the loading state of this asset. | |
| void | requestLoad () |
| If this asset is in the UNLOADED state it will get added to the assets to load. | |
| entt::entity | getEntity () const |
| Getter for data. | |
Protected Member Functions | |
| void | updateLoadingState () override |
| Updates the loading state based on presence of material ECS components. | |
Protected Attributes | |
| Rendering::PipelineNames | type = DEFAULT_MATERIAL_PIPELINE |
| std::filesystem::path | baseColorTexturePath |
| Path to base color texture from glTF. | |
| std::filesystem::path | normalTexturePath |
| Path to normal map texture from glTF. | |
| std::filesystem::path | metallicRoughnessTexturePath |
| Path to metallic-roughness texture from glTF. | |
| std::filesystem::path | emissiveTexturePath |
| Path to emissive texture from glTF. | |
| std::filesystem::path | lightmapTexturePath |
| Path to lightmap texture from VulkanSchnee extension. | |
| AlbedoTextureHandle | baseColorTextureHandle_ |
| NormalTextureHandle | normalTextureHandle_ |
| MetallicRoughnessTextureHandle | metallicRoughnessTextureHandle_ |
| EmissiveTextureHandle | emissiveTextureHandle_ |
| LightmapTextureHandle | lightmapTextureHandle_ |
| Protected Attributes inherited from Asset::AssetBase | |
| CpuLoadingState | loadingState = UNLOADED |
| entt::registry & | mainRegistry |
| entt::entity | data |
the material asset is another wrapper for asset data which is stored in entt. It has the EngineCore::MaterialAsset::type member variable which corresponds to the component used to store the material data
Definition at line 23 of file MaterialAsset.h.
|
explicit |
|
inlinenodiscard |
Get the type-safe base color texture handle.
Definition at line 78 of file MaterialAsset.h.
References baseColorTextureHandle_.
|
inlinenodiscard |
Gets the base color texture path for this material.
Definition at line 53 of file MaterialAsset.h.
References baseColorTexturePath.
| T & Engine::Assets::Material::getData | ( | ) |
Method to get the material data from the ecs with the corresponding type.
| T | type of material data |
Definition at line 156 of file MaterialAsset.h.
References Asset::AssetBase::data, and Asset::AssetBase::mainRegistry.
|
inlinenodiscard |
Get the type-safe emissive texture handle.
Definition at line 96 of file MaterialAsset.h.
References emissiveTextureHandle_.
|
inlinenodiscard |
Definition at line 64 of file MaterialAsset.h.
References emissiveTexturePath.
|
inlinenodiscard |
Get the type-safe lightmap texture handle.
Definition at line 102 of file MaterialAsset.h.
References lightmapTextureHandle_.
|
inlinenodiscard |
Definition at line 65 of file MaterialAsset.h.
References lightmapTexturePath.
|
inlinenodiscard |
Get the type-safe metallic-roughness texture handle.
Definition at line 90 of file MaterialAsset.h.
References metallicRoughnessTextureHandle_.
|
inlinenodiscard |
Definition at line 63 of file MaterialAsset.h.
References metallicRoughnessTexturePath.
|
inlinenodiscard |
Get the type-safe normal texture handle.
Definition at line 84 of file MaterialAsset.h.
References normalTextureHandle_.
|
inlinenodiscard |
Definition at line 62 of file MaterialAsset.h.
References normalTexturePath.
|
inlinenodiscard |
Gets the material type for pipeline lookup.
Definition at line 47 of file MaterialAsset.h.
References type.
|
inline |
Set the base color texture handle (type-safe)
| h | Handle of type AlbedoTextureHandle |
Definition at line 108 of file MaterialAsset.h.
References baseColorTextureHandle_.
|
inline |
Sets the base color texture path for this material.
| path | Path to the texture file |
Definition at line 59 of file MaterialAsset.h.
References baseColorTexturePath.
|
inline |
Set the emissive texture handle (type-safe)
| h | Handle of type EmissiveTextureHandle |
Definition at line 126 of file MaterialAsset.h.
References emissiveTextureHandle_.
|
inline |
Definition at line 69 of file MaterialAsset.h.
References emissiveTexturePath.
|
inline |
Set the lightmap texture handle (type-safe)
| h | Handle of type LightmapTextureHandle |
Definition at line 132 of file MaterialAsset.h.
References lightmapTextureHandle_.
|
inline |
Definition at line 70 of file MaterialAsset.h.
References lightmapTexturePath.
|
inline |
Set the metallic-roughness texture handle (type-safe)
| h | Handle of type MetallicRoughnessTextureHandle |
Definition at line 120 of file MaterialAsset.h.
References metallicRoughnessTextureHandle_.
|
inline |
Definition at line 68 of file MaterialAsset.h.
References metallicRoughnessTexturePath.
|
inline |
Set the normal texture handle (type-safe)
| h | Handle of type NormalTextureHandle |
Definition at line 114 of file MaterialAsset.h.
References normalTextureHandle_.
|
inline |
Definition at line 67 of file MaterialAsset.h.
References normalTexturePath.
|
overridevirtual |
Unload data.
Reimplemented from Asset::AssetBase.
|
overrideprotectedvirtual |
Updates the loading state based on presence of material ECS components.
Reimplemented from Asset::AssetBase.
|
protected |
Definition at line 148 of file MaterialAsset.h.
Referenced by getBaseColorTextureHandle(), and setBaseColorTextureHandle().
|
protected |
Path to base color texture from glTF.
Definition at line 141 of file MaterialAsset.h.
Referenced by getBaseColorTexturePath(), and setBaseColorTexturePath().
|
protected |
Definition at line 151 of file MaterialAsset.h.
Referenced by getEmissiveTextureHandle(), and setEmissiveTextureHandle().
|
protected |
Path to emissive texture from glTF.
Definition at line 144 of file MaterialAsset.h.
Referenced by getEmissiveTexturePath(), and setEmissiveTexturePath().
|
protected |
Definition at line 152 of file MaterialAsset.h.
Referenced by getLightmapTextureHandle(), and setLightmapTextureHandle().
|
protected |
Path to lightmap texture from VulkanSchnee extension.
Definition at line 145 of file MaterialAsset.h.
Referenced by getLightmapTexturePath(), and setLightmapTexturePath().
|
protected |
Definition at line 150 of file MaterialAsset.h.
Referenced by getMetallicRoughnessTextureHandle(), and setMetallicRoughnessTextureHandle().
|
protected |
Path to metallic-roughness texture from glTF.
Definition at line 143 of file MaterialAsset.h.
Referenced by getMetallicRoughnessTexturePath(), and setMetallicRoughnessTexturePath().
|
protected |
Definition at line 149 of file MaterialAsset.h.
Referenced by getNormalTextureHandle(), and setNormalTextureHandle().
|
protected |
Path to normal map texture from glTF.
Definition at line 142 of file MaterialAsset.h.
Referenced by getNormalTexturePath(), and setNormalTexturePath().
|
protected |
Definition at line 140 of file MaterialAsset.h.
Referenced by getType().