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

◆ bind_diffuse_texture()

void MayaFlux::Buffers::MeshBuffer::bind_diffuse_texture ( std::shared_ptr< Core::VKImage image,
std::string_view  binding_name = "diffuseTex" 
)

Bind a diffuse texture to the render processor, if present.

The binding name must match a descriptor slot in the shader. If the render processor is not yet created, the texture will be bound on creation if the default_texture_binding matches.

Definition at line 187 of file MeshBuffer.cpp.

190{
191 m_diffuse_texture = std::move(image);
192 m_diffuse_binding = std::string(binding_name);
193
194 if (m_render_processor) {
197 } else {
199 "MeshBuffer::bind_diffuse_texture: pipeline was created without "
200 "binding '{}' — call before setup_rendering() for correct results",
202 }
203 }
204}
#define MF_WARN(comp, ctx,...)
IO::ImageData image
Definition Decoder.cpp:57
std::shared_ptr< Core::VKImage > m_diffuse_texture
std::shared_ptr< RenderProcessor > m_render_processor
Definition VKBuffer.hpp:618
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, MayaFlux::Portal::Graphics::RenderConfig::default_texture_binding, image, m_diffuse_binding, m_diffuse_texture, MayaFlux::Buffers::VKBuffer::m_render_config, MayaFlux::Buffers::VKBuffer::m_render_processor, and MF_WARN.