qqdarren Posted June 4, 2015 Share Posted June 4, 2015 I experimented with a single 3D letter in Blender, then exported to the .babylon format. It was a 214KB file! I then removed the bevel, and that reduced it to 67KB. But the version with bevel is nicer. So, that got me wondering if the bevel is something I can add back in once the model has been loaded? Whether something text-specific, or a more generic algorithm that can smooth out the hard edges in a model? But I suppose what I really want is the Babylon version of the Three.js TextGeometry module: http://threejs.org/docs/#Reference/Extras.Geometries/TextGeometry Is there already something like this? (Actually TextGeometry is just a thin layer around ExtrudeGeometry ( http://threejs.org/docs/#Reference/Extras.Geometries/ExtrudeGeometry ), which would be even more useful, if I could, say, take a png file or the contents of a 2D canvas, and turn it into a 3D bevelled object.) Quote Link to comment Share on other sites More sharing options...
jerome Posted June 4, 2015 Share Posted June 4, 2015 No, this kind of 3D Text doesn't exist in BJS.But I think you could get it in this extension : https://github.com/BabylonJS/Extensions/tree/master/Dialog/fonts Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 4, 2015 Share Posted June 4, 2015 You can also think about using binary babylon file format to reduce the size drastically Quote Link to comment Share on other sites More sharing options...
qqdarren Posted June 4, 2015 Author Share Posted June 4, 2015 Thanks for the ideas. I don't see any mention of the binary format in the docs for the blender exporter ( http://doc.babylonjs.com/page.php?p=24821 ). There was mention in the release notes, but it goes to a dead link: http://www.babylonjs.com/binary The Dialog/fonts, is quite mysterious, with no Readme or documentation, nor even inline comments. But it doesn't look like an extruder, more like data-as-code for one hard-coded font, perhaps? I was thinking the CreateGroundFromHeightMap() is not so far from an extruder; can it be easily hacked into one? Quote Link to comment Share on other sites More sharing options...
gryff Posted June 4, 2015 Share Posted June 4, 2015 Hi qqdarren. You might want to take a look at this video by Jonathan Williamson, of cgcookie, about creating text in Blender: Creating 3D Typography The part that might interest you is at around 8-11.00 minutes in - his use of "limited dissolve" and "remove doubles". I used this methodology to create this: Babylon.js It contains 9 letter + a ".", the globe and of course the animation data - the total file size is 199kb. That is roughly 19kb per letter. Now, I have not tried it with a bevel applied to the text. cheers, gryff qqdarren 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 4, 2015 Share Posted June 4, 2015 Here is it:http://www.babylonjs.com/converterbinary.html qqdarren 1 Quote Link to comment Share on other sites More sharing options...
qqdarren Posted June 4, 2015 Author Share Posted June 4, 2015 David, thanks, I just gave it (the binary converter) a go. Interesting results: Plain text version: 214,356.binary version: 1786, plus 148,244 meshdata. But, a web server is likely to deliver the files gzipped: Plain text, gzipped: 53,887 bytesBinary, gzipped: 586 + 54,142 bytes (+ extra overhead of 2 requests) Not all bad, though, as I imagine the binary version is parsed more quickly once the browser receives it? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 5, 2015 Share Posted June 5, 2015 Yes as there is no parsing for binary data. they are directly copied as it to the GPU qqdarren 1 Quote Link to comment Share on other sites More sharing options...
qqdarren Posted June 9, 2015 Author Share Posted June 9, 2015 (Continuing from comment #4) I just found this topic, from February 2015: http://www.html5gamedevs.com/topic/12178-3d-text-generation/ Some mention of the Dialog extension, but still not quite enough to know how to use it, or what it is for. And some experiments using CreateGroundFromHeightMap (which are still a bit rough: the glyphs have no thickness, and then there is a plane getting left behind). Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 9, 2015 Share Posted June 9, 2015 JCPalmer is the father of Dialog extension Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted June 9, 2015 Share Posted June 9, 2015 Hey,Let's go back to the beginning. I was making Letter meshes into individual Javascript classes, so that they could be strung together to make labels. See fontgen.blend in extensions repository. I needed it as inline javascript, since it must load real fast to build strings on the fly. A .babylon needs to parse the whole file every import (There are 96 letters in either font2d.js or font3d.js), and a .babylon can only build originals, not clones if an original already exists. I use the Tower of Babel exporter to generate source code. The exported javascript files are very big, partly because TOB puts in a lot of spacing to make it human readable. Font3d.js uglifies down to 962.2kb (10 kb per letter). I just went into fontgen.blend and changed bevel depth to 0.01, and ran the built in script in the .blend to generate my meshes, then exported & uglified. File is now 2.1 mb ( 22 kb per letter). Before we go any farther, what was the letter you generating? Are you using the default font for Blender? Blender "Text" objects are not meshes, you need a process or script to convert one to a mesh. Is your process similar to fontgen.blend? A 64kb letter seems kind of big. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.