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

◆ MF_FIELD

#define MF_FIELD (   name,
  lambda 
)     MayaFlux::Kinesis::dual_field(#name, lambda, #lambda)

Bind one authored expression to both the host and shader backends.

The lambda is compiled by the host compiler and its text is parsed into a GLSL function definition. Both halves come from the same characters and cannot drift.

The lambda must carry a trailing return type, take its argument by value, and stay inside the intersection documented in ShaderCompat.hpp.

const auto falloff = MF_FIELD(falloff, [](vec3 p) -> float {
float d = length(p) / 3.0f;
return 1.0f - smoothstep(0.2f, 0.9f, clamp(d, 0.0f, 1.0f));
});
#define MF_FIELD(name, lambda)
Bind one authored expression to both the host and shader backends.
float falloff

Definition at line 193 of file DualField.hpp.