MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kinesis::ParametricField< D, R > Struct Template Reference

An authored expression of position, time and a parameter block, shader-only. More...

#include <DualField.hpp>

+ Collaboration diagram for MayaFlux::Kinesis::ParametricField< D, R >:

Public Member Functions

bool has_source () const noexcept
 Whether the shader half parsed into a usable function definition.
 

Public Attributes

FieldSource source
 

Detailed Description

template<typename D, typename R>
struct MayaFlux::Kinesis::ParametricField< D, R >

An authored expression of position, time and a parameter block, shader-only.

Template Parameters
DDomain type.
RRange type.

Carries no Tendency, for the same reason TemporalField does not. The third argument is a vec4 supplied by whoever dispatches the shader, and it is what lets a field depend on state the shader text cannot hold, such as an Agent's position and radius. For GpuFieldOperator it is set with set_params() and pushed every dispatch, so changing it recompiles nothing.

namespace MayaFlux::Fields {
using namespace MayaFlux::ShaderCompat;
const auto pull = MF_FIELD_P(pull, [](vec3 p, float t, vec4 a) -> vec3 {
vec3 d = vec3(a.x, a.y, a.z) - p;
float r = length(d);
return r > 0.001f ? (d / r) * (a.w / (r * r + 0.1f)) : vec3(0.0f);
});
}
uint64_t length
Definition Composite.cpp:11
#define MF_FIELD_P(name, lambda)
Bind an authored expression of position, time and a vec4 parameter block to the shader backend.
size_t a

Definition at line 161 of file DualField.hpp.


The documentation for this struct was generated from the following file: