MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

Spec: case-sensitive vs. case-insensitive path resolution not specified

Open hybridherbst opened this issue 2 years ago • 5 comments

Hi, it seems that the MaterialX spec and supplements currently do not specify whether file references (references to textures) should be treated case-sensitive or case-insensitive by implementations. Currently, that leads to interoperability issues as a material that is designed on one OS (e.g. Windows) with a viewer that may or may not care about casing may break on another OS or even on another viewer that implements file resolution differently.

For a format designed for interoperability between applications that's not great; for reference, the glTF spec states specific RFCs as references for relative paths (scheme and host are case-insensitive and the rest is case-sensitive), without requiring normalization (so schema and host could also be uppercase or mixed).

Opening this issue to see clarification - either that the MaterialX spec itself explicitly doesn't care and leave the choice up to implementations, or that the MaterialX spec recommends or requires that relative paths follow some rules (which I'd be in favor of to ensure compatibility).

I'm raising this issue because I noted that this MaterialX file uses the worst of both worlds with a mix of exact references and references with wrong casing ("baseColor" but the file is named "basecolor"). Zip for archival purposes: Emerald_Peaks_Wallpaper_1k_8b_O9xco8x.zip Subsequently, it renders differently on different viewers even on the same machine (some don't care, some care about casing) and it will likely break on other OSs.

hybridherbst avatar Aug 21 '23 14:08 hybridherbst

Leaving a ping with @dbsmythe for comments on this.

kwokcb avatar Aug 21 '23 14:08 kwokcb

This is a great point, @hybridherbst, and my initial thought is that we should recommend strict casing for file references in the MaterialX specification, and then emit warnings in Document::validate when file references don't adhere to this guideline.

jstone-lucasfilm avatar Aug 24 '23 17:08 jstone-lucasfilm

I second a vote for strict casing.

meshula avatar Aug 25 '23 03:08 meshula

Third!-DougOn Aug 24, 2023, at 8:49 PM, Nick Porcino @.***> wrote: I second a vote for strict casing.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

dbsmythe avatar Aug 25 '23 05:08 dbsmythe

Apologies for the ugly email-reply formatting above, but yes, the intent of the Spec is that all naming in MaterialX (nodenames, inputs, attributes, etc. etc.) is case sensitive.

dbsmythe avatar Aug 26 '23 21:08 dbsmythe