pub struct ContextValue { /* private fields */ }Expand description
context( node, { … } )’s value: the builder.context keys a
Node::Context installs for its subgraph, merged over the ones already
in force (builder.addContext()).
Three’s values are arbitrary JS; the port’s are nodes (getViewZ: () => scenePassViewZ is .set( "getViewZ", scene_pass_view_z )), held in
BuildContext’s string-keyed extra map, which is where #155 decision 6
put addon keys. The typed core keys (setupNormal, the material side, …)
are installed by the material’s own setup and cannot be set from here.
Implementations§
Source§impl ContextValue
impl ContextValue
Sourcepub fn set(self, key: &'static str, value: impl Into<NodeRef>) -> Self
pub fn set(self, key: &'static str, value: impl Into<NodeRef>) -> Self
{ …, key: value }. A later set of the same key wins, as the later
of two properties does in a JS object literal.
Sourcepub fn uniform_flow(self, on: bool) -> Self
pub fn uniform_flow(self, on: bool) -> Self
{ …, uniformFlow: on } — what uniform_flow installs. Under it a
select() with both branches is WGSL’s select( f, t, cond ) rather
than an if/else over a var (ConditionalNode.generate()), so it
stays in uniform control flow.