Skip to content

Exporter: cut faces whose textures repeat - #60

Merged
rixnobis merged 1 commit into
mainfrom
tiled-uv
Oct 7, 2026
Merged

rixnobis merged 1 commit into
mainfrom
tiled-uv

Conversation

@rixnobis

@rixnobis rixnobis commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

The PS1 can't repeat a texture across a polygon, so the exporter clamped UVs outside [0,1]. Courtyard's UVs repeat up to 9 times across a face, so in game the floor was one flat colour and the bricks stretched, while the Scene view repeated them.

Textured triangles that span more than one copy are now cut along the integer U and V lines, and each piece is shifted back into [0,1]. The BVH is built over the exported triangles, because the engine indexes them in that order. Faces that already fit one copy are unchanged: anim, cutscene, light, skin and ui export byte-identical. Courtyard goes from 448 to 2248 triangles.

The PS1 can't repeat a texture across a polygon, so UVs outside [0,1] were
clamped: courtyard's floor drew as one flat colour and the bricks stretched.
Textured triangles spanning more than one copy are now cut along the integer
U and V lines and each piece is shifted back into [0,1]. The BVH is built
over the exported triangles, since the engine indexes them by Tri order.

Faces that fit one copy are unchanged: anim, cutscene, light, skin and ui
export byte-identical. Courtyard goes from 448 to 2248 triangles.
@rixnobis
rixnobis merged commit d9471f8 into main Oct 7, 2026
5 checks 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