Skip to content

feat(extract): multi-texture & 3D/4D texcoords + matrix/multi texture transforms#42

Merged
delta9000 merged 1 commit into
mainfrom
feat/texture-multichannel-conformance
Jun 28, 2026
Merged

feat(extract): multi-texture & 3D/4D texcoords + matrix/multi texture transforms#42
delta9000 merged 1 commit into
mainfrom
feat/texture-multichannel-conformance

Conversation

@delta9000

Copy link
Copy Markdown
Owner

What

Extends texture extraction to the multi-channel and higher-dimension texture coordinate / transform nodes, and adds reader-tolerant field aliasing. Resolves four conformance findings.

Finding Clause Before After
TXT-6 §18.4.4 MultiTextureCoordinate silently fell back to default UVs (it has no point field) MeshBuilder unwraps MultiTextureCoordinate.texCoord children into MeshData.texcoordSets (all channels preserved), mirrors the first usable channel onto the legacy MeshData.texcoords seam, emits (0,0) fallback corners for empty channels
T3D-3 §33.4.4 TextureCoordinate3D/4D point arrays were never extracted reads MFVec3f/MFVec4f and projects onto the 2D (s,t) seam — (s,t) for 3D, homogeneous (s/w, t/w) for 4D
TXF-3 §18.4.10 only the single TextureTransform was handled MultiTextureTransform → one TextureTransform2DParams per child, applied per-channel; TextureTransformMatrix3D projects its 4×4 over (s,t,0,1)
TPJ-2 §42.4.2 strict readers dropped the spec-erratum spelling shadowsIntensity reader-only FieldAliases.hpp accepts it on TextureProjectorParallel as a tolerant alias for canonical shadowIntensity across XML, ClassicVRML, VRML97, JSON. Writers stay canonical

How

  • MeshData gains texcoordSets (per-channel UVs); the legacy single-channel texcoords is preserved and mirrors the first usable channel, so existing consumers (PickSystem, both renderers) are unaffected on the common path.
  • applyTextureTransformsToMesh / textureTransformParamsListOf are the new plural entry points; SceneExtractor switches to them. Identity transforms / absent textureTransform still early-out with no allocation.
  • TextureTransform2DParams gains an optional hasMatrix path used by TextureTransformMatrix3D.
  • FieldAliases.hpp (codecs) is purely reader-side: it remaps accepted input spellings to canonical field names during ingest and changes no node metadata or writer output.

Tests / gates

  • texture_extract_test: multi-texture coords (incl. empty leading channel), 3D/4D projection, MultiTextureTransform, TextureTransformMatrix3D.
  • reader_audit_test: shadowsIntensity alias across all four encodings.
  • mise run build-ci green — 112/112 ctest. mise run conformance-gate clean (generated view matches findings.yaml).

Notes / scope

  • texcoordSets is forward-looking plumbing: no renderer consumes the extra channels yet, so multi-channel UVs are extracted and transformed but only channel 0 reaches the current single-texture render path. The 3D/4D → 2D projection and matrix → 2D projection are the spec-permitted implementation-dependent fallbacks onto the current single-(s,t) seam, not full volumetric/3D-texture support.
  • Independent of (and not stacked on) the GLFW examples-gate fix in fix(poc): GLFW_INCLUDE_NONE — repair the headless examples-gate (GL/gl.h) #41.

… transforms

Extend texture extraction to the multi-channel and higher-dimension texture
coordinate/transform nodes, plus reader-tolerant field aliasing. Resolves four
conformance findings:

- TXT-6 (§18.4.4): MultiTextureCoordinate no longer falls back to default UVs.
  MeshBuilder unwraps MultiTextureCoordinate.texCoord children into
  MeshData.texcoordSets (all channels preserved), mirrors the first usable
  channel onto the legacy MeshData.texcoords seam, and emits (0,0) fallback
  corners for empty channels.
- T3D-3 (§33.4.4): TextureCoordinate3D (MFVec3f) and TextureCoordinate4D
  (MFVec4f) point arrays are now read and projected onto the 2D (s,t) seam --
  (s,t) for 3D, homogeneous (s/w, t/w) for 4D (spec-permitted impl-dependent
  2D-texture fallback).
- TXF-3 (§18.4.10): MultiTextureTransform yields one TextureTransform2DParams
  per child; SceneExtractor applies per-channel transforms to matching
  texcoordSets. TextureTransformMatrix3D projects its 4x4 over (s,t,0,1).
- TPJ-2 (§42.4.2): reader-only FieldAliases.hpp accepts 'shadowsIntensity' on
  TextureProjectorParallel as a tolerant alias for canonical 'shadowIntensity'
  across XML, ClassicVRML, VRML97, and JSON. Writers stay canonical.

Coverage: texture_extract_test (multi/3D/4D coords, multi/matrix transforms)
and reader_audit_test (field-alias across all four encodings). findings.yaml
updated and the generated conformance view regenerated.
@delta9000 delta9000 merged commit c906241 into main Jun 28, 2026
14 of 15 checks passed
@delta9000 delta9000 deleted the feat/texture-multichannel-conformance branch June 28, 2026 12:01
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