Align UsdUVTexture wrap modes with USD specification#2979
Align UsdUVTexture wrap modes with USD specification#2979pixelsandpointers wants to merge 11 commits into
Conversation
Note: `useMetaData` requires more clarification and will not be included in the current PR.
Renames CONSTANT→BLACK and PERIODIC→REPEAT in ImageSamplingProperties::AddressMode to match standard GPU/USD terminology, and changes the default (UNSPECIFIED) address mode from Repeat to ClampToBorder across GL, Metal, and Slang backends so unspecified samplers black-border rather than tile.
|
I think this is up for review @ld-kerley and @jstone-lucasfilm. I am not entirely sure if all the changes I introduced were necessary (still fairly new to contributing to MtlX). Therefore, I am also uncertain if the versioning code should still target 1.39, or 1.40. The Happy for feedback and comments. |
|
@pixelsandpointers I haven't yet done a full review, but on my first read-through, it looks like you're renaming the address modes of all texture nodes, including the core |
|
@jstone-lucasfilm I was not sure which files concretely touch what. I grepped for the Concretely, that means I need to revert which changes? I assume I need to revert the gltf definitions, right? |
Closes #2899
The wrap mode enum values for
ND_UsdUVTexture_23did not match those used byUsdUVTexturein OpenUSD, making round-trip interchange lossy. This PR aligns the names, defaults, and fallback behavior with the USD specification.Changes
libraries/bxdf/usd_preview_surface.mtlxperiodic→repeatandblackis now explicitly included (was previously namedconstant)wrapS/wrapTfromperiodictouseMetaData, matching the USD defaultsource/MaterialXRender/ImageHandler.hAddressModeenum values:CONSTANT→BLACK,PERIODIC→REPEATto match USD terminologyGL / Metal / Slang texture handlers
REPEAT(GL:GL_REPEAT, Metal:MTLSamplerAddressModeRepeat) toBLACK(GL:GL_CLAMP_TO_BORDER, Metal:MTLSamplerAddressModeClampToBorderColor), matching USD's fallback fromuseMetaDatawhen no metadata is presentNot yet addressed
useMetaDatais now accepted as the default enum value in the nodedef, but reading wrap modes from texture file metadata is not yet implemented — a follow-up is noted with aTODO (#2899)comment in both the nodedef and theAddressModeenum.