MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ textured_mesh_rect()

MAYAFLUX_API std::array< Kakshya::MeshVertex, 6 > MayaFlux::Kinesis::textured_mesh_rect ( Kinesis::AABB2D  region,
float  weight = 0.F,
glm::vec3  color = glm::vec3(1.F) 
)

Generate a UV-mapped TRIANGLE_LIST quad (6 vertices, 2 triangles) from an AABB2D, as Kakshya::MeshVertex.

UV origin is bottom-left (0,1), same convention as textured_rect(). Use this instead of textured_rect() when the target pipeline expects the full MeshVertex layout (color/weight/normal/tangent) rather than texture.vert.spv's plain position+texcoord input - textured_rect()'s TextureQuadVertex is not wire-compatible with a MeshVertex shader input.

weight is written through unchanged, defaulting to MeshVertex's own neutral default (0). What it means - a blend factor, a sampler selector, anything - is entirely the caller's domain; this function has no opinion on it. color is likewise written through unchanged, defaulting to MeshVertex's own neutral default (white) - at weight >= 1 a caller-side shader convention may read it as a texture tint; at weight <= 0 the same convention may render it as a flat fill with no texture read at all. Either reading is the caller's domain.

Parameters
regionNDC axis-aligned bounds.
weightPer-vertex weight value, written through as-is.
colorPer-vertex color value, written through as-is.

Definition at line 768 of file GeometryPrimitives.cpp.

769{
770 using V = Kakshya::MeshVertex;
771 const glm::vec2 mn = region.min;
772 const glm::vec2 mx = region.max;
773 return { {
774 V { .position = { mn.x, mn.y, 0.F }, .color = color, .weight = weight, .uv = { 0.F, 1.F } },
775 V { .position = { mx.x, mn.y, 0.F }, .color = color, .weight = weight, .uv = { 1.F, 1.F } },
776 V { .position = { mn.x, mx.y, 0.F }, .color = color, .weight = weight, .uv = { 0.F, 0.F } },
777 V { .position = { mx.x, mn.y, 0.F }, .color = color, .weight = weight, .uv = { 1.F, 1.F } },
778 V { .position = { mx.x, mx.y, 0.F }, .color = color, .weight = weight, .uv = { 1.F, 0.F } },
779 V { .position = { mn.x, mx.y, 0.F }, .color = color, .weight = weight, .uv = { 0.F, 0.F } },
780 } };
781}
glm::vec3 color
Definition Decoder.cpp:97
double weight
Vertex type for indexed triangle mesh primitives (TRIANGLE_LIST topology)

References color, MayaFlux::Kinesis::AABB2D::max, MayaFlux::Kinesis::AABB2D::min, textured_mesh_rect(), and weight.

Referenced by MayaFlux::Portal::Forma::Element::retarget(), textured_mesh_rect(), MayaFlux::Portal::Text::TextRun::vertices(), and MayaFlux::Portal::Forma::Element::with_texture().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: