10class GpuFieldOperator;
11struct SpatialFieldConfig;
26template <
typename State>
27concept GridCellData = (ArithmeticData<State> || GlmVec2Type<State> || GlmVec4Type<State>)
28 && (
sizeof(State) %
sizeof(uint32_t) == 0);
105 using FieldBinder = std::function<void(
const std::shared_ptr<Nodes::Network::GpuFieldOperator>&)>;
127 const Buffers::RelaxationGridBuffer::GridConfig& config,
129 ->
std::shared_ptr<Buffers::RelaxationGridBuffer>
131 auto grid = build_grid(config, render, {}, 0);
151 template <
typename Seed>
152 requires std::invocable<Seed&, uint32_t, uint32_t>
158 -> std::shared_ptr<Buffers::RelaxationGridBuffer>
160 using State = std::remove_cvref_t<std::invoke_result_t<Seed&, uint32_t, uint32_t>>;
162 std::vector<std::byte> cells(
static_cast<size_t>(config.width) * config.height *
sizeof(State));
163 for (uint32_t y = 0; y < config.height; ++y) {
164 for (uint32_t x = 0; x < config.width; ++x) {
165 const State
value = seed(x, y);
167 cells.data() + (
static_cast<size_t>(y) * config.width + x) *
sizeof(State),
173 auto grid = build_grid(config, render, cells,
sizeof(State));
198 const std::shared_ptr<Buffers::VolumeGridBuffer>& volume,
201 -> std::shared_ptr<Buffers::VolumeGridBuffer>
203 if (!build_flow(volume, flow, render)) {
231 template <
typename Network>
232 requires std::is_base_of_v<Nodes::Network::NodeNetwork, Network>
234 const std::shared_ptr<Network>&
network,
238 -> std::shared_ptr<Network>
240 if (!build_field(std::static_pointer_cast<Nodes::Network::NodeNetwork>(
network), spatial, bind, render)) {
259 std::shared_ptr<Buffers::RelaxationGridBuffer> build_grid(
262 const std::vector<std::byte>& seed,
273 const std::shared_ptr<Buffers::VolumeGridBuffer>& volume,
286 const std::shared_ptr<Nodes::Network::NodeNetwork>&
network,
Core::GlobalNetworkConfig network
#define MF_LIVE_EXPOSE_AUTO(ptr)
Auto-expose variant that deduces the key prefix from the shared_ptr element type.
auto operator()(const std::shared_ptr< Buffers::VolumeGridBuffer > &volume, const Buffers::VolumeGridBuffer::FlowConfig &flow, const RenderConfig &render) -> std::shared_ptr< Buffers::VolumeGridBuffer >
Set the incompressible flow stages going over a volume and attach rendering.
Evolve(const Evolve &)=delete
Evolve(Evolve &&) noexcept
auto operator()(const std::shared_ptr< Network > &network, const Nodes::Network::SpatialFieldConfig &spatial, const FieldBinder &bind, const RenderConfig &render) -> std::shared_ptr< Network >
Drive a network's vertices with fields and spatial stages, and attach rendering.
Evolve & operator=(const Evolve &)=delete
auto operator()(const Buffers::RelaxationGridBuffer::GridConfig &config, Seed &&seed, const RenderConfig &render) -> std::shared_ptr< Buffers::RelaxationGridBuffer >
Build a relaxation grid seeded from a host callable.
std::function< void(const std::shared_ptr< Nodes::Network::GpuFieldOperator > &)> FieldBinder
Callable that binds fields on the GpuFieldOperator before it is wired.
std::unique_ptr< Impl > m_impl
Sets a system going from a config: state that persists, a rule that advances it every cycle,...
Cell types a relaxation grid can be seeded with from a host callable.
Main namespace for the Maya Flux audio engine.
Arrangement of a relaxation grid: extent, the update rule, the emit stage that draws it,...
Parameters for the incompressible flow stage arrangement.
Declarative configuration for the GPU-side spatial-relational work a GpuFieldOperator can drive beyon...
Unified rendering configuration for graphics buffers.