|
Vulkan Schnee 0.0.1 (22840dc8)
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::MeshPath &assetPath, bool initWithDefaultData=false) | |
| Creates a material asset for a source mesh path. | |
| 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 |
| Gets the normal map texture path for this material. | |
| const std::filesystem::path & | getMetallicRoughnessTexturePath () const |
| Gets the metallic-roughness texture path for this material. | |
| const std::filesystem::path & | getEmissiveTexturePath () const |
| Gets the emissive texture path for this material. | |
| const std::filesystem::path & | getLightmapTexturePath () const |
| Gets the lightmap texture path for this material. | |
| void | setNormalTexturePath (const std::filesystem::path &path) |
| Sets the normal map texture path for this material. | |
| void | setMetallicRoughnessTexturePath (const std::filesystem::path &path) |
| Sets the metallic-roughness texture path for this material. | |
| void | setEmissiveTexturePath (const std::filesystem::path &path) |
| Sets the emissive texture path for this material. | |
| void | setLightmapTexturePath (const std::filesystem::path &path) |
| Sets the lightmap texture path for this material. | |
| Texture2DHandle | getBaseColorTextureHandle () const |
| Get the type-safe base color texture handle. | |
| Texture2DHandle | getNormalTextureHandle () const |
| Get the type-safe normal texture handle. | |
| Texture2DHandle | getMetallicRoughnessTextureHandle () const |
| Get the type-safe metallic-roughness texture handle. | |
| Texture2DHandle | getEmissiveTextureHandle () const |
| Get the type-safe emissive texture handle. | |
| Texture2DHandle | getLightmapTextureHandle () const |
| Get the type-safe lightmap texture handle. | |
| void | setBaseColorTextureHandle (Texture2DHandle h) |
| Set the base color texture handle (type-safe) | |
| void | setNormalTextureHandle (Texture2DHandle h) |
| Set the normal texture handle (type-safe) | |
| void | setMetallicRoughnessTextureHandle (Texture2DHandle h) |
| Set the metallic-roughness texture handle (type-safe) | |
| void | setEmissiveTextureHandle (Texture2DHandle h) |
| Set the emissive texture handle (type-safe) | |
| void | setLightmapTextureHandle (Texture2DHandle h) |
| Set the lightmap texture handle (type-safe) | |
| Public Member Functions inherited from Asset::AssetBase | |
| AssetBase (bool initializeDefaultEntity=false) | |
| Creates a base asset and optionally allocates its default ECS entity. | |
| virtual | ~AssetBase () |
| Releases base asset resources. | |
| 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 |
| Pipeline used to render this material. | |
| 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. | |
| Texture2DHandle | baseColorTextureHandle_ |
| Descriptor handle for the base color texture slot. | |
| Texture2DHandle | normalTextureHandle_ |
| Descriptor handle for the normal texture slot. | |
| Texture2DHandle | metallicRoughnessTextureHandle_ |
| Descriptor handle for the metallic-roughness texture slot. | |
| Texture2DHandle | emissiveTextureHandle_ |
| Descriptor handle for the emissive texture slot. | |
| Texture2DHandle | lightmapTextureHandle_ |
| Descriptor handle for the lightmap texture slot. | |
| Protected Attributes inherited from Asset::AssetBase | |
| CpuLoadingState | loadingState = UNLOADED |
| Current CPU loading state. | |
| entt::registry & | mainRegistry |
| Registry that owns this asset's ECS data. | |
| entt::entity | data |
| Entity containing the asset's component 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 |
Creates a material asset for a source mesh path.
| assetPath | Source mesh path used as the asset key. |
| initWithDefaultData | Whether to create backing ECS data immediately. |
|
inlinenodiscard |
Get the type-safe base color texture handle.
Definition at line 117 of file MaterialAsset.h.
References baseColorTextureHandle_.
|
inlinenodiscard |
Gets the base color texture path for this material.
Definition at line 58 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 195 of file MaterialAsset.h.
References Asset::AssetBase::data, and Asset::AssetBase::mainRegistry.
|
inlinenodiscard |
Get the type-safe emissive texture handle.
Definition at line 135 of file MaterialAsset.h.
References emissiveTextureHandle_.
|
inlinenodiscard |
Gets the emissive texture path for this material.
Definition at line 80 of file MaterialAsset.h.
References emissiveTexturePath.
|
inlinenodiscard |
Get the type-safe lightmap texture handle.
Definition at line 141 of file MaterialAsset.h.
References lightmapTextureHandle_.
|
inlinenodiscard |
Gets the lightmap texture path for this material.
Definition at line 85 of file MaterialAsset.h.
References lightmapTexturePath.
|
inlinenodiscard |
Get the type-safe metallic-roughness texture handle.
Definition at line 129 of file MaterialAsset.h.
References metallicRoughnessTextureHandle_.
|
inlinenodiscard |
Gets the metallic-roughness texture path for this material.
Definition at line 75 of file MaterialAsset.h.
References metallicRoughnessTexturePath.
|
inlinenodiscard |
Get the type-safe normal texture handle.
Definition at line 123 of file MaterialAsset.h.
References normalTextureHandle_.
|
inlinenodiscard |
Gets the normal map texture path for this material.
Definition at line 70 of file MaterialAsset.h.
References normalTexturePath.
|
inlinenodiscard |
Gets the material type for pipeline lookup.
Definition at line 52 of file MaterialAsset.h.
References type.
|
inline |
Set the base color texture handle (type-safe)
| h | Handle of type Texture2DHandle |
Definition at line 147 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 64 of file MaterialAsset.h.
References baseColorTexturePath.
|
inline |
Set the emissive texture handle (type-safe)
| h | Handle of type Texture2DHandle |
Definition at line 165 of file MaterialAsset.h.
References emissiveTextureHandle_.
|
inline |
Sets the emissive texture path for this material.
| path | Path to the texture file. |
Definition at line 103 of file MaterialAsset.h.
References emissiveTexturePath.
|
inline |
Set the lightmap texture handle (type-safe)
| h | Handle of type Texture2DHandle |
Definition at line 171 of file MaterialAsset.h.
References lightmapTextureHandle_.
|
inline |
Sets the lightmap texture path for this material.
| path | Path to the texture file. |
Definition at line 109 of file MaterialAsset.h.
References lightmapTexturePath.
|
inline |
Set the metallic-roughness texture handle (type-safe)
| h | Handle of type Texture2DHandle |
Definition at line 159 of file MaterialAsset.h.
References metallicRoughnessTextureHandle_.
|
inline |
Sets the metallic-roughness texture path for this material.
| path | Path to the texture file. |
Definition at line 97 of file MaterialAsset.h.
References metallicRoughnessTexturePath.
|
inline |
Set the normal texture handle (type-safe)
| h | Handle of type Texture2DHandle |
Definition at line 153 of file MaterialAsset.h.
References normalTextureHandle_.
|
inline |
Sets the normal map texture path for this material.
| path | Path to the texture file. |
Definition at line 91 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 |
Descriptor handle for the base color texture slot.
Definition at line 187 of file MaterialAsset.h.
Referenced by getBaseColorTextureHandle(), and setBaseColorTextureHandle().
|
protected |
Path to base color texture from glTF.
Definition at line 180 of file MaterialAsset.h.
Referenced by getBaseColorTexturePath(), and setBaseColorTexturePath().
|
protected |
Descriptor handle for the emissive texture slot.
Definition at line 190 of file MaterialAsset.h.
Referenced by getEmissiveTextureHandle(), and setEmissiveTextureHandle().
|
protected |
Path to emissive texture from glTF.
Definition at line 183 of file MaterialAsset.h.
Referenced by getEmissiveTexturePath(), and setEmissiveTexturePath().
|
protected |
Descriptor handle for the lightmap texture slot.
Definition at line 191 of file MaterialAsset.h.
Referenced by getLightmapTextureHandle(), and setLightmapTextureHandle().
|
protected |
Path to lightmap texture from VulkanSchnee extension.
Definition at line 184 of file MaterialAsset.h.
Referenced by getLightmapTexturePath(), and setLightmapTexturePath().
|
protected |
Descriptor handle for the metallic-roughness texture slot.
Definition at line 189 of file MaterialAsset.h.
Referenced by getMetallicRoughnessTextureHandle(), and setMetallicRoughnessTextureHandle().
|
protected |
Path to metallic-roughness texture from glTF.
Definition at line 182 of file MaterialAsset.h.
Referenced by getMetallicRoughnessTexturePath(), and setMetallicRoughnessTexturePath().
|
protected |
Descriptor handle for the normal texture slot.
Definition at line 188 of file MaterialAsset.h.
Referenced by getNormalTextureHandle(), and setNormalTextureHandle().
|
protected |
Path to normal map texture from glTF.
Definition at line 181 of file MaterialAsset.h.
Referenced by getNormalTexturePath(), and setNormalTexturePath().
|
protected |
Pipeline used to render this material.
Definition at line 179 of file MaterialAsset.h.
Referenced by getType().