Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

normalizeUV() clamps tiled textures with UVs > 1.0 incorrectly #32

Open
meszaros-lajos-gyorgy opened this issue Oct 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@meszaros-lajos-gyorgy
Copy link
Collaborator

const geometry = new PlaneGeometry(200, 200, 4, 4)

const material = new MeshBasicMaterial({
  map: Material.fromTexture(Texture.l2TrollStoneGround04, { flags: ArxPolygonFlags.DoubleSided }),
})
const mesh = new Mesh(geometry, material)
geometry.rotateX(MathUtils.degToRad(-90))

// every tile has 1 texture being fit onto
scaleUV(new Vector2(4, 4), geometry)

// normalizeUV(geometry)

applyTransformations(mesh)
mesh.translateX(map.config.offset.x)
mesh.translateY(map.config.offset.y)
mesh.translateZ(map.config.offset.z)
applyTransformations(mesh)
map.polygons.addThreeJsMesh(mesh, { tryToQuadify: QUADIFY, shading: SHADING_SMOOTH })

image

Enabling normalizeUV(geometry) will make it look like this:
image

It should instead make all UV coordinates go from 0.00 to 1.00

@meszaros-lajos-gyorgy meszaros-lajos-gyorgy added the bug Something isn't working label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant