Skip to content

Fix texture flipping for hextiledimage and hextilednormalmap. - #3016

Draft
jreichel-nvidia wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
jreichel-nvidia:hextiledimage-flip-v
Draft

jreichel-nvidia wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
jreichel-nvidia:hextiledimage-flip-v

Conversation

@jreichel-nvidia

Copy link
Copy Markdown
Contributor

Add new mxp_flip_v parameter to forward the generator option for texture flipping.

Add new mxp_flip_v parameter to forward the generator option for texture flipping.
@jstone-lucasfilm

Copy link
Copy Markdown
Member

This looks like a great improvement to me, @jreichel-nvidia, and I'd ideally like to merge #3001 before reviewing and merging this complementary work, so that we can leverage the new alignment between specification and codebase that it brings.

@jreichel-nvidia

Copy link
Copy Markdown
Contributor Author

@jstone-lucasfilm As suggested I've revisited this after #3001 has been merged.

Before this MR (ebc8cc8), the GLSL/OSL and MDL test renderers produces different results.
With this MR (36f5836), GLSL/OSL and MDL agreed.
With main after #3001 (7d0baee), GLSL/OSL and MDL are different.
Merging 7d0baee onto this branch, GLSL/OSL and MDL are still different.

I thought this MR needed some more changes to accomodate for #3001, but could it be that GLSL/OSL is now wrong?

(The following analysis was with some AI support, my apologies if I got it wrong.)

AIUI hex tiling has two distinct steps:

  1. From the material’s UV coordinates, determine tile IDs, random rotations/scales/offsets, and blend weights.
  2. Sample the image at the resulting coordinates.

Step 1 should produce the same results on every target. Only step 2 needs to account for different image origins.

Let H represent hex tiling and F the V flip. With the current test settings:

 Target               Pattern construction    Coordinates sent to texture lookup
                      (step 1)                (step 2)

 MDL                  H(uv)                   H(uv).coords
 GLSL/OSL (current)   H(F(uv))                H(F(uv)).coords
 GLSL/OSL (correct?)  H(uv)                   F(H(uv).coords)

(MDL uses fileTextureVerticalFlip=false, that's why 'F' it is absent from the 1st row.)

@jreichel-nvidia
jreichel-nvidia marked this pull request as draft October 5, 2026 07:45
@jreichel-nvidia

Copy link
Copy Markdown
Contributor Author

Converted back to draft to make it clear that I do not/no longer intend to merge the PR as it is.

This branch has not been deployed

No deployments
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.

2 participants