Comments (12)
So the texture it's failing on is the Ambient Occlusion png, which has 4 channels. The _convert_materials_to_preview_surface
function goes in expecting to use the r
component of the occulusionTexture
image as the occlusion map, sees a 4 channel image, which jumps to logic trying to unpack a glossiness map.
I think if you change your ao.png to only be 3 channels, it should work
from gltf2usd.
@enzyme69 yes what @ox says is correct since the logic initially assumes that you are using an ORM texture (occlusion: r, roughness: g, metallic: b). The texture logic definitely needs refactoring. I will look into that later today to make it more robust. But in the meantime, @ox solution should work.
from gltf2usd.
@sulydeni @sulydeni I think the USD implementation in XCode/iOS always reads the alpha value even if it is not used in the glTF and is ignored in the usd file. I'll make an issue to remove the alpha channel from the texture if it is not used in glTf.
from gltf2usd.
from gltf2usd.
@enzyme69 do you have a sample model that repros this issue?
from gltf2usd.
@kcoley This is the one:
USDZ_donut_rgba_error.zip
Maybe the texture itself is problematic. Just now, I convert all the PNG into JPG and works!
from gltf2usd.
Also something interesting I found with RGBA and RGB, try the model below:
https://sketchfab.com/models/f8b43d7d9f914480bfc91c8a4d6fd314
For some PNG, it gives this weird flipped overlapping material on the USDZ after conversion. Again this is seems to be RGBA related. If I save PNG as RGB, it works good.
from gltf2usd.
It makes me wonder if we actually have "Occlusion Transparency Shader" already ...
from gltf2usd.
@kcoley Do you mean in the Blender material node itself, I could have **Roughness - Metalness -Occlusion (**greyscale) plug into RGB node which will translate into GLTF and works with your conversion?
from gltf2usd.
It's this Metalness and Roughness which unfortunate...
from gltf2usd.
It makes me wonder if we actually have "Occlusion Transparency Shader" already ...
I have a similar issue. My model does not reflect light the same way it does in gltf
from gltf2usd.
I recently merged a change to remove alpha channel based on alpha mode: #93
from gltf2usd.
Related Issues (20)
- Multiple objects animation (no armature) failed to convert HOT 10
- Material opacity lost on export to USDZ HOT 7
- large texture size after convert HOT 3
- Texture of object greatly reduced
- Skinned Mesh Bone Hierarchy
- 'bufferView' key error while loading GLTF
- Value Error('unknown file extension:') error for some gltf files HOT 2
- Addition of opacityThreshold for USD Preview Surface HOT 1
- Texture names with spaces do not work
- Warning: in _CreateNewUsdzPackage HOT 1
- Opacity and Alpha and Transparency HOT 4
- USD conversion stoped working HOT 2
- Sanitise node names HOT 5
- Compatibility with USD Python 19.11?
- Error converting GLTF with animations HOT 2
- Error python gltf2usd.py HOT 9
- Path must be an absolute path:<>
- Python3.7 upgrading and TypeError: TypeError: can't multiply sequence by non-int of type 'float'
- Expected VtArray<TfToken> HOT 1
- Multiple animations in 1 model support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gltf2usd.