Lagrange
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
TangentBitangentOptions Struct Reference

Option struct for computing tangent and bitangent vectors. More...

#include <lagrange/compute_tangent_bitangent.h>

Public Attributes

std::string_view tangent_attribute_name = "@tangent"
 Output tangent attribute name.
 
std::string_view bitangent_attribute_name = "@bitangent"
 Output bitangent attribute name.
 
std::string_view uv_attribute_name = ""
 UV attribute name used to orient the BTN frame. More...
 
std::string_view normal_attribute_name = ""
 Normal attribute name used to compute the BTN frame. More...
 
AttributeElement output_element_type = AttributeElement::Indexed
 Output element type. Can be either Corner or Indexed.
 
bool pad_with_sign = false
 Whether to pad the tangent/bitangent vectors with a 4th coordinate indicating the sign of the UV triangle.
 
bool orthogonalize_bitangent = false
 Whether to compute the bitangent as sign * cross(normal, tangent) If false, the bitangent is computed as the derivative of v-coordinate.
 
bool keep_existing_tangent = false
 Whether to recompute tangent if the tangent attribute (specified by tangent_attribute_name) already exists. More...
 

Detailed Description

Option struct for computing tangent and bitangent vectors.

Member Data Documentation

◆ uv_attribute_name

std::string_view uv_attribute_name = ""

UV attribute name used to orient the BTN frame.

Must be an indexed attribute. If left empty, the first indexed UV attribute is used.

◆ normal_attribute_name

std::string_view normal_attribute_name = ""

Normal attribute name used to compute the BTN frame.

Must be an indexed attribute. The output tangent/bitangent vectors are projected into the plane orthogonal to the normal vector at each triangle corner. If the output element type is set to Indexed, the indices in the provided normal attribute are also used to aggregate BTN frames between neighboring triangles. If left empty, the first indexed Normal attribute is used.

◆ keep_existing_tangent

bool keep_existing_tangent = false

Whether to recompute tangent if the tangent attribute (specified by tangent_attribute_name) already exists.

  • If true, bitangent will be computed by sign * normalized(cross(normal, existing_tangent))
    • orthogonalize_bitangent must be true
  • If false, the tangent will be recomputed and potentially overwritten.

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