Open 3D Engine Atom Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::RPI::UvStreamTangentBitmask Class Reference

#include <UvStreamTangentBitmask.h>

Public Member Functions

uint32_t GetFullTangentBitmask () const
 Get the full mask including number of UVs and tangent/bitangent assignment to each UV.
 
uint32_t GetUvStreamCount () const
 Get number of UVs that have tangent/bitangent assigned.
 
uint32_t GetTangentAtUv (uint32_t uvIndex) const
 
void ApplyTangent (uint32_t tangent)
 
void Reset ()
 Reset the bitmask to clear state.
 

Static Public Attributes

static constexpr uint32_t UnassignedTangent = 0b1111u
 The bit mask indicating generated tangent/bitangent will be used.
 
static constexpr const char * SrgName = "m_uvStreamTangentBitmask"
 The variable name defined in the SRG shader code.
 
static constexpr uint32_t MaxUvSlots = (sizeof(m_mask) * CHAR_BIT - BitsForUvIndex) / BitsPerTangent
 Max UV slots available in this bit mask.
 

Detailed Description

An encoded bitmask for tangent used by UV streams. It contains the information about number of UV streams and which tangent/bitangent is used by each UV stream. See m_mask for more details. The mask will be passed through per draw SRG.

Member Function Documentation

◆ ApplyTangent()

void AZ::RPI::UvStreamTangentBitmask::ApplyTangent ( uint32_t  tangent)

Apply the tangent to the next UV, whose index is the same as GetUvStreamCount.

Parameters
tangentthe tangent/bitangent to be assigned. Ranged in [0, 0xF) It comes from the model in order, e.g. 0 means the first available tangent stream from the model. Specially, value 0xF(=UnassignedTangent) means generated tangent/bitangent will be used in shader. If ranged out of definition, unassigned tangent will be applied.

◆ GetTangentAtUv()

uint32_t AZ::RPI::UvStreamTangentBitmask::GetTangentAtUv ( uint32_t  uvIndex) const

Get tangent/bitangent assignment to the specified UV in the material.

Parameters
uvIndexthe index of the UV from the material, in default order as in the shader code.

The documentation for this class was generated from the following file: