pub struct EnvironmentNode { /* private fields */ }Expand description
scene.environmentNode set to a node graph rather than a texture:
EnvironmentNode.setup()’s non-texture branch, which builds that graph
under each lighting context in turn.
Three reads the environment through context: every PMREMNode in the
graph asks builder.context.getUV() and getTextureLevel() for its
direction and roughness, and EnvironmentNode builds the same graph once
under the radiance context and once under the irradiance one. The port has
no node context, so the graph is a function of those two values instead.
PmremHandle::sample is the pmremTexture() leaf it calls. Each call
builds the graph again, which is what three’s context build does: its
dump repeats the mix and the oscSine for radiance and for
iblIrradiance.
webgpu_cubemap_mix: mix( pmremTexture( cube2 ), pmremTexture( cube1 ), oscSine( time.mul( .1 ) ) ).
Implementations§
Source§impl EnvironmentNode
impl EnvironmentNode
Sourcepub fn new(build: impl Fn(NodeRef, NodeRef) -> NodeRef + 'static) -> Self
pub fn new(build: impl Fn(NodeRef, NodeRef) -> NodeRef + 'static) -> Self
build( uv, level ) is the graph under a context whose getUV() is
uv and whose getTextureLevel() is level.
Sourcepub fn sample(&self, uv: NodeRef, level: NodeRef) -> NodeRef
pub fn sample(&self, uv: NodeRef, level: NodeRef) -> NodeRef
The graph read along uv at roughness level.
Sourcepub fn with_texture_level(&self, level: NodeRef) -> Self
pub fn with_texture_level(&self, level: NodeRef) -> Self
node.context( { getTextureLevel: () => level } ): the same graph with
every pmremTexture() in it read at level, whatever roughness the
reader asks for. It is a new node, as .context() is.
Trait Implementations§
Source§impl Clone for EnvironmentNode
impl Clone for EnvironmentNode
Source§impl Debug for EnvironmentNode
impl Debug for EnvironmentNode
Source§impl Hash for EnvironmentNode
Keyed by identity, as every node in a material is: the scene holds it, so
it is the same node, and the same program, every frame.
impl Hash for EnvironmentNode
Keyed by identity, as every node in a material is: the scene holds it, so it is the same node, and the same program, every frame.