xtremexp / UT4X-Converter

Helps converting old Unreal (Tournament) maps to UT3 (2007) / UT4 (2015) game.
Other
63 stars 18 forks source link

[U1/UT99->UT3/4] Wrong Texture Alignment when PanU/V set #2

Closed xtremexp closed 1 year ago

xtremexp commented 9 years ago

Polygons with Pan U/V values have bad texture alignement for Unreal 1/Unreal Tournament maps It can be really annoying to manually fix all textures unaligned afterwards.

DmFith converted to UT3 with unaligned texture :

Image

Original t3d polygon surface data:

Begin Polygon Item=OUTSIDE Texture=Starship.Panel.s4 Link=2
    Origin   +00000.000000,-01216.000000,+00000.000000
    Normal   +00000.000000,+00000.000000,+00001.000000
    TextureU +00000.500000,+00000.000000,+00000.000000
    TextureV +00000.000000,+00000.500000,+00000.000000
    Pan      U=160 V=64
    Vertex   -00064.000000,-00064.000000,+00000.000000
    Vertex   +00064.000000,-00064.000000,+00000.000000
    Vertex   +00064.000000,+00064.000000,+00000.000000
    Vertex   -00064.000000,+00064.000000,+00000.000000
End Polygon

Converted to UT3 (with 1.25X scale):

 Begin Polygon Item=Side Texture=DmFith.Starship_Panel_s4_Mat Flags=3584 Link=2 ShadowMapScale=64.000000
    Origin   +01520.000000,+00000.000000,+00000.000000
    Normal   +00000.000000,+00000.000000,+00001.000000
    TextureU +00000.000000,+00000.800000,+00000.000000
    TextureV -00000.800000,+00000.000000,+00000.000000
    Vertex   +00080.000000,-00080.000000,+00000.000000
    Vertex   +00080.000000,+00080.000000,+00000.000000
    Vertex   -00080.000000,+00080.000000,+00000.000000
    Vertex   -00080.000000,-00080.000000,+00000.000000
  End Polygon

Different tests to see how it works. TextureU and TextureV are used for texture scaling and rotation. Origin, PanU, PanV are used for texture position.

PanU=0, Origin=(0,0,0) image

PanU=16, Origin=(0,0,0) image

PanU=0, Origin=(-16,0,0) image

xtremexp commented 1 year ago

Update: partially fixed in 1.2.1 still some remaining textures with bad alignment.

xtremexp commented 1 year ago

Finally this painful bug is fixed, all textures are now correctly aligned. DM-ArcaneTemple (Original): image

DM-ArcaneTemple (Converted): image