Skip to main content Link Menu Expand (external link) Document Search Copy Copied
modulo2D

modulo2D

Shortcuts:
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

  • Enable:
  • Axis: The axis facing the plane along which space is repeated.
    • 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.
  • Offset: Shifts where the input cell is taken from without moving the position of the grid.
  • Shift: Shifts the whole grid (and its contents).
  • Mirror Type: How the cells are varied.
    • 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.
    • 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:
    • 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
    • Return Types: float vec4 Sdf Ray Light Particle
  • Size Field: (optional)
    • Coordinate Types: vec2 vec3
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext
    • Return Types: float vec4
  • Offset Field: (optional)
    • Coordinate Types: vec2 vec3
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext
    • Return Types: float vec4
  • Shift Field: (optional)
    • Coordinate Types: vec2 vec3
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext
    • Return Types: float vec4

Variables

  • cellcoord:
  • tiledquad:
  • normcoord: