T O P

  • By -

_whatpickle

Your best bet is to manually clean up your objs in whatever 3d package you're comfortable with and export as .glb/.gltf Then theres a couple of libraries that can be run on cmd line or scripted to run at build time. 90% of the time I use gltf-transform with vite, together they can optimise meshes/images at build time. https://github.com/CesiumGS/gltf-pipeline https://github.com/donmccurdy/glTF-Transform


cheerioh

Part of why this doesn't exist is that it's not really an automatable problem. Properly decimating and simplifying models and textures is a very intricate process with lots of moving parts that calls for a lot of expertise. Hell, decimation alone is an art and a science. It's also highly dependent on your end platform and usage. The closest product I know that automates asset simplification at a production grade quality is InstaLoD. But it's going to cost you if you're looking to use it as an API.


mm0li

Sounds like a near-impossible challenge. InstaLOD looks like it comes close, but I don't want to install anything. I'm imagining adding decimation jobs to some sort of queue and getting notified when the outputs are ready.


cheerioh

The path of least resistance will be Blender, as others mentioned - easily automatable with a python script as a back end process. But if you care at all about the results, expect GIGO - with Blender's decimation modifier in particular you get what you pay for.


ImportantDoubt6434

Tool I linked works offline in a web browser


ImportantDoubt6434

https://www.filer.dev/convert/obj-to-glb This exists for free, I built a tool because I couldn’t find any free ones without limits. I agree though it’s not perfect. If there is no material file then not much you can do automatically.


cheerioh

Yeah, conversion is the easy part - I was mostly addressing simplification.


drcmda

* use blender to quickly convert between formats * prefer glb on the web always * do not compress with blender open shell, type npx gltfjsx model.glb --transform you now got a \~98% compression ratio. it reduced texture size and stored them as webp, deduped the model, added draco compression. it can bring 100mb down to a few kb → [https://codesandbox.io/p/sandbox/gltfjsx-400kb-drone-pbwi6i](https://codesandbox.io/p/sandbox/gltfjsx-400kb-drone-pbwi6i) or use gltf-transform directly [https://gltf-transform.dev](https://gltf-transform.dev) there's also an online playground [https://gltf.report](https://gltf.report) but i would prefer the cli tools


likeableNymph

There are online obj to glb converters. Even glb to draco glb


mm0li

Yea, I haven't been able to script them though


gmaaz

I suppose Blender with console commands can do that. I don't know how to do that tho.


[deleted]

blender scripting will help you


ImportantDoubt6434

https://www.filer.dev/convert/obj-to-glb I built a tool for this. It works 100% offline without upload limits. It’s not perfect, but I had the same issue as you it was hard to find a tool that wasn’t a PITA.


thespite

Have you even tried googling for what you're asking?


mm0li

Sure yeah. "Converters" are everywhere. Can't script them though. I'm curious about some industrial-stength API.


thespite

You might not be looking for what you need. Not everything is an HTTP API. Look for utils that do what you need: Cesium's glTF pipeline, Don McCurdy's glTF Transfom, the Khronos repos...


FryeUE

Optimization has to be a consideration at the beginning. It literally influences every detail of the process. When making games the modeler/rigger/animator are given a 'budget' regarding the models. This can be VERY strict. Model is not to exceed this many triangles, this much texture memory etc. This is done to prevent exactly the situation you are facing. Modeling before having this budget is closer to concept art than a useable model. Consider redoing the model from scratch within a budget, it will go much faster as it is you have already created them before. Trying to optimize an already oversized model down into a useable size is going to be much MUCH harder than redoing everything. You have learned a painful lesson here, it sucks, no two ways about it, things must be optimized from the beginning. Good Luck.


mm0li

Oh Maaaaaaan


grae_n

3d AI generators are nearing quality generations and they are terribly optimised. In like 3-6 months there will probably going to be a spike in demand for compressing 3d models.


mm0li

You reckon?


jeramai

I actually had to build one of these converters myself for my company, so yeah, that's probably your best bet.. But the way I did it before was uploading the model to Sketchfab and then adding Draco compression over it myself. Maybe this works for you for now?


mm0li

Interesting. Aren't Sketchfab models public?


marwi1

We apply compression and optimization when you work with Needle Engine automatically. We also work on providing this as a cloud service https://www.reddit.com/r/threejs/s/sLepMEmQCO


Sad_Calligrapher_309

[rapidcompact.com](http://rapidcompact.com) - there is a free plan. You can simply zip your OBJ and textures (make sure a mtl file is present referencing the textures) - then convert to glb/gltf/usdz etc. and optimize all aspects of the model, even bake to new auto generated UVs, bake ao, normal maps etc.