kcoley / gltf2usd

command-line utility for converting glTF 2.0 models to USD
MIT License
263 stars 39 forks source link

Issue converting GLFT and getting texture to properly render #44

Closed scottstevens closed 5 years ago

scottstevens commented 6 years ago

I've been playing around with this and have been having an easy time converting GLFT's from around the web... but have been having a lot of problem getting ARKIT to properly render out the textures from assets of my own. I was wondering if there was some insight that could be provided as to why my USDZ version is not working when the GLFT is fine.

I incidentally had to fix something locally to get this to convert (I havent sent a pull request for it yet) The first line of _convert_texture_to_usd seems to have indexing problems when referencing the textures... ive fixed this by having it use the actual source:

image_name = gltf_texture if (isinstance(gltf_texture, basestring)) else self.images[self.textures[gltf_texture['index']]['source']]

(Source GLFT) DeclanChair_TobiasGravel.zip

(USDZ) declan.zip

kcoley commented 6 years ago

Hi @scottstevens . At first glance, it looks to be an issue with normals viewing on iOS where it seems to look okay in XCode. I'll take a look at it this weekend to see if I can find out what's causing this.

Also thanks for flagging the texture issue. It's possible it is related. I plan on refactoring the material logic, so hopefully it would be more robust since USD is very particular about how textures should be created on iOS.

enzyme69 commented 6 years ago

@scottstevens I checked your USDZ with iOS 12 GM, seems to work!

scottstevens commented 6 years ago

I had gotten the model to show up but not with the proper textures. It's supposed to have hints of tan (but ends up a slate gray on the iPhone). Did you compare to the glft?

On Thu, Sep 13, 2018, 8:14 PM Jimmy Gunawan notifications@github.com wrote:

@scottstevens https://github.com/scottstevens I checked your USDZ with iOS 12 GM, seems to work!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kcoley/gltf2usd/issues/44#issuecomment-421199763, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9L8GWA5_yIsevgaBb4e1JrjlDZPeyLks5uawLlgaJpZM4WfkqU .

kcoley commented 5 years ago

Hi @scottstevens . I have been doing some major refactoring in the code (almost done) on the refactor_skeleton branch. In the process, I was able to get the texture to render correctly on iOS 12 GM. chair.usdz.zip

I plan to have the PR ready pretty soon for others to test out.

scottstevens commented 5 years ago

@kcoley Im a bit puzzled unless this is some issue with my install of USD. Every time I run an asset I get this:

sofa

scottstevens commented 5 years ago

@kcoley Are you running with different code than the current branch? I noticed your USDA output has a bias set on the normal texture, however, the code sets the bias to none?

image

kcoley commented 5 years ago

Hi @scottstevens , yes sorry, I made the conversion on my refactorSkeletons branch: https://github.com/kcoley/gltf2usd/tree/refactorSkeletons

It's still work in progress, but you can give it a try with the models. I am changing how I am loading textures using pillow, which fixes a bug with loading grayscale images.

kcoley commented 5 years ago

@scottstevens the update for this should now be in master