module

Patterns

Static lookup registry for all 88 black-and-white repeating SVG patterns in res://addons/pattern_material/textures/patterns/*.svg, plus factory helpers for procedural PatternGenerator textures.

Examples:

Patterns["moroccan"]                  # => "res://addons/pattern_material/textures/patterns/moroccan.svg"
Patterns["zig-zag"]                   # => "res://addons/pattern_material/textures/patterns/zig_zag.svg"
Patterns.index("hexagons")            # => 40
Patterns.texture("topography")        # => Texture2D? (when running inside Godot)
Patterns.apply_to(material, "groovy") # sets `custom_pattern` shader parameter
Patterns.polka_dots(dot_radius: 14.0) # => PolkaDotPattern < PatternGenerator < ImageTexture

Constants

DEFAULT_IDS = ["4_point_stars", "anchors_away", "architect", "autumn", "aztec", "bamboo", "bank_note", "bathroom_floor", "bevel_circle", "boxes", "brick_wall", "bubbles", "cage", "charlie_brown", "church_on_sunday", "circles_and_squares", "circuit_board", "connections", "cork_screw", "current", "curtain", "cutout", "death_star", "default_pattern", "diagonal_lines", "diagonal_stripes", "dominos", "endless_clouds", "eyes", "falling_triangles", "fancy_rectangles", "flipped_diamonds", "floating_cogs", "floor_tile", "formal_invitation", "glamorous", "graph_paper", "groovy", "happy_intersection", "heavy_rain", "hexagons", "hideout", "houndstooth", "i_like_food", "intersecting_circles", "jigsaw", "jupiter", "kiwi", "leaf", "lines_in_motion", "lips", "lisbon", "melt", "moroccan", "morphing_diamonds", "overcast", "overlapping_circles", "overlapping_diamonds", "overlapping_hexagons", "parkay_floor", "piano_man", "pie_factory", "pixel_dots", "plus", "polka_dots", "rails", "rain", "random_shapes", "rounded_plus_connected", "signal", "skulls", "slanted_stars", "squares", "squares_in_squares", "stamp_collection", "steel_beams", "stripes", "temple", "texture", "tic_tac_toe", "tiny_checkers", "topography", "volcano_lamp", "wallpaper", "wiggle", "x_equals", "yyy", "zig_zag"]
LEGACY_SOURCE_DIR = "res://textures/patterns"
SOURCE_DIR = "res://addons/pattern_material/textures/patterns"

Class methods

[](key : String | Symbol) : String
Source
[](idx : Int) : String
Source
[]?(key : String | Symbol) : String | Nil
Source
apply_to(material : ShaderMaterial, key : String | Symbol) : String

Assigns custom_pattern on a ShaderMaterial using pattern_replace.gdshader and returns the resolved resource path.

Source
apply_to(material : ShaderMaterial, generator : PatternGenerator) : PatternGenerator

Assigns a procedural PatternGenerator to custom_pattern on a ShaderMaterial.

Source
bricks(columns : Int = 2, rows : Int = 4, mortar_gap : Float64 = 5.0, row_offset : Float64 = 0.5, corner_radius : Float64 = 2.0, tile_size : Int = 128, invert : Bool = false) : BrickPattern

Creates a customized BrickPattern procedural texture generator.

Source
cellular(columns : Int = 4, rows : Int = 4, jitter : Float64 = 0.45, cell_scale : Float64 = 0.72, seed : Int = 17, rounded : Bool = true, tile_size : Int = 128, invert : Bool = false) : CellularPattern

Creates a customized CellularPattern procedural Voronoi / caustics texture generator.

Source
checkers(columns : Int = 2, rows : Int = 2, cell_inset : Float64 = 0.0, corner_radius : Float64 = 0.0, tile_size : Int = 128, invert : Bool = false) : CheckerPattern

Creates a customized CheckerPattern procedural texture generator.

Source
circuit(columns : Int = 4, rows : Int = 4, trace_width : Float64 = 3.5, pad_radius : Float64 = 6.0, seed : Int = 98, tile_size : Int = 128, invert : Bool = false) : CircuitPattern

Creates a customized CircuitPattern procedural PCB traces & pads texture generator.

Source
count
Source
crosses(columns : Int = 2, rows : Int = 2, arm_length : Float64 = 28.0, arm_thickness : Float64 = 8.0, stagger : Bool = true, diagonal_x : Bool = false, tile_size : Int = 128, invert : Bool = false) : CrossPattern

Creates a customized CrossPattern procedural texture generator.

Source
custom(kind : CustomPatternGenerator::PatternKind = CustomPatternGenerator::PatternKind::PolkaDots, columns : Int = 2, rows : Int = 2, primary_size : Float64 = 18.0, secondary_size : Float64 = 6.0, stagger : Bool = true, tile_size : Int = 128, invert : Bool = false) : CustomPatternGenerator

Creates a multi-mode CustomPatternGenerator procedural texture generator.

Source
diamonds(columns : Int = 2, rows : Int = 2, diamond_scale : Float64 = 0.85, hollow_stroke : Float64 = 0.0, tile_size : Int = 128, invert : Bool = false) : DiamondPattern

Creates a customized DiamondPattern procedural texture generator.

Source
generator_count
Source
generator_names
Source
halftone(columns : Int = 6, rows : Int = 6, min_radius : Float64 = 2.0, max_radius : Float64 = 9.0, radial_falloff : Bool = false, tile_size : Int = 128, invert : Bool = false) : HalftonePattern

Creates a customized HalftonePattern procedural texture generator.

Source
has?(key : String | Symbol) : Bool

Returns true if key exists in Patterns.

Source
hexagons(columns : Int = 2, rows : Int = 2, hex_radius : Float64 = 22.0, stroke_width : Float64 = 5.0, flat_top : Bool = false, tile_size : Int = 128, invert : Bool = false) : HexagonPattern

Creates a customized HexagonPattern procedural texture generator.

Source
houndstooth(subdivisions : Int = 2, tooth_slant : Float64 = 0.5, tile_size : Int = 128, invert : Bool = false) : HoundstoothPattern

Creates a customized HoundstoothPattern procedural texture generator.

Source
index(key : String | Symbol) : Int32

Looks up the 0-based index of a pattern by key, raising KeyError if not found.

Source
index?(key : String | Symbol) : Int32 | Nil

Looks up the 0-based index of a pattern by key, or returns nil if not found.

Source
keys
Source
normalize_key(key : String | Symbol) : String

Normalizes a pattern lookup key (accepts hyphens, underscores, spaces, or .svg suffix).

Source
path(key : String | Symbol) : String

Returns the canonical res://addons/pattern_material/textures/patterns/<id>.svg path for key.

Source
path?(key : String | Symbol) : String | Nil
Source
path_at(idx : Int) : String
Source
polka_dots(dot_radius : Float64 = 18.0, columns : Int = 2, rows : Int = 2, stagger : Bool = true, ring_thickness : Float64 = 0.0, tile_size : Int = 128, invert : Bool = false) : PolkaDotPattern

Creates a customized PolkaDotPattern procedural texture generator.

Source
rings(ring_count : Int = 3, ring_width : Float64 = 8.0, max_radius : Float64 = 45.0, corner_overlays : Bool = false, tile_size : Int = 128, invert : Bool = false) : RingPattern

Creates a customized RingPattern procedural texture generator.

Source
scales(columns : Int = 2, rows : Int = 2, arch_rings : Int = 3, stroke_width : Float64 = 4.0, tile_size : Int = 128, invert : Bool = false) : ScalesPattern

Creates a customized ScalesPattern procedural Seigaiha / wave-arch texture generator.

Source
size
Source
spirals(columns : Int = 2, rows : Int = 2, turns : Float64 = 2.0, arms : Int = 2, stroke_width : Float64 = 4.0, tile_size : Int = 128, invert : Bool = false) : SpiralPattern

Creates a customized SpiralPattern procedural vortex texture generator.

Source
stars(columns : Int = 2, rows : Int = 2, points : Int = 4, outer_radius : Float64 = 22.0, inner_radius : Float64 = 8.0, stagger : Bool = true, tile_size : Int = 128, invert : Bool = false) : StarPattern

Creates a customized StarPattern procedural texture generator.

Source
stripes(stripe_count : Int = 4, duty_cycle : Float64 = 0.5, angle_degrees : Float64 = 0.0, crosshatch : Bool = false, tile_size : Int = 128, invert : Bool = false) : StripePattern

Creates a customized StripePattern procedural texture generator.

Source
tartan(subdivisions : Int = 2, main_band_width : Float64 = 16.0, accent_band_width : Float64 = 4.0, diagonal_twill : Bool = true, tile_size : Int = 128, invert : Bool = false) : TartanPattern

Creates a customized TartanPattern procedural plaid weave texture generator.

Source
texture(key : String | Symbol) : Texture2D | Nil

Preloads and returns the Texture2D for key when running inside Godot.

Source
truchet(columns : Int = 4, rows : Int = 4, stroke_width : Float64 = 6.0, seed : Int = 42, curved_arcs : Bool = true, tile_size : Int = 128, invert : Bool = false) : TruchetPattern

Creates a customized TruchetPattern procedural maze / Smith-arc texture generator.

Source
waves(waves : Int = 2, bands : Int = 2, amplitude : Float64 = 16.0, thickness : Float64 = 10.0, tile_size : Int = 128, invert : Bool = false) : WavePattern

Creates a customized WavePattern procedural texture generator.

Source
zig_zag(peaks : Int = 2, bands : Int = 2, amplitude : Float64 = 20.0, thickness : Float64 = 12.0, tile_size : Int = 128, invert : Bool = false) : ZigZagPattern

Creates a customized ZigZagPattern procedural texture generator.

Source