Tutorials & Guides
How to Prompt Midjourney v6 for Seamless Tileable Textures in WebGL and 3D Web Apps
Creating custom repeating textures for Three.js and WebGL usually requires expensive subscriptions or hours of manual editing. Here is how to prompt Midjourney v6 to generate perfectly seamless patterns out of the box.
Updated 10/28/2026
The Repeating Texture Problem in 3D Web Apps
If you are building 3D environments for WebGL, Three.js, or React Three Fiber, you already know the pain of texture hunting. You search through sketchy stock libraries, find a texture that looks almost right, map it to your 3D plane, and... there they are. Stark, ugly seams running down the middle of your terrain like a badly aligned carpet.
Historically, fixing this meant dropping the asset into Photoshop, using the Offset filter, and clumsily stamping out the edges.
With the release of Midjourney v6, we have a far faster alternative. By mastering Midjourney’s internal styling engine, we can generate high-fidelity, completely seamless, tileable textures directly from text prompts. Let’s look at how to construct the prompts, eliminate baked-in lighting, and integrate these assets into your WebGL workflow.
Which AI should I use for this?
Tickd is independent and not affiliated with any AI company.
The Secret Weapon: The `--tile` Parameter
Midjourney has a built-in feature designed specifically for this task: the --tile parameter. When appended to your prompt, it instructs the diffusion engine to generate an image where the top edge matches the bottom edge, and the left edge matches the right.
However, simply throwing --tile at the end of a generic prompt like "stone wall --tile" will give you a terrible, unusable result for WebGL. The texture will contain heavy shadows, uneven lighting gradients, and highly distinct visual landmarks that look obvious when repeated fifty times across a landscape.
To see live examples of how these repeated patterns look under different light rigs, check out the official pattern showcase on the /platforms/midjourney hub page.
Step 1: Deconstructing the Perfect Texture Prompt
To make a texture truly usable in a 3D shader, it must have three core properties:
- Flat Orthographic Perspective: No 3D perspective distortion. The camera must look straight down onto the surface.
- Diffuse, Flat Lighting: No harsh directional shadows or spotlights. If your texture has bright white light baked onto the top half and dark shadows on the bottom, the tiling will look incredibly unnatural under your Three.js directional lights.
- Homogeneous Details: No unique, high-contrast objects (like one giant bright red brick in a gray brick wall) that break the illusion of infinity.
Let’s construct a prompt to generate a worn medieval stone floor:
`text
An orthographic, top-down flat-lay texture of medieval weathered stone flagstones, diffuse even lighting, clean grout lines, no perspective, highly detailed stone surface, realistic material texture, neutral grey tone --v 6.0 --tile --ar 1:1
`
Let’s dissect why this prompt works: "Orthographic, top-down flat-lay"*: This forces the engine to render the texture flat against the viewport, removing any vanishing points or camera tilt. "Diffuse even lighting"*: This tells the model to keep the luminosity uniform across the entire image. No hot spots, no baked-in studio lights. "Neutral grey tone"*: By keeping the base colour simple, we make it infinitely easier to tint the texture dynamically inside our WebGL code later. `--tile`*: The critical flag that forces the edges to match mathematically. `--ar 1:1`*: Textures in WebGL perform best when they are perfectly square powers of two (e.g., 1024x1024 or 2048x2048). This makes it easy for graphics cards to mipmap the textures.
Step 2: Refining and Fine-Tuning the Outputs
Once Midjourney serves up your grid of four variations, do not just download the first one that looks pretty. Look at the grid as a whole. Ask yourself: Does one of these quadrants have a glaring visual focal point?
If Quadrant 2 has a large, distinct crack in the middle of one tile, avoid it. When you tile that image 10x10 across a ground plane, that crack will appear 100 times, destroying your user's immersion. Opt for the variation with the most uniform, balanced distribution of detail.
If you find your prompts are generating too much stylistic flare, you can dial down Midjourney's default aesthetic influence by adding the --style raw flag. This forces the model to stick strictly to your text parameters rather than injecting cinematic lighting.
Step 3: Generating the Missing Maps
For a texture to look truly realistic in a WebGL environment, you can’t just map a flat PNG to your material. You need a PBR (Physically Based Rendering) pipeline. This requires multiple texture maps to dictate how the surface interacts with light:
- Albedo (Base Color): The flat image you just generated in Midjourney.
- Roughness Map: A greyscale map where white represents rough surfaces (like grout) and black represents shiny surfaces (like polished stone edges).
- Normal Map: A purple/blue map representing physical height and surface angle, allowing light to bounce realistically off the cracks.
Rather than firing up complex 3D software to generate these extra maps, you can use specialized web assets. Export your Midjourney texture, then open /platforms/figma-weave to run your asset through their spatial analysis plugins. These plugins convert your clean 2D inputs into high-fidelity, matching height and normal maps ready for immediate use in Three.js.
Step 4: Loading the Texture in Three.js
Once you have downloaded your seamless albedo and normal maps, you are ready to bring them into your code. Here is how you load and correctly configure them to repeat endlessly without stretching:
`javascript
import * as THREE from 'three';
// Create your scene, camera, and renderer... const scene = new THREE.Scene();
// Initialize the Texture Loader const textureLoader = new THREE.TextureLoader();
// Load your Midjourney generated assets const albedoMap = textureLoader.load('/textures/stone_albedo.jpg'); const normalMap = textureLoader.load('/textures/stone_normal.jpg');
// Crucial step: Configure wrapping behavior to repeat albedoMap.wrapS = THREE.RepeatWrapping; albedoMap.wrapT = THREE.RepeatWrapping; normalMap.wrapS = THREE.RepeatWrapping; normalMap.wrapT = THREE.RepeatWrapping;
// Define how many times the texture repeats over the geometry surface const repeatX = 4; const repeatY = 4; albedoMap.repeat.set(repeatX, repeatY); normalMap.repeat.set(repeatX, repeatY);
// Create a mesh material with realistic light reaction const material = new THREE.MeshStandardMaterial({ map: albedoMap, normalMap: normalMap, roughness: 0.8, metalness: 0.1 });
// Apply to a ground plane
const geometry = new THREE.PlaneGeometry(10, 10);
const floor = new THREE.Mesh(geometry, material);
floor.rotation.x = -Math.PI / 2;
scene.add(floor);
`
Troubleshooting Edge Cases
If you implement this and notice that your tiles are still showing weird borders, the culprit is almost always compression artifacts from upscaling, or an accidental aspect ratio mismatch.
Always ensure your output file is a true square. If you upscale your image outside of Midjourney using a third-party tool, that tool might crop or warp the edges slightly, destroying the seamless borders. If you run into visual glitches or weird artifacts on your exports, consult our dedicated troubleshooting guide at /platforms/midjourney/articles to optimize your upscale settings and workflow parameters.
By leveraging Midjourney v6 as your personal material designer, you can build beautifully complex, tactile WebGL worlds on a shoestring budget. No stock subscriptions required.
Keep going
Build something with the prompt generator, decode the jargon in the glossary, or compare the tools on our platform deep-dives.