Skip to content

feat(textures): per-axis texture wrapping (wrapS/wrapT)#254

Merged
marco-ponds merged 1 commit into
masterfrom
feat/texture-wrapping
Jun 29, 2026
Merged

feat(textures): per-axis texture wrapping (wrapS/wrapT)#254
marco-ponds merged 1 commit into
masterfrom
feat/texture-wrapping

Conversation

@marco-ponds

Copy link
Copy Markdown
Collaborator

What

Adds independent per-axis texture wrapping in Element.setTexture:

  • Reads wrapS / wrapT from options and applies them separately (texture.wrapS / texture.wrapT) instead of collapsing to a single wrap.
  • Records both axes so they serialize and round-trip through save/reload and game builds.
  • Sets texture.needsUpdate = true — wrapping is a sampler-level setting, so a change must re-upload the texture.
  • Falls back to the legacy single wrap when per-axis values are absent, so textures recorded before this still resolve correctly.

Combined with the existing setTextureOptions (from #253), callers can update either axis on an already-assigned texture without reloading it.

Why

Follow-up to #253 (offset + setTextureOptions, released in 3.27.2). The editor's redesigned Wrapping control lets users set horizontal (S) and vertical (T) wrap modes independently — or link them — which needs the engine to honor per-axis values rather than forcing both to one wrap.

Testing

  • npm test → 505/505 pass (29 suites).
  • Verified live in the editor (engine linked locally) before this PR — linked/independent wrapping applies in-viewport and persists on reload.

Release / companion

Needs a release (e.g. 3.27.3) so the editor can consume it. The editor wrapping UI is held until then; it will pin the new version rather than 3.27.2 (which has repeat/offset but not per-axis wrapping).

🤖 Generated with Claude Code

setTexture now reads and applies independent wrapS/wrapT from options,
falling back to the legacy single `wrap` so textures recorded before
per-axis support still resolve. Both axes are recorded, and the texture
is flagged needsUpdate since wrapping is a sampler-level change. This
lets callers set horizontal/vertical wrapping independently through
setTextureOptions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@marco-ponds marco-ponds merged commit ed216ab into master Jun 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant