MATERIAL WORKFLOW / TEXTURE LIGHTING
Fix uneven lighting in a seamless texture
Technical review: · Page structure updated: .
Try Lighting Balance when one side of the photograph is broadly brighter than the other, then inspect a 3×3 repeat. Keep the source, crop, offset and other controls fixed. The control can reduce a linear brightness trend; it cannot identify real illumination, remove every shadow or restore clipped pixels. If a centered bright patch or color cast is the problem, moving this slider may do nothing.
Use the Seamless Texture Generator to compare your own source. The tests below use its existing processing code and actual PNG downloads. They measure recovery toward a recorded reference image, not physically correct albedo or rendered material quality.
Why a tile can match at its edges and still repeat badly
Matching the outermost rows does not remove a bright region inside the tile. Repetition can turn that region into a regular lighting pattern. The default half-width and half-height offset also moves the original processing join into the tile interior, so an outer-edge comparison alone misses part of the result.
Our flat gray ramp produced zero RGB difference across both outer boundaries at Lighting Balance 0 and 100. Yet its error against the processed flat reference was 20.046875 and 0.859375 respectively. These numbers came from the same 256×256 input and do not mean either result has been validated in a 3D material.
For the broader visual checks, use the repeat-inspection guide. Here the narrower question is whether the control removes a known brightness trend without treating other image structure as lighting.
What Lighting Balance actually calculates
The current Worker estimates encoded-RGB luminance using 0.2126R + 0.7152G + 0.0722B. It compares the average luminance of narrow left/right and top/bottom edge strips, multiplies those differences by Lighting Balance / 100, and subtracts the resulting horizontal and vertical linear ramps equally from R, G and B. Edge blending runs afterwards.
For a 256-pixel side, the strip is 12 pixels wide; at 1024 it is capped at 16. Those averages are an estimate, not a separation of reflectance from illumination. The calculation operates on encoded 8-bit image values, not a calibrated linear-light photograph. It does not divide by a recovered illumination field, and it does not correct each color channel independently.
Controlled comparison: the same texture with a known ramp
We authored a 256×256 periodic gray texture T = 128 + 12 cos(2π8x/255) + 8 cos(2π6y/255), then added a horizontal ramp of 96(x/255 − 0.5) before rounding and clamping to 8-bit RGB. The reference is the same texture without that added ramp, processed at Lighting Balance 0. Both paths use Blend Width 12%, Blend Strength 75% and Offset 50% / 50%.

The full reference and source PNGs are in the raw experiment record. Error here is RGB MAE: sum of absolute output-to-reference channel differences divided by width × height × 3. There is no threshold. Displayed values below are rounded to three decimals; the CSV retains the raw values.
| Paired input | Balance 0 | Balance 50 | Balance 100 |
|---|---|---|---|
| flat-linear | 20.047 | 10.461 | 0.859 |
| periodic-linear | 20.044 | 10.473 | 0.891 |
| periodic-diagonal | 15.217 | 7.946 | 0.710 |
| periodic-multiply | 15.971 | 8.024 | 1.109 |
| periodic-spot | 7.720 | 7.720 | 7.720 |
| periodic-color | 8.767 | 8.767 | 8.767 |
| photo-brick-gradient | 8.356 | not tested | 0.718 |
| photo-wood-gradient | 8.024 | not tested | 1.517 |
Lower error means closer to this particular processed reference. It is not a measured accuracy rate, an all-material seam score or evidence of a physically correct texture. Even the additive ramp retains a residual because the edge-strip estimate, blending, rounding and quantization are not an exact inverse of its construction.
A centered bright patch survives the correction
The bright-patch fixture adds 40 exp(−16(u² + v²)), where u = x/255 − 0.5 and v = y/255 − 0.5. Its opposite sides have symmetric averages, so there is no directional edge difference for the control to subtract. The outputs at 0, 50 and 100 are byte-identical. All retain RGB MAE 7.72039794921875 against the processed reference.

This is an authored brightness patch, not a photograph of a measured light. It demonstrates the shape the current calculation misses: a centered, symmetric change can remain even while opposite-edge differences are zero. A localized cast shadow, vignette or specular highlight is not guaranteed to behave like a linear ramp.
A color change is not a luminance ramp
Another fixture changes red by 32u and blue by −94u while leaving green unchanged. Its weighted luminance changes very little. At this input's 8-bit precision, the downloaded outputs at 0 and 100 are identical; the color variation remains. This control is not a white-balance or color-cast correction.

There is a second ambiguity: the flat gray ramp could represent uneven illumination or an intentional material color gradient. The input pixels are identical under those two authored interpretations. Correcting toward flat gray helps the first target and changes the intended appearance of the second. The tool has no information that tells those cases apart.
Paired brick and wood tests
We kept the existing CC0 brick and wood photographs at their full 1024×1024 resolution. For each, we added 40(x/1023 − 0.5) equally to RGB, recorded clipping, and compared the processed result with the processed original photograph. The original photograph is a reference for the added perturbation, not a noise-free or lighting-free material capture.


The construction clipped 841 RGB channels in the brick image and 243522 in the wood image, out of 3145728 RGB channels per image. These are counts from the input construction, not estimated clipping rates. The lost values cannot be inferred back from the clipped PNG. Original lighting, low-frequency material color and structural discontinuities can also influence the edge estimate.
Increasing Blend Width or Blend Strength changes edge blending; it does not add a shadow-removal model. Smoothing is a Normal Map control, not a feature of this Seamless lighting correction. Do not keep widening the blend just to hide a brightness pattern if it produces doubled mortar or grain.
Compare your source without changing the question
- Upload one image to the Seamless Texture Generator. Note its resolution and keep the full frame.
- Record Blend Width, Blend Strength and Offset. Export a result with Lighting Balance 0.
- Change only Lighting Balance, using 50 and 100 as comparison settings rather than recommended presets. Export each result.
- Inspect the same areas in 3×3: the tile interior, joins and repeated bright or dark regions. Also look for lost intended color variation.
- If the defect is a local shadow, centered highlight, color cast or missing/clipped data, return to the source preparation. This tool cannot guarantee their removal. A more evenly lit capture or a separately corrected source may be necessary; no such external correction is demonstrated here.
The test contains 24 actual tool exports and records each input, parameter set, SHA-256 and full-size PNG. Sources, formulas and provenance are in the experiment record. No Blender, Unreal or physical rendering test was performed. Brightness consistency is a useful diagnostic, not proof of a complete PBR material.