glTF icon indicating copy to clipboard operation
glTF copied to clipboard

Minify glTF JSON

Open pjcozzi opened this issue 13 years ago • 8 comments

There should be a converter option (off by default) to minify the JSON created to reduce its size.

There are several JavaScript minifiers available, but given that we can't change the names of any of the JSON properties, we probably just need to remove whitespace, which we won't need a third-party minifier for.

pjcozzi avatar Mar 22 '13 11:03 pjcozzi

I would recommend the classic and venerable JSMin, which I think does exactly what you want.

http://www.crockford.com/javascript/jsmin.html

won3d avatar Apr 12 '13 15:04 won3d

Good idea.

tparisi avatar Apr 12 '13 15:04 tparisi

I think jsmin does not provide the full extend of optimizing for download and parsing speed. Google closure compiler is probably better ?

RemiArnaud avatar Apr 12 '13 16:04 RemiArnaud

We're talking about JSON here. Closure compiler works by doing stuff like type or alias analysis, variable renaming, etc. The JSON is going to be a tiny fraction of the binary assets, so it is questionable to spend time on anything more complicated than a basic thing.

won3d avatar Apr 12 '13 16:04 won3d

Yes of course. BTW-I am using other json 3D converters that by default produce optimized JSON and have an option to not optimize.

RemiArnaud avatar Apr 12 '13 16:04 RemiArnaud

@kainino0x did we add this to COLLADA2JSON or did we revert it?

pjcozzi avatar Aug 21 '15 14:08 pjcozzi

We reverted it because my fix didn't work correctly.

kainino0x avatar Aug 25 '15 06:08 kainino0x

Moving to gltf-pipeline so it is useful to all exporters/converters, see https://github.com/AnalyticalGraphicsInc/gltf-pipeline/issues/1.

pjcozzi avatar May 28 '16 12:05 pjcozzi