USDZExporter: add MaterialBindingAPI schema, fix primvars:st data type, add colorspace for normal map#26009
Conversation
…e, add colorspace for normal map
| { | ||
| uniform token info:id = "UsdUVTexture" | ||
| asset inputs:file = @textures/Texture_${ id }.${ isRGBA ? 'png' : 'jpg' }@ | ||
| asset inputs:file = @textures/Texture_${ id }.${ isRGBA ? 'png' : 'jpg' }@ ${mapType === 'normal' ? rawTextureExtra : ''} |
There was a problem hiding this comment.
Should something like this be required for metalness, roughness, and other maps?
| asset inputs:file = @textures/Texture_${ id }.${ isRGBA ? 'png' : 'jpg' }@ ${mapType === 'normal' ? rawTextureExtra : ''} | |
| asset inputs:file = @textures/Texture_${ id }.${ isRGBA ? 'png' : 'jpg' }@ ${texture.colorSpace === NoColorSpace ? rawTextureExtra : ''} |
Note the import would need to be added at top of file.
There was a problem hiding this comment.
I'm not entirely sure but don't think so, I believe it's required for normals because these need to be scaled with 2 * N - 1 (the scale and bias here) and end up outside 0..1 range, so it may not apply to "simply linear" textures. I'll ask!
There was a problem hiding this comment.
From the docs it looks like it should -
https://openusd.org/release/spec_usdpreviewsurface.html#:~:text=sourceColorSpace%20%2D%20token%20%2D%20auto
I asked in the USD Working Group, will report back here.
There was a problem hiding this comment.
Yeah, I believe it should be what Don is saying. I'll merge and amend it.
We can revert if needed when we hear from the USD Working Group.
Related issue: #25996
Description
This PR fixes UV2 for AR QuickLook (needs to be texCoord2f[] instead of float2[]), and future proofs the exporter with the MaterialBindingAPI schema, which will be required starting with USD 23.08.
To quote,
It also adds
colorSpace = "Raw"for the normal map. QuickLook doesn't care but other viewers do.There's more fixes needed - follow-up PR :)
This contribution is funded by Needle