Repository navigation
Compile a root's declared position and orientation; repair --fix-tangents for zero-length tangents - #110
Merged
Conversation
…ents for zero-length tangents Root transform: the compiler never wrote position or orientation controllers on the model root. The game's compiler writes each when the ASCII declares it (explicit zeros too) and nothing otherwise: engine compiles of the new fixtures zcm_rootpos, zcm_rootzero and zcm_rootnone, which the compile now matches. Layonara's ttr01_z01_01 (root at z -1.75) moved up 1.75 m in a round trip; of the game's ASCII models only dag_chest declares one. Zero-length tangents: the game draws a mesh's tangents as given, and on a normal-mapped mesh a zero-length one shows as a white streak (Layonara's Center Craft Hall, tin01_l16_06: 7 to 57 per mesh, from its source file and from values the parser could not read). Compile keeps them, as the game does, with a warning; check's tangent_validation reports them (and drops them with --fix); repair --fix-tangents, part of --all, drops a mesh's tangents when any has zero length, so the compiler computes them from the geometry, as the game does for a mesh without them. The computed ones on tin01_l16_06 have none of zero length. Binaries were already safe: the decompiler drops a tangent stream that is not unit length unless the header asks for tangents. parity_compile --cli passes --force when the CLI has it: since the merged render lists change (#109) the CLI refuses a damaged binary the mutations make, which the library compiles; the comparison is about the bytes. Ported to python/ (compiler root rule, declared keywords, compile warning).
This was referenced Oct 21, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups to #109 from layonara/nwn-module#476 and #55.
Root transform.
zcm_rootpos,zcm_rootzeroandzcm_rootnoneare the game's compiles of those three cases. The compile now matches all three, and they fail without the fix.ttr01_z01_01(root at z −1.75) moved up 1.75 m in a round trip. Of the game's ASCII models, onlydag_chestdeclares a root transform.Zero-length tangents.
tin01_l16_06had 7 to 57 per mesh, from its source file and from values the parser could not read.compilekeeps them, as the game does, with a warning.check'stangent_validationreports them, and drops them with--fix.repair --fix-tangents, part of--all, drops a mesh's tangents when any has zero length, so the compiler computes them from the geometry. That's what the game does for a mesh without tangents; ontin01_l16_06the computed ones have none of zero length.parity_compile --clipasses--forcewhen the CLI has it. Since #109 the CLI refuses to write a binary whose render lists the mutations damaged, while the library compiles it, and that comparison is about the bytes. The fixture-only CI run doesn't use--cli, which is how #109 missed it.Testing.
tin01_l16_06as it was before haks PR fix(compiler): don't split skin vertices at material boundaries #23 (with the zero tangents), repaired with--fix-tangentsand compiled: no white strips in the Center Craft Hall.TestZeroLengthTangents(compile warning, drop, recompute) andTestTangentValidationZeroLength.Ported to
python/: the root rule, the declared keywords and the compile warning. README lists--fix-tangentsand--force.Qt: plenarius/cleanmodels-qt (feat/fix-tangents). Spec: plenarius/nwn-mdl-spec (spec/root-controllers).