Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaterialX: Incorrect result using place2d node with image node #1793

Closed
ashwinbhat opened this issue Mar 2, 2022 · 2 comments
Closed

MaterialX: Incorrect result using place2d node with image node #1793

ashwinbhat opened this issue Mar 2, 2022 · 2 comments

Comments

@ashwinbhat
Copy link
Contributor

Description of Issue

Using a MaterialX document that uses an Image Node with place2d to manipulate texcoord produces incorrect result in UsdView. The expected result is as shown below (from MaterialXView)
place2d
In UsdView the scale is incorrect as place2d is ignored.
2022-03-01_21-41-10

On debug build I get an assertion at
> usd_hd.dll!std::vector<std::shared_ptr<pxrInternal_v0_22__pxrReserved__::HdDataSourceBase>,std::allocator<std::shared_ptr<pxrInternal_v0_22__pxrReserved__::HdDataSourceBase>>>::front() Line 1603 C++ usd_hd.dll!pxrInternal_v0_22__pxrReserved__::_ConvertHdMaterialNetworkToHdDataSources(const pxrInternal_v0_22__pxrReserved__::HdMaterialNetworkMap & hdNetworkMap={...}, std::shared_ptr<pxrInternal_v0_22__pxrReserved__::HdContainerDataSource> * result=0x0000005653bd81d8) Line 2524 C++ usd_hd.dll!pxrInternal_v0_22__pxrReserved__::HdDataSourceLegacyPrim::_GetMaterialDataSource() Line 2690 C++ usd_hd.dll!pxrInternal_v0_22__pxrReserved__::HdDataSourceLegacyPrim::Get(const pxrInternal_v0_22__pxrReserved__::TfToken & name={...}) Line 2903 C++ usd_hd.dll!pxrInternal_v0_22__pxrReserved__::HdMaterialSchema::GetFromParent(const std::shared_ptr<pxrInternal_v0_22__pxrReserved__::HdContainerDataSource> & fromParentContainer={...}) Line 76 C++ usd_hd.dll!pxrInternal_v0_22__pxrReserved__::HdSceneIndexAdapterSceneDelegate::GetMaterialResource(const pxrInternal_v0_22__pxrReserved__::SdfPath & id={...}) Line 975 C++

Steps to Reproduce

  1. Extract attached zip file.
    image_place2d.zip
  2. Open test_image_only.usda in usdview the mtlx documents, image node is handled correctly.
  3. Open test_image_place2d.usda, notice that texture is incorrect scaled.

System Information (OS, Hardware)

Windows 10

Package Versions

v22.03

Build Flags

build_usd.py --openimageio --opencolorio --draco --materialx --embree

@jilliene
Copy link

jilliene commented Mar 7, 2022

Filed as internal issue #USD-7255

@JGamache-autodesk
Copy link
Contributor

I did start debugging a similar issue in usdView where the texture mode was set to the file default of UsdHydraTokens->clamp instead of the MaterialX default of UsdHydraTokens->repeat but I did not have time to find out exactly where the MaterialX defaults should override the file defaults in Storm.

You might want to try adding

    <input name="uaddressmode" type="string" value="periodic" />
    <input name="vaddressmode" type="string" value="periodic" />

to the image node in test_image_place2d.mtlx and see if the texture responds correctly.

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

No branches or pull requests

3 participants