![]() ![]() Blender considerationsĪs Blender is a multi-purpose tool, there are certain pitfalls you can stumble into that will make your model ill suited for game development. This page provides practical tips on preparing and converting your Blender model for use in libGDX. If you are new to creating 3D models using Blender, you can checkout the blender tutorials. Note: while this page uses Blender for practical examples, most of it applies to other modeling applications as well.īlender is an open-source modeling application you can use to create 3D models, scenes and animations. Alternatively, you can use glTF format via third party library gdx-gltf which also provides advanced features like PBR rendering. OBJ format is partially supported and not recommended for production. If you want more flexability, you'll probably wind-up doing your own asset manager as I did in method two, above, or at least a customized wrapper around libGDX's built-in asset manager.LibGDX provides its own 3D format out of the box called G3D (g3dj and g3db files), this article describes steps from Blender to your game using this format. If you've just got a set of fixed assets, like the set you purchased, you may want to just go through the unpack/rename/re-pack process I mention in my first method above. Then I refer to the assets by tile coordinates, rather than pixel offsets and sizes.Įven though libGDX provides these helpful tools (packed spritesheets / texture atlases / etc.), in my limited experience, I've found I like my way better. This method works particularly well in my current project, which is a 32x32 tileset game, where I just keep my art assets in grids in. As long as my artist doesn't move things around, they are free to make tweaks, without having to modify the XML asset file for the level. Then I have another XML node-type for animations, which allows me to specify individual frames from one or more spritesheets. This sounds tedious, but once you standardize your artwork, it's very painless. I implemented a custom asset manager class that takes XML files wherein I provide the spritesheets, referenced by a name, then provide named textures or sprites which take the spritesheet name, then an offset and size into that spritesheet to get the individual sprites. The second method, and the one I'm using on my current work, is to manage my assets myself for each level, via an XML file that I load at level-load-time. I can't find the one I used initially, but here's another one that's actually a bit more flexible: Alferd Spritesheet Unpacker The unpacker then extracts the individual files into a directory, which you can then re-pack using libGDX-aware utility, to take the directory of individual files (which you should rename before this, so the atlas you get back will have useful aliases) and re-build them into a single spritesheet with accompanying atlas (pack file). The first was to use a spritesheet unpacker, which basically allows you to provide parameters for padding round the margins, the size of the tiles/sprites, then the horizontal and vertical padding between the sprites. I have solved this problem two different ways. ![]() ![]() I had the same issue, trying to use resources from. I'm sure most users of libGDX will encounter this as soon as they try to use spritesheets from other sources (not made in-house, with libGDX in mind). ![]() I would also be interested in hearing how other people manage their artwork in libGDX. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |