-
-
Notifications
You must be signed in to change notification settings - Fork 18
How to export glTF 2.0 #28
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
Comments
@30350n did you test how it looks like if you render top and bottom image and put it as image texture on the surface of the blank imported glb body? |
No, but what your suggesting is more or less a very naive version of texture baking. |
Dear @30350n, I hope you started well into the new year!? Do you have any news/updates about this feature? |
Yes, thanks, hope you did too.
No, not really and it wouldn't really be the main priority either. The main thing that needs to be done is a rework of all the materials, to improve performance (and visuals). Though this could also atleast simplify the export problem ... Regardless, I can't really invest the time that would take atm. |
Thank you very much for your time and for updating this amazing project. 👍 Well for now I'll see how I can embed a VRML export from KiCad to my web presentation. But I think using a glTF 2.0 export with your material finish in a model viewer would be much nicer |
You can bake the textures out with the Blender passes (the ones you will need are Diffuse Color, Glossy Color, Roughness, Normal, and optionally Ambient Occlusion) onto a secondary UV map (you can use the integrated Smart UV Project function for this, it doesn't need to be fancy). Unfortunately Blender doesn't support exporting with the KHR_materials_pbrSpecularGlossiness extension though, so you'll have to export it as glTF and then edit the JSON with the proper specular setup: If you want the solder mask to show up in the normal map, you'll need to bake the normal map pass (and AO, if you want it to show up there as well) with a modified shader setup like this: Attached is an example glTF file: Make sure that the viewer you're using has support for SpecularGlossiness though, it looks like <model-viewer> might not support it. I know Babylon.js and PlayCanvas do. TLDR: Not impossible, but certainly not a single button press. If you're familiar with Blender and the glTF standard it shouldn't be too difficult though. |
Small update: It appears that with the Blender 4.2 update, you can export spec-gloss materials with a node setup like this: With manual glTF editing out of the way, the only hurdle to exporting as glTF is now just baking the materials down to textures, and it's not that hard if you understand how rendering in Blender works. Here's an example glB file for reference: compressed.zip @N0cynym If you still need a pcb3d file converted to glTF, I can take a crack at it if you want to send it my way. |
Thanks a lot for looking into this and for sharing your findings! Ideally this would probably be automated, either by selecting a special "GLTF Export" material mode in the importer or by having a special "Export PCB to GLTF" operator somewhere, which could then also handle the baking as well as possibleGLTF post processing. Regarding the "baking" part of this, I tried looking into this quite a while ago. WIP is available on the |
It would probably be easiest to have a button labeled something like |
Hey @crazy-hair , I would really be interested in a |
+1 for this functionality. I have been trying to do something similar with a missmatch of different plugins for blender but I never could get it to work. |
@30350n do you plan to merge the master into Anyway, thank you for the awesome project! |
If you are new to Blender (like me), there is a helpful short video about how to bake textures on a material: Based on this, and @crazy-hair 's Aug 11st shader workflow, it is not too hard to replicate and export to glTF successfully. I hope this helps @Mosaic-modular ! |
Not really, as it's really WIP and not finished/ready at all. |
I just have a question:
How can I export from my blender project a
.glb
with rendered surface texture?I want to create a file for https://modelviewer.dev/editor/
Thanks for this tool 🙏
The text was updated successfully, but these errors were encountered: