Generating Icons Development Notes

GeneratedIconsAs some of you may have seen I have post an image on Twitter yesterday. With icons from our mod, all of those where done in 3 seconds, well that is if we don’t count the time spent developing and configuring the Icon Generator part of the IDE, which took about 3 hours as most of it was already done. Still making those icons would take about as much time as it took to make the software to generate those. It still isn’t perfect but for now it works fines and will definitely be useful now to see the object icon in game and later on to generate proper icons.

How does it work?

First thing that was needed to get those done was the Model Viewer, I have shown few version on Twitter of it over the past 2 months. The Model Viewer required shaders that will look similar to the TUG ones, loading OBJ files, loading TGA textures, calculating tangents(that was one of the most time consuming tasks in the IDE) and exporting the view to an image(this one was the most annoying, it isn’t as simple as it should be…).

Once I had the Model Viewer done, I had a way to render the OBJ files, but no way to load them from the TUG’s TXT files (aka TUGON), luckily I had a parser already so it was just a matter of getting it to find the nodes that where contained the needed info. At first it was just the first object, later on I added support for multiple objects from 1 files.

That was all good and working fine, but getting the model to be visible and centered is a whole different story, the temporary solution I came up with was to use Frustum (3D View Parameters, usually used for culling) and checking if the Bounding Box fits, if it doesn’t move away from the center by 0.1, not the best solution but it works.

Once I had all of those done it was just a matter of putting them together. That was the easiest part.

What now?

The the Icon Generator is nowhere near a release stage. The icons are not centered and it crashed randomly, not sure if it is the graphics driver or my PC or a problem in the code, updating the graphics driver sometimes fixes it.

The Icon Generator part still needs a lot of work, I need to find a better way to center the object, allow for different view angles and work on the lighting.

Please don’t ask me to release it now, it isn’t ready yet, if someone wants to have their icons generated let me know, it just a matter of adding the path and running it.

More?

Hmm… OK so I can get it to generate all icons from TUG, not just modded ones, and it works with all of the folder from mods.txt, in the proper order.

GeneratedIcons2

We (Me and Sigil) have more plans for the models and textures utilities, the icon generating is just a small one, but a useful one, we plan to automate things as much as possible, everything from fixing normals, fixing textures, optimizing textures to generating textures and models.

We have even more plans for the IDE, since it will be able to edit LUA and the TUGON (TUG’s TXT files) we want to get it to connect everything together in a way that allows for easy editing, renaming and auto-complete(or selecting files/object).

Leave a Reply

Your email address will not be published. Required fields are marked *