![]() |
XII Release 0.1.0
|
Per-decal material defaults shared by projected and mesh decals. More...
#include <DecalResource.h>
Public Member Functions | |
| xiiResult | Validate () const |
| Validates finite rendering parameters and the atlas lookup identity. | |
| xiiResult | Serialize (xiiStreamWriter &stream) const |
| Preserves the native version-one field layout. Propagates write failures. | |
| xiiResult | Deserialize (xiiStreamReader &stream) |
| Rejects invalid or truncated data without changing this descriptor. | |
Public Attributes | |
| xiiHashedString | m_sDecalId |
| Unique identifier for the decal, used for lookup in the atlas resource. | |
| xiiDecalAtlasResourceHandle | m_hAtlas |
| Handle to the decal atlas resource that contains the textures for this decal. The atlas resource contains the metadata mapping decal IDs to UV rectangles, as well as the GPU textures for all channels. This allows sharing the same atlas resource between multiple decals, as long as they reference different entries in the atlas. | |
| xiiTexture2DResourceHandle | m_hAlbedo |
| Handle to the albedo texture for this decal, used if this decal is not packed into an atlas. If this is valid, the atlas handle is ignored and this texture is used instead. This allows using individual textures for decals that are not suitable for atlasing, such as large mesh decals or decals with unique channel masks. | |
| xiiTexture2DResourceHandle | m_hNormal |
| Handle to the normal texture for this decal, used if this decal is not packed into an atlas. If this is valid, the atlas handle is ignored and this texture is used instead. This allows using individual textures for decals that are not suitable for atlasing, such as large mesh decals or decals with unique channel masks. | |
| xiiTexture2DResourceHandle | m_hMaterial |
| Handle to the material texture for this decal, used if this decal is not packed into an atlas. If this is valid, the atlas handle is ignored and this texture is used instead. This allows using individual textures for decals that are not suitable for atlasing, such as large mesh decals or decals with unique channel masks. | |
| xiiTexture2DResourceHandle | m_hEmissive |
| Handle to the emissive texture for this decal, used if this decal is not packed into an atlas. If this is valid, the atlas handle is ignored and this texture is used instead. This allows using individual textures for decals that are not suitable for atlasing, such as large mesh decals or decals with unique channel masks. | |
| xiiVec2 | m_vUVOffset = xiiVec2::MakeZero() |
| UV offset to apply to this decal when sampling from the atlas, in normalized coordinates. This allows adjusting the UVs for this decal without modifying the atlas entry, which can be useful for animation or variation purposes. | |
| xiiVec2 | m_vUVScale = xiiVec2(1.0f) |
| UV scale to apply to this decal when sampling from the atlas, in normalized coordinates. This allows adjusting the UVs for this decal without modifying the atlas entry, which can be useful for animation or variation purposes. | |
| xiiColor | m_Tint = xiiColor::White |
| Tint color to multiply with the sampled albedo color for this decal, used for color variation without modifying the source textures. | |
| xiiBitflags< xiiDecalChannelMask > | m_ChannelMask |
| Mask of G-Buffer channels that this decal writes to. This allows using the same material resource for both projected and mesh decals, as well as for decals that are packed into an atlas and decals that use individual textures, as the channel mask can be specified per decal instance. | |
| float | m_fOpacity = 1.0f |
| Opacity of the decal, used for blending the decal color with the underlying surface. This is typically used for projected decals, as mesh decals can have their opacity controlled by vertex colors or material parameters, but it can also be used for mesh decals if desired. | |
| float | m_fNormalBlend = 1.0f |
| Normal blend factor, used for blending the sampled normal with the underlying surface normal. This is typically used for projected decals, as mesh decals can have their normal blend controlled by vertex colors or material parameters, but it can also be used for mesh decals if desired. | |
| float | m_fRoughness = 0.5f |
| Default roughness value for this decal, used if the material texture does not contain a roughness channel or if this decal is not packed into an atlas. This is typically used for projected decals, as mesh decals can have their roughness controlled by vertex colors or material parameters, but it can also be used for mesh decals if desired. | |
| float | m_fMetallic = 0.0f |
| Default metallic value for this decal, used if the material texture does not contain a metallic channel or if this decal is not packed into an atlas. This is typically used for projected decals, as mesh decals can have their metallic controlled by vertex colors or material parameters, but it can also be used for mesh decals if desired. | |
| float | m_fEmissive = 0.0f |
| Default emissive intensity for this decal, used if the emissive texture does not contain an emissive channel or if this decal is not packed into an atlas. This is typically used for projected decals, as mesh decals can have their emissive intensity controlled by vertex colors or material parameters, but it can also be used for mesh decals if desired. | |
| xiiUInt8 | m_uiPriority = 128U |
| Priority for rendering this decal. Higher priority decals are rendered after lower priority ones, which can reduce overdraw and improve performance. This is typically used for projected decals, as mesh decals can have their rendering order controlled by their position in the scene or by material parameters, but it can also be used for mesh decals if desired. | |
Per-decal material defaults shared by projected and mesh decals.
| xiiResult xiiDecalResourceDescriptor::Validate | ( | ) | const |
Validates finite rendering parameters and the atlas lookup identity.
Copyright (c) Theophilus Eriata. All Rights Reserved.