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

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

#include <DualField.hpp>

+ Collaboration diagram for MayaFlux::Kinesis::TemporalField< 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::TemporalField< D, R >

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

Template Parameters
DDomain type.
RRange type.

Carries no Tendency. Tendency<D, R> is a function of the domain alone, so a two-argument callable has no CPU half to hand to FieldOperator: the value depends on when it is asked, which a stateless Tendency cannot express.

The second argument is supplied by whoever dispatches the shader. For VertexFieldProcessor it is seconds since the processor attached.

namespace MayaFlux::Fields {
using namespace MayaFlux::ShaderCompat;
const auto breathe = MF_FIELD_T(breathe, [](vec3 p, float t) -> vec3 {
float d = length(p);
if (d < 0.001f) { return vec3(0.0f); }
return (p / d) * (sin(d * 2.5f - t * 2.0f) * 0.25f);
});
}
#define MF_FIELD_T(name, lambda)
Bind an authored expression of position and time to the shader backend.

Definition at line 115 of file DualField.hpp.


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