Description

One unique geometry in object space, shared by every instance that references it.

Stored as flat per-triangle arrays rather than as indexed vertices with a material struct, because that is the shape the Metal ray-tracing pipeline consumes: each array becomes one device buffer, and a shader reads element i for triangle i with no indirection.

#include <ChMetalRenderTypes.h>

Public Member Functions

int triCount () const
 Number of triangles, which every per-triangle array above is sized against.
 

Public Attributes

std::vector< float > verts
 9 floats / triangle (3 xyz)
 
std::vector< float > normals
 9 floats / triangle (3 vertex normals)
 
std::vector< float > tangents
 9 floats / triangle (object-space tangent, for normal mapping)
 
std::vector< float > uv
 6 floats / triangle (3 uv); zeros if none
 
std::vector< float > colors
 3 floats / triangle (base albedo)
 
std::vector< float > opacity
 1 float / triangle: material opacity d (1 = opaque)
 
std::vector< float > roughness
 1 float / triangle: material roughness (1 = matte, low = glossy)
 
std::vector< float > metallic
 1 float / triangle: material metallic (0 = dielectric, 1 = metal)
 
std::vector< int > texId
 1 int / triangle: index into MetalRenderScene.texturePaths, or -1
 
std::vector< int > roughTexId
 1 int / triangle: roughness map (map_Pr) index, or -1
 
std::vector< int > metalTexId
 1 int / triangle: metallic map (map_Pm) index, or -1
 
std::vector< int > opacityTexId
 1 int / triangle: opacity map (map_d) index, or -1
 
std::vector< int > normalTexId
 1 int / triangle: normal map (norm/map_Bump) index, or -1
 
std::vector< float > specular
 4 floats / triangle: Ks.rgb + use_specular_workflow flag (0/1)
 
std::vector< float > emissive
 4 floats / triangle: Ke.rgb + emissive_power
 
std::vector< float > texScale
 2 floats / triangle: texture UV scale (default 1,1)
 
std::vector< int > ksTexId
 1 int / triangle: specular map (map_Ks) index, or -1
 
std::vector< int > keTexId
 1 int / triangle: emissive map (map_Ke) index, or -1
 
std::vector< int > blendKdTexId
 weight-blended materials: 2nd-layer Kd map index, or -1 (no blend)
 
std::vector< int > blendWeightTexId
 weight-blended materials: blend weight map index, or -1
 
bool dynamic = false
 deforming (re-extracted + refit every frame)
 

The documentation for this struct was generated from the following file:
  • /builds/uwsbel/chrono/src/chrono_sensor/metal/ChMetalRenderTypes.h