modulo2D

modulo2D

Shortcuts:
  • m2
Keywords:
  • grid
  • modulo
  • repeat

Repeats space along 2 axes.

This has the effect of making an infinite grid of copies of (slices/cells of) the input, but without the cost of having to separately calculate each copy.

Parameters

Name Description Regular Handling Read-Only Handling
Enable
Axis

The axis facing the plane along which space is repeated.

Runtime Semi-Baked
  • YZ: Repeat space on the Y and Z axes.
  • ZX: Repeat space on the X and Z axes.
  • XY: Repeat space on the X and Y axes.
Size

The spacing of the grid along the two axes. This sets the size of the cell taken from the input.

Runtime Baked
Offset

Shifts where the input cell is taken from without moving the position of the grid.

Runtime Baked
Shift

Shifts the whole grid (and its contents).

Runtime Baked
Mirror Type

How the cells are varied.

Semi-Baked Semi-Baked
  • None: All cells are treated the same.
  • Mirror: Every other cell is flipped.
  • Grid: Flip every other cell along the diagonal axis as well. This means that for an input with something in one corner, there will be groups of 4 cells with all those corners facing each other.
Iteration Type

Whether and how to expose iteration values to upstream operators.

Semi-Baked Semi-Baked
  • None: Pass along whatever is provided by the next op after this one.
  • Quadrant Index (0-3) In Tiles: For each cluster of 4 cells, output 0 for the top left, 1 for top right, 2 for bottom left, and 3 for bottom right, and put that value in the x component, and set yzw to 0.
  • Cell Coordinates: Use the cell coordinates as the x and y components of the iteration, with zw set to 0. Note that it always uses xy, even if the grid is along another plane.
  • Alternating Cell Coordinates On Axes (0-1, 0-1): Cell coordinates that alternate between 0 and 1 along both axes in xy, with zw set to 0.
Limit Type Semi-Baked Semi-Baked
  • None:
  • Both:
  • Start Only:
  • Stop Only:
Limit Start
Limit Stop
Limit Offset

Inputs

  • definition_in: (required)
    • Coordinate Types: vec2 vec3
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext VertexContext PixelContext
    • Return Types: float vec4 Sdf Volume Ray Light Particle
    • Supports Variables: cellcoord tiledquad normcoord shiftedcellcoord
  • Size Field: (optional)
    • Coordinate Types: vec2 vec3
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext VertexContext PixelContext
    • Return Types: float vec4
  • Shift Field: (optional)
    • Coordinate Types: vec2 vec3
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext VertexContext PixelContext
    • Return Types: float vec4
    • Supports Variables From Inputs: sizeField
  • Offset Field: (optional)
    • Coordinate Types: vec2 vec3
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext VertexContext PixelContext
    • Return Types: float vec4
    • Supports Variables: cellcoord tiledquad normcoord shiftedcellcoord
    • Supports Variables From Inputs: sizeField shiftField

Variables

  • Cell Coord:
  • Tiled Quadrant:
  • Normalized Cell Coord:
  • Shifted Cell Coord: