Skip to content

fix(wsurf): align parallax tangents with surface and decal UVs - #35

Merged
hzqst merged 1 commit into
mainfrom
fix/parallax-tangent-orientation
Nov 12, 2026
Merged

hzqst merged 1 commit into
mainfrom
fix/parallax-tangent-orientation

Conversation

@hzqst

@hzqst hzqst commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Parallax displacement reverses on SURF_PLANEBACK faces because the face builder negates both texture tangents while leaving UVs in their original texinfo directions. Keep the outward-normal correction, preserve the UV tangent directions, and mirror the corresponding tangent when a decal uses FDECAL_HFLIP or FDECAL_VFLIP.

The production basis builders are shared with the existing real-OpenGL regression suite. It now checks the attached cube's six face orientations and all four decal flip combinations against independent world-ray/height-plane intersections, including five heights, positive/negative/zero scale, and frontal/oblique views. Existing midpoint and material-alignment coverage is retained.

Refs MetaHookSv/MetaHookSv#972. Root-cause investigation. Aggregator gitlink update: MetaHookSv/MetaHookSv#973; merge this component PR first.

Validation:

  • Demonstrated failures with the old signs: -Y world U expected 0.394000, actual 0.406006; after fixing face orientation alone, +Y/HFLIP decal U expected 0.406000, actual 0.393982.
  • Windows MSVC x86 Debug and Release: Renderer and all 18 test executables build successfully; CTest 19/19 in each configuration, no failures or skips.
  • Real GL: 270 six-face world cases + 1,080 six-face/decal-flip cases, retaining 432 midpoint/material/lightmap cases and 24 production shader variants. Intel UHD Graphics 770, OpenGL 4.4.
  • Pinned clang-format 23.1.3: 105 files, no differences; git diff --check passes; independent read-only review found no blocking issue.

The GPU regressions use the production basis builders and fragment shader with a test vertex shader. Full in-game visual acceptance has not been performed. This change also corrects the shared basis consumed by normal mapping.

Keep texinfo tangent directions on BSP back-plane faces and mirror the
corresponding tangent for decal horizontal and vertical UV flips. Exercise
the production basis builders and fragment shader across all six faces.

Co-Authored-By: Codex <codex@openai.com>
@hzqst
hzqst merged commit e5854b6 into main Nov 12, 2026
3 checks passed
hzqst added a commit to MetaHookSv/MetaHookSv that referenced this pull request Nov 12, 2026
Update Renderer to merged PR MetaHookSv/Renderer#35.

Co-Authored-By: Claude Code <noreply@anthropic.com>
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