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

Xps/xnalara. How to export 3d model with xps shaders to .glb/gltf? #91

Open
SeruiosBoss opened this issue Nov 4, 2021 · 3 comments
Open

Comments

@SeruiosBoss
Copy link

Hello. When I export model with xps shaders in gltf there are no colors and textures, there are only materials, but if I edit material from xps shader to image texture and choose the same .tga file it works correctly, but there are no colors in gltf with xps shader. But I want to have it because there are really good flares and reflections in model with xps shader. (body mesh and bodyenv mesh with flares and reflections). What can I do? Thx.

@jbienz
Copy link

jbienz commented Jan 17, 2022

I've been messing around with this tonight. As you noted, the problem is related to the XPS shader but it's also related to the GLTF exporter. Here's the documentation for that exporter:

https://docs.blender.org/manual/en/2.90/addons/import_export/scene_gltf2.html

The GLTF exporter is expecting Principled BSDF to be connected directly to the Material Output node. But with XNALara, the XPS shader is connected to Material Output. XPS shader does internally use Principled BSDF, but the GLTF Exporter does not drill down into XPS to find the Principled BSDF.

Though GLTF Exporter could be modified to drill down into the graph, it's unlikely Khronos would want to do that. I think the proper fix would be for XNALara to end with a Principled BSDF rather than encapsulate one. I have tried replacing XPS shader with regular Principled BSDF and the textures do export. But this is a lengthy process since it has to be done for multiple parts.

I'm not the author of this library so I hope that @johnzero7 can take a look and determine the best way to fix this properly.

@ldo
Copy link

ldo commented Jan 17, 2022

Maybe a simpler solution would be to adapt the XNALara code to create a direct converter to glTF, bypassing Blender altogether.

@jbienz
Copy link

jbienz commented Feb 8, 2022

Not to downplay the value and importance of the XnaLara project, but I did want to share a related tool. Specifically for the purposes of editing Halo assets in Blender and exporting them to GLTF, I found the Reclaimer project to have high compatibility.

https://github.com/Gravemind2401/Reclaimer

That project is a Halo asset extractor, and at the bottom of that page you'll also find the AMF Blender script for importing the extracted assets into Blender with PBR.

Cheers!

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