Coder Social home page Coder Social logo

Strange Rendering Issue about gltf2usd HOT 9 CLOSED

kcoley avatar kcoley commented on August 15, 2024
Strange Rendering Issue

from gltf2usd.

Comments (9)

kcoley avatar kcoley commented on August 15, 2024

Hi @ox. I’ll take a look and investigate.

from gltf2usd.

kcoley avatar kcoley commented on August 15, 2024

@ox

  • looks like this model uses morph targets which I have not yet implemented in this tool, but I will create an issue to track it.

  • Disabling animations allows your carrot model to load on iOS though it is very large so it may end up behind or above you if you look around. glTF uses meters are its unit of measurement while USD uses centimeters, so I scale the glTF models by 100x to match this convention. However, you can tweak the xformOp:scale at the root node to remove or change the 100x scale to a different value:

def Xform "root"
{
    float3 xformOp:scale = (100, 100, 100)
    ...
}

I mentioned in another issue that I could make this a command line parameter, so I will track that too in case source glTF models are actually not in meters.

from gltf2usd.

kcoley avatar kcoley commented on August 15, 2024

I forgot to address the usdview issue. It was mentioned on the USD interest forum that usdview currently expects all PreviewSurface parameters to be explicitly defined, which this tool does not currently do. There are plans to update usdview to not require all parameters to be set, but I can create an issue to track this one too.

from gltf2usd.

ox avatar ox commented on August 15, 2024

@kcoley Ahh yea, I forgot to mention that I had to return a (transform, lambda m: m) (or something like that) when the tool had to parse weights. I'm going to try disabling the animations and trying again. I think it's doable since USD also supports Blendshapes (weights) from what I can tell by playing with ARKit.

What forums are these? Also, would defining all of the params (guessing this?) cause the rendering to show up correctly? I was having trouble rendering the sample plane from that page with one of the carrot's textures, maybe that's why.

from gltf2usd.

kcoley avatar kcoley commented on August 15, 2024

@ox

I think it's doable since USD also supports Blendshapes (weights) from what I can tell by playing with ARKit.

Yep, USD does support blend shapes in the latest release, so I would just need to implement it

What forums are these?

There is a USD interest Google group: https://groups.google.com/forum/#!forum/usd-interest
You'll just need to sign in with a Google account.

Also, would defining all of the params (guessing this?) cause the rendering to show up correctly?

Yes, that was mentioned in one of the threads in the group. I have not tried it myself, but I will implement it after fixing the bigger skeleton/blend shape animations.

from gltf2usd.

ox avatar ox commented on August 15, 2024

Hmm no dice on getting a single PreviewSurface to render properly. I edited the pbrmaterial_6 Material here and am still getting a black body for the carrot. I then tried to use a primvar to somehow get the normals passed into the PreviewSurface but kind of got lost.

What's interesting is that Apple's models (like this red chair) come out looking gray, and use normal maps and primvar shaders to extract the normals from a png rather than specifying normals on the Mesh.

from gltf2usd.

wave-electron avatar wave-electron commented on August 15, 2024

@ox

I didn't have any issues with the render, used xcode beta 6. Viewable in IOS 12 beta 10.

carrothead.usdz

carrothead

from gltf2usd.

ox avatar ox commented on August 15, 2024

@wave-electron Hmm strange. By render I meant in usdview, which I was assuming would be the definitive tool on USD rendering. Glad to see that it works, but I'm on iOS 12 Beta 11 (16A5365b) and I don't even get the preview.

How is your USDZ 400kb smaller than the USDZ I provided here? The only difference reported by usddiff between the two is that mine has assets in a dir called 0 and yours does not. Did you use usdzip or the usdz_converter?

from gltf2usd.

ox avatar ox commented on August 15, 2024

Ok I think I figured it out! turns out usdzip is very naive in how it constructs the usdz files. Some changes I had to make:

  • make sure the USD file is in USDC format with a .usdc extention
  • operate inside of the directory you're packaging up
  • make sure that the .usdc file is the first argument to usdzip

I was circling around it until I started dumping the contents of @wave-electron's model. I'm now able to get the model to show up in the Files app! Thank you for your help y'all.

from gltf2usd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.