pub enum SampleMode {
Sample,
Level(NodeRef),
Bias(NodeRef),
Grad(NodeRef, NodeRef),
Gather {
component: NodeRef,
offset: Option<NodeRef>,
},
GatherCompare {
compare: NodeRef,
offset: Option<NodeRef>,
},
Load,
LoadLayer(NodeRef),
SampleLayer(NodeRef),
Compare(NodeRef),
LoadTexel,
StorageLoad,
}Expand description
How a TextureNode reads its texture — WGSLNodeBuilder.generateTexture*.
Variants§
Sample
textureSample( t, t_sampler, uv ).
Level(NodeRef)
textureSampleLevel( t, t_sampler, uv, level ).
Bias(NodeRef)
textureSampleBias( t, t_sampler, uv, bias ) — textureNode.bias( value ). FXAANode samples its input at a bias of -100, pinning
every tap to the top mip.
Grad(NodeRef, NodeRef)
textureSampleGrad( t, t_sampler, uv, gradX, gradY ) —
textureNode.grad( gradX, gradY ) (generateTextureGrad()), each
gradient built as a vec2.
Gather
textureGather( component, t, t_sampler, uv[, offset] ) —
textureNode.gather( component ), optionally .offset( ivec2 )
(WGSLNodeBuilder.generateTextureGather()): one channel of the four
texels a bilinear tap would read, from mip level 0.
Fields
GatherCompare
textureGatherCompare( t, t_sampler, uv, depth[, offset] ) —
depthNode.gather().compare( depth ) on a depth texture with a
comparison sampler (generateTextureGatherCompare()): the four
texels’ comparison results.
Fields
Load
The non-filterable path: textureLoad against textureDimensions,
with no sampler binding at all. What Three emits for a depth texture.
LoadLayer(NodeRef)
textureLoad( t, coord, layer, u32( 0u ) ) on a 2-D-array texture —
textureLoad( … ).depth( layer ), with no clamping and no sampler.
SampleLayer(NodeRef)
textureSample( t, t_sampler, uv, i32( layer ) ) on a 2-D-array
texture — texture( map, uv ).depth( layer ). Three builds the depth
node as 'int', so a float layer arrives truncated by i32().
Compare(NodeRef)
textureSampleCompare( t, t_sampler, uv, depth ) — the depth-compare
read ShadowFilterNode’s depthCompare lowers to.
LoadTexel
textureLoad( t, coord, u32( 0u ) ) — an unclamped texel fetch at an
integer coordinate, what Batch.js reads its data textures with. When
the node’s type is a scalar the snippet is swizzled (.x), which is
how Three’s textureLoad( … ).x on the r32uint indirect table lands
in one u32 property.
StorageLoad
storageTexture( t ).load( coord ) — textureLoad( t, coord ) on a
texture_storage_*, which takes no level argument
(WGSLNodeBuilder.generateStorageTextureLoad()).