Closed timkurvers closed 8 years ago
Interesting! Possibly the wrong wrap settings for the texture(s)...
I've fixed this on my fork... I'll PR once I get some more testing in. The issue was kind of a cross between two separate issues:
1) M2Material does not need flipY on its textures
WMOMaterial
disables flipY
, but M2Material
wasn't disabling it. Instead, M2Material
was doing this in its shader:
texture1Coord = vec2(uv[0], -uv[1]);
texture2Coord = vec2(uv[0], -uv[1]);
This was fairly pointless, since just setting flipY
to false a la WMOMaterial
would have prevented the need to do the negation in the shader.
This, in turn caused the second related issue...
2) Textures should cache and load based on texture settings
Currently, the TextureLoader
assumes that, for a given texture path, it will always be used with the same settings (wrapS
, wrapT
, flipY
, etc). This isn't necessarily true, since texture settings are defined in the WMO and M2 data files, and some (probably many) textures are reused between various models.
My PR will fix both issues.
Screenshot of fixed wood texturing in Booty Bay:
Awesome research, screenshot looks stellar! :+1:
Fixed through #113.
Location:
this.player.worldport(0, -14354, 518, 22)