Skip to content

ND_UsdPrimvarReader_vector2 fails shader generation for Hardware shading languages #2900

@ld-kerley

Description

@ld-kerley

USD uses UsdPrimvarReader to access primvars from the scene - most commonly texture coordinates to feed UsdUVTexture.

The current MaterialX shader generation for the hardware shading languages (which OpenUSDs Storm uses), currently fails code generation for these nodes.

test_file.zip (updated to include texture file)

The test files zip contains three files representing the same Material.

graph LR                                                                                                                                                                                                                                                                    
    Primvar["UsdPrimvarReader"]                                                                                                                                                                                                                               
    Tex["UsdUVTexture"]                                                                                                                                                                                                                                           
    SR["UsdPreviewSurface"]                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                            
    Primvar --> Tex                                                                                                                                                                                                                                                   
    Tex --> SR                                                                                                                                                                                                                                              
Loading

test_uvtexture_uv_primvarreader.usda

Which is the USDShade version - this renders fine in Strom

Image

test_uvtexture_uv_primvarreader_mx.usda

Which is the MaterialX version in USD - this does not render in Storm.

Image

And emits the following error...

ERROR: Usdview encountered an error while rendering.
	Error in 'pxrInternal_v0_26_5__pxrReserved__::HdSt_ApplyMaterialXFilter' at line 1629 in file /Users/leekerley/dev/github_ld_kerley/OpenUSD/pxr/imaging/hdSt/materialXFilter.cpp : 'Unable to create the Glslfx Shader.
MxException: No 'geomprop' parameter found on geompropvalue node 'primvar'. Don't know what property to bind'
Coding Error: in HdSt_ApplyMaterialXFilter at line 1629 of /Users/leekerley/dev/github_ld_kerley/OpenUSD/pxr/imaging/hdSt/materialXFilter.cpp -- Unable to create the Glslfx Shader.
MxException: No 'geomprop' parameter found on geompropvalue node 'primvar'. Don't know what property to bind

test_uvtexture_uv_primvarreader.mtlx

A pure MaterialX version of the same material structure - note some minor tweaks were needed to address other differences noted in other issues between MaterialX and USD. This does not render in MaterialXView

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions