Jump to content

Compression of mesh files?


hermetic
 Share

Recommended Posts

Hi,

I'm new to babylon.js

while comparing/finding a good 3D .js framework, I compare babylon.js and three.js now.

Sadly it looks that three.js has more import-formats (even if not all are fully developed: VRML seems not to use textures?),

but a big prob on all .js mesh import is that compared with .obj and other binary formats are, that .js meshs are twice the size, because their overhead.

 

Which brings me to the question, if a compression (.gz, .zip?) is possible or built in, or if babylon mesh use such?

Or how would such be done?

 

Ah and

greetings to Griff... err Gryff

Seems it took a long time till 3D in a browser worked. :D

Link to comment
Share on other sites

Hi Hermetic,

 

BabylonJS documentation states that a binary format is planned (like ThreeJS has).

Apart from that, you can turn gzip compression on your hosting apache, to achieve pretty nice compression to the babylon files.

You do it by changing either the apache configuration file (if you have root access) or the .htaccess file (if allowed by the administrator).

 A smaple from .conf file:

AddType application/babylon .babylonAddOutputFilterByType DEFLATE application/babylon text/html text/plain text/xml text/css text/javascript application/javascript

I am first adding the mime type (you can add more of course), and then stating that these mime types should be compressed.

Of course, the gzip apache module should be enabled (mod_deflate).

You can read about it here:

http://httpd.apache.org/docs/2.2/mod/mod_deflate.html

 

in htaccess it would probably look like this:

<ifModule mod_deflate.c>  AddType application/babylon .babylon  AddOutputFilterByType DEFLATE application/babylon text/html text/plain text/xml text/css text/javascript application/javascript</ifModule>

Hope it helps :)

Link to comment
Share on other sites

Thank you very much!

Ah, the good old mime-type. So the browser decompress it itself, nice, I was confused, because the example-projects are often so big-MBs.

I will try it.

Thank you very much for answering my newbie-question. :)

 

Haha, und grüße aus/von Berlin!

Link to comment
Share on other sites

greetings to Griff... err Gryff

 

Hi Hermie!!!! Long time no chat. (Fondly remembers Hermie's Marching Band avatar)

 

You are right, file sizes are much larger - but then my internet speed is no longer decided by a 33kb modem, not to mention a 2GB video card compared to 4-8Mb

 

There are lots of good javascript coders here, and Deltakosh and his little team are pushing babylon.js pretty hard - adding features all the time.

 

As for converting VRML, I'm using Blender - you may remember part of this little scene(let the music finish or click on the guy) : Whitechapel, 10Bells

 

Needs updating as the lighting in babylon.js  is now much improved since I created it.  You can import VRML mesh geometry and textures into Blender, but no scripts or protos etc.

 

Hope you stay around Hermie. I sometimes feel lonely amongst all the javascript coders.

 

As for the name - easier to join forums with "gryff" than "griff"

 

Good to see you again.

 

cheers, gryff :)

 

 

 

 

 

 

 

Link to comment
Share on other sites

Also, the .babylon file that comes out of  the Tower of Babel exporter for Blender is 8-10 % smaller than the original exporter.  This would be cumulative to browser compressed transmission.  I am back in NY now, and starting to work again.  Just re-forked my Babylon project to fix my screw up.  Hoping to get version 1.0 on a pull request by the end of the week.

 

This is achieved by dynamically generating precision aware numbers, so instead of putting out '-0.0000', '0' will suffice.  Could be back implemented into original exporter, but I am not going to do it.  The only exporter I use is for Blender, but the 3DS Max, or whatever it is, could probably be made to do this as well, if already does not.

 

Jeff

Link to comment
Share on other sites

Ah, @JCPalmer, Blender is fine for me. :)

Will check that out and look where I can DL the blender exporter 'tower of babel' (sounds cool anyway)

 

Ah @gryff, nice to see your cool Whitechapel up again! Sad that the lighting is so dark and why not to bring your full Whitechapel-world on html5, only the pub-scene?

We should talk somehow, I need to know how you got the blaxxun-av exported and stuff.

 

Maybe I can bring some of my former (VRML-)worlds up again with this too?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...