MayaFlux 0.4.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 31 of file Element.cpp.

34{
35 if (!buffer)
36 return *this;
37
38 texture = image;
39 buffer->submit(textured_mesh_rect(region));
40 buffer->bind_texture(0, image);
41 return *this;
42}
IO::ImageData image
Definition Decoder.cpp:57
std::shared_ptr< Core::VKImage > texture
Optional GPU texture to bind to the attached buffer. Used for.
Definition Element.hpp:75
std::shared_ptr< Buffers::FormaBuffer > buffer
Buffer whose rendered output occupies this region.
Definition Element.hpp:72

References buffer, image, and texture.

Referenced by with_texture().

+ Here is the caller graph for this function: