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

◆ with_texture() [2/2]

Element & MayaFlux::Portal::Forma::Element::with_texture ( const std::shared_ptr< Core::VKImage > &  image,
Kinesis::AABB2D  region = { .min = glm::vec2(-1.F), .max = glm::vec2(1.F) } 
)

Submit a UV quad covering region and bind image as "texSampler" on the attached FormaBuffer.

buffer must already be set and created with an additional_textures slot at index 0. Any source is valid: a loaded PNG, a render target, a TextureBuffer or TextBuffer via get_texture().

Parameters
imageGPU-resident VKImage in shader-read layout.
regionNDC quad extent. Defaults to fullscreen.

Definition at line 21 of file Element.cpp.

24{
25 if (!buffer)
26 return *this;
27
28 texture = image;
29 buffer.submit(Kinesis::textured_mesh_rect(region, k_single_texture_weight));
31 return *this;
32}
IO::ImageData image
Definition Decoder.cpp:47
void submit(const std::vector< uint8_t > &bytes) const
Replace this target's geometry.
Definition Target.cpp:51
void bind_texture(uint32_t array_index, const std::shared_ptr< Core::VKImage > &image) const
Bind a texture in the buffer's texture array.
Definition Target.cpp:63
std::array< Kakshya::MeshVertex, 6 > textured_mesh_rect(Kinesis::AABB2D region, float weight, glm::vec3 color)
Generate a UV-mapped TRIANGLE_LIST quad (6 vertices, 2 triangles) from an AABB2D, as Kakshya::MeshVer...
FormaTarget buffer
Where this region's rendered output is written: a buffer of its own, or a slice of one it shares.
Definition Element.hpp:82
std::shared_ptr< Core::VKImage > texture
Optional GPU texture to bind to the attached buffer. Used for.
Definition Element.hpp:85

References MayaFlux::Portal::Forma::FormaTarget::bind_texture(), buffer, image, MayaFlux::Portal::Forma::FormaTarget::submit(), texture, and MayaFlux::Kinesis::textured_mesh_rect().

Referenced by with_texture().

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