MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
RaymarchBuffer.cpp
Go to the documentation of this file.
1#include "RaymarchBuffer.hpp"
2
7
8namespace MayaFlux::Buffers {
9
11 Kinesis::Lattice3D lattice,
13 size_t field_bytes)
14 : MeshBuffer(Kinesis::generate_box(
15 (lattice.bounds.min + lattice.bounds.max) * 0.5F,
16 (lattice.bounds.max - lattice.bounds.min) * 0.5F))
17 , m_lattice(lattice)
18 , m_source(std::move(source))
19 , m_field_bytes(field_bytes)
20{
21}
22
24{
26
27 m_march_processor = std::make_shared<RaymarchProcessor>(
29 m_march_processor->set_processing_token(token);
30
31 get_processing_chain()->add_processor(m_march_processor, shared_from_this());
32
34 "RaymarchBuffer: proxy box over {}x{}x{} lattice",
36}
37
39{
40 RenderConfig resolved = config;
41
42 if (resolved.vertex_shader.empty())
43 resolved.vertex_shader = "volume_raymarch.vert.spv";
44 if (resolved.fragment_shader.empty())
45 resolved.fragment_shader = "volume_raymarch.frag.spv";
46
48
50 m_render_processor->enable_alpha_blending();
51 m_render_processor->disable_depth_test();
52}
53
54} // namespace MayaFlux::Buffers
#define MF_DEBUG(comp, ctx,...)
void setup_processors(ProcessingToken token) override
Create and attach MeshProcessor as the default processor.
void setup_rendering(const RenderConfig &config)
Attach a RenderProcessor targeting the given window.
VKBuffer subclass that owns a MeshData and manages its GPU upload.
std::shared_ptr< RaymarchProcessor > m_march_processor
RaymarchBuffer(Kinesis::Lattice3D lattice, RaymarchProcessor::FieldSource source, size_t field_bytes)
Construct proxy geometry over a lattice.
RaymarchProcessor::FieldSource m_source
void setup_rendering(const RenderConfig &config)
Attach a RenderProcessor drawing the proxy box.
void setup_processors(ProcessingToken token) override
Attach MeshProcessor for upload and RaymarchProcessor for staging.
std::function< vk::Buffer()> FieldSource
Callable resolving the handle to sample this cycle.
std::shared_ptr< Buffers::BufferProcessingChain > get_processing_chain() override
Access the buffer's processing chain.
Definition VKBuffer.cpp:263
std::shared_ptr< RenderProcessor > m_render_processor
Definition VKBuffer.hpp:620
ProcessingToken
Bitfield enum defining processing characteristics and backend requirements for buffer operations.
@ Init
Engine/subsystem initialization.
@ Buffers
Buffers, Managers, processors and processing chains.
glm::uvec3 resolution
Cell count per axis. Zero on any axis is invalid.
Definition Lattice.hpp:26
A regular subdivision of an AABB3D into a cell count per axis.
Definition Lattice.hpp:25
Unified rendering configuration for graphics buffers.