|
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 | |
| MaterialAsset (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. | |
| 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 | |
| PipelineNames | type = NORMALS_SHADER |
| 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 |
Friends | |
| class | Ecs::ModelAssetPipeline |
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 20 of file MaterialAsset.h.
|
explicit |
Definition at line 6 of file MaterialAsset.cpp.
References Asset::AssetBase::AssetBase().
|
inlinenodiscard |
Get the type-safe base color texture handle.
Definition at line 87 of file MaterialAsset.h.
References baseColorTextureHandle_.
Referenced by EngineCore::RenderingDataManager::uploadMaterialBuffers().
|
inlinenodiscard |
Gets the base color texture path for this material.
Definition at line 56 of file MaterialAsset.h.
References baseColorTexturePath.
Referenced by EngineCore::RenderingDataManager::uploadMaterialBuffers().
| T & EngineCore::MaterialAsset::getData | ( | ) |
Method to get the material data from the ecs with the corresponding type.
| T | type of material data |
Definition at line 180 of file MaterialAsset.h.
References Asset::AssetBase::data, and Asset::AssetBase::mainRegistry.
Referenced by EngineCore::RenderingDataManager::uploadMaterialBuffers().
|
inlinenodiscard |
Get the type-safe emissive texture handle.
Definition at line 114 of file MaterialAsset.h.
References emissiveTextureHandle_.
Referenced by EngineCore::RenderingDataManager::uploadMaterialBuffers().
|
inlinenodiscard |
Definition at line 70 of file MaterialAsset.h.
References emissiveTexturePath.
Referenced by EngineCore::RenderingDataManager::uploadMaterialBuffers().
|
inlinenodiscard |
Get the type-safe lightmap texture handle.
Definition at line 123 of file MaterialAsset.h.
References lightmapTextureHandle_.
Referenced by EngineCore::RenderingDataManager::uploadMaterialBuffers().
|
inlinenodiscard |
Definition at line 71 of file MaterialAsset.h.
References lightmapTexturePath.
Referenced by EngineCore::RenderingDataManager::uploadMaterialBuffers().
|
inlinenodiscard |
Get the type-safe metallic-roughness texture handle.
Definition at line 105 of file MaterialAsset.h.
References metallicRoughnessTextureHandle_.
Referenced by EngineCore::RenderingDataManager::uploadMaterialBuffers().
|
inlinenodiscard |
Definition at line 69 of file MaterialAsset.h.
References metallicRoughnessTexturePath.
Referenced by EngineCore::RenderingDataManager::uploadMaterialBuffers().
|
inlinenodiscard |
Get the type-safe normal texture handle.
Definition at line 96 of file MaterialAsset.h.
References normalTextureHandle_.
Referenced by EngineCore::RenderingDataManager::uploadMaterialBuffers().
|
inlinenodiscard |
Definition at line 68 of file MaterialAsset.h.
References normalTexturePath.
Referenced by EngineCore::RenderingDataManager::uploadMaterialBuffers().
|
inlinenodiscard |
Gets the material type for pipeline lookup.
Definition at line 47 of file MaterialAsset.h.
References type.
Referenced by EngineCore::RenderingDataManager::uploadMaterialBuffers().
|
inline |
Set the base color texture handle (type-safe)
| h | Handle of type AlbedoTextureHandle |
Definition at line 129 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 65 of file MaterialAsset.h.
References baseColorTexturePath.
|
inline |
Set the emissive texture handle (type-safe)
| h | Handle of type EmissiveTextureHandle |
Definition at line 147 of file MaterialAsset.h.
References emissiveTextureHandle_.
|
inline |
Definition at line 75 of file MaterialAsset.h.
References emissiveTexturePath.
|
inline |
Set the lightmap texture handle (type-safe)
| h | Handle of type LightmapTextureHandle |
Definition at line 153 of file MaterialAsset.h.
References lightmapTextureHandle_.
|
inline |
Definition at line 76 of file MaterialAsset.h.
References lightmapTexturePath.
|
inline |
Set the metallic-roughness texture handle (type-safe)
| h | Handle of type MetallicRoughnessTextureHandle |
Definition at line 141 of file MaterialAsset.h.
References metallicRoughnessTextureHandle_.
|
inline |
Definition at line 74 of file MaterialAsset.h.
References metallicRoughnessTexturePath.
|
inline |
Set the normal texture handle (type-safe)
| h | Handle of type NormalTextureHandle |
Definition at line 135 of file MaterialAsset.h.
References normalTextureHandle_.
|
inline |
Definition at line 73 of file MaterialAsset.h.
References normalTexturePath.
|
overridevirtual |
Unload data.
Reimplemented from Asset::AssetBase.
Definition at line 11 of file MaterialAsset.cpp.
References EngineCore::NORMALS_SHADER, and type.
|
overrideprotectedvirtual |
Updates the loading state based on presence of material ECS components.
Reimplemented from Asset::AssetBase.
Definition at line 17 of file MaterialAsset.cpp.
References Asset::AssetBase::data, Asset::LOADED, Asset::LOADING, Asset::AssetBase::loadingState, Asset::AssetBase::mainRegistry, and Asset::UNLOADED.
|
friend |
Definition at line 21 of file MaterialAsset.h.
|
protected |
Definition at line 172 of file MaterialAsset.h.
Referenced by getBaseColorTextureHandle(), and setBaseColorTextureHandle().
|
protected |
Path to base color texture from glTF.
Definition at line 165 of file MaterialAsset.h.
Referenced by getBaseColorTexturePath(), and setBaseColorTexturePath().
|
protected |
Definition at line 175 of file MaterialAsset.h.
Referenced by getEmissiveTextureHandle(), and setEmissiveTextureHandle().
|
protected |
Path to emissive texture from glTF.
Definition at line 168 of file MaterialAsset.h.
Referenced by getEmissiveTexturePath(), and setEmissiveTexturePath().
|
protected |
Definition at line 176 of file MaterialAsset.h.
Referenced by getLightmapTextureHandle(), and setLightmapTextureHandle().
|
protected |
Path to lightmap texture from VulkanSchnee extension.
Definition at line 169 of file MaterialAsset.h.
Referenced by getLightmapTexturePath(), and setLightmapTexturePath().
|
protected |
Definition at line 174 of file MaterialAsset.h.
Referenced by getMetallicRoughnessTextureHandle(), and setMetallicRoughnessTextureHandle().
|
protected |
Path to metallic-roughness texture from glTF.
Definition at line 167 of file MaterialAsset.h.
Referenced by getMetallicRoughnessTexturePath(), and setMetallicRoughnessTexturePath().
|
protected |
Definition at line 173 of file MaterialAsset.h.
Referenced by getNormalTextureHandle(), and setNormalTextureHandle().
|
protected |
Path to normal map texture from glTF.
Definition at line 166 of file MaterialAsset.h.
Referenced by getNormalTexturePath(), and setNormalTexturePath().
|
protected |
Definition at line 164 of file MaterialAsset.h.
Referenced by getType(), Ecs::ModelAssetPipeline::processMaterial(), and unload().