|
MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
|
| void MayaFlux::Nodes::Network::GpuFieldOperator::bind | ( | FieldTarget | target, |
| const Kinesis::DualVectorField & | field, | ||
| std::optional< uint32_t > | cluster = std::nullopt |
||
| ) |
Bind a three-component field to one or more vec3 targets.
| target | Mask over POSITION, COLOR, NORMAL and TANGENT. |
| field | Dual-source field with a usable shader half. |
| cluster | Nullopt (the default) applies the field to every vertex regardless of which cluster it belongs to, the only behaviour that existed before this parameter. A value restricts the field to vertices whose cluster id equals it: see needs_cluster_id() for what that costs a consumer that never uses this. |
Binding nothing and returning is the response to an empty mask, a bit the layout does not carry, a component-count mismatch on any bit, a field whose shader half failed to parse, or a function name already emitted with a different body. Validation covers the whole mask before anything is stored, so a partly-valid mask binds nothing rather than part.
Several fields may drive the same target. They sum before the write, matching FieldOperator, and NORMAL and TANGENT normalise after the sum. A cluster-scoped field only contributes to that sum for vertices in its own cluster; an unscoped field sharing the target still contributes to every vertex regardless.
Definition at line 294 of file GpuFieldOperator.cpp.
References accept(), MayaFlux::Kinesis::k_vector_targets, MF_ERROR, MayaFlux::Journal::NodeProcessing, MayaFlux::Journal::Nodes, MayaFlux::Kinesis::DualField< D, R >::source, and store().
Here is the call graph for this function: