← Seamless Wrap System Home

Seamless Wrap Function supports two different modes of operation:

  1. Texture Mode – using a Texture Object or a texture parameter
  2. RGB Input Mode – using dynamic RGB values generated entirely inside the material (e.g., procedural generators)

RGB mode exists specifically to allow seamless wrapping of procedural outputs, such as MF_AmoebaColorNoise or any custom generator.


1. Texture Mode (Standard)

Texture Mode is activated automatically when using a Texture Object.
You simply:

  • plug a Texture Sample (or texture parameter) into the material,
  • connect it to Seamless Wrap using MF_SW_TiledTexture,
  • and then connect the Seamless Wrap output to the material’s Color.

This process is described in Quick Start: Seamless Wrap.

No additional setup is needed.


2. RGB Input Mode (Dynamic Procedural Mode)

RGB mode enables Seamless Wrap to tile procedural textures, including:

  • noise functions
  • color generators
  • masked operations
  • multi-layered material functions

This mode requires three inputs:

  • MF_SW_RGB_Texture — original generator output
  • MF_SW_RGB_Texture_Reflected_X — horizontal reflection
  • MF_SW_RGB_Texture_Reflected_Y — vertical reflection

And two additional parameters:

  • MF_SW_UseRGBInputs = true (static bool)
  • MF_SW_TiledUV — tiled/cropped/mirrored UV

Why three generator calls?

To build a seamless texture from a procedural function, Seamless Wrap must compare:

  • original pattern
  • horizontally mirrored pattern
  • vertically mirrored pattern

Since procedural functions cannot be mirrored automatically, the user must supply all three.

This is done by calling your generator three times with different UVs.


Step-by-Step Setup

Step 1: Generate all UV variations

Use the function:

MF_TileUV_CropAndMirror
Path:
/SeamlessWrap/Materials/Functions/MF_TileUV_CropAndMirror

This function provides four outputs:

  1. Tiled UV
    Modified UV inside the tile (cropping, offset, tiling).
    → Connect to MF_SW_TiledUV
  2. Main Texture UV
    UV for the original generator call.
  3. X Reflected UV
    UV mirrored horizontally.
  4. Y Reflected UV
    UV mirrored vertically.

Step 2: Call your generator 3 times

For example, your generator = MF_AmoebaColorNoise.

Call it three times:

  1. Generator(UV = Main Texture UV)
    → Connect to MF_SW_RGB_Texture
  2. Generator(UV = X Reflected UV)
    → Connect to MF_SW_RGB_Texture_Reflected_X
  3. Generator(UV = Y Reflected UV)
    → Connect to MF_SW_RGB_Reflected_Y

All generator parameters (colors, distortion, scale, bias, etc.) remain dynamic — only UV changes.

Step 3: Enable RGB Input Mode

In Seamless Wrap:

  • Set MF_SW_UseRGBInputs = true (static bool)
  • Connect Tiled UV into MF_SW_TiledUV

Step 4: Use the Seamless Output

The output of Seamless Wrap is now a fully seamless procedural RGB texture.

This texture:

  • updates in real time as generator parameters change
  • does not rely on texture assets
  • behaves identically to a seamless Texture Sample

Performance Notes

Calling a generator three times can be expensive, especially if the generator contains:

  • multiple FBM layers
  • multiple noise functions
  • complex math
  • color quantization
  • branching

Therefore, this technique is not recommended for production materials.


For optimal performance, use the dedicated workflow:

Full Optimization Workflow: Bake → Seamless → Final Bake

This workflow is described in detail in a separate guide.

Summary:

  1. Bake the generator output using Texture Baker (Generator Mode)
  2. Apply Seamless Wrap to the baked texture
  3. Bake again to produce the final seamless Texture2D

This produces:

  • a high-quality seamless texture
  • extremely low shader cost
  • predictable performance on all platforms