All posts by rickomax

TriLib – Known Issues/Limitations

  • All platforms:
    • Exporting will be enabled on a future release (.dae, .obj. stl, .ply formats).
    • Cameras and lights will be enabled on a future release.
    • We highly recommend you to download our test application to test your models before adquiring the package.
    • Old FBX-DOM formats are not supported.
    • Vertex animation is not supported .
    • Blend shapes are not supported at the moment.
    • DevIL Image Library is supported only on Windows at the moment.
  • Android:
    • IFC importer is inactive at the moment.
    • Android device with API 9 is required.

Note: TriLib is based on Assimp (, an open-source project. We are always updating TriLib with the latest Assimp branch, to guarantee the most recent bug-fixes. We cannot guarantee your model to partially or fully load with TriLib.  (*) not supported on Android platform at the moment.

TriLib – Post Processor Options

Description of the Asset Loader post processor options:

  • Nothing: No post-processor steps will be applied, we don´t recommend enabling this item as it can decrease performance and leave model issues unfixed.
  • Everything: All post-processor steps will be applied, we don´t recommend enabling this item as it´s almost always unecessary to enable all post processor steps.
  • Calc Tangent Space: Calculates the tangents and bitangents for the imported meshes.
  • Join Identical Vertices: Identifies and joins identical vertex data sets within all imported meshes.
  • Make Left Handed: Converts all the imported data to a left-handed coordinate space.
  • Remove Component: Not implemented on this version.
  • Gen Normals: Generates normals for all faces of all meshes.
  • Gen Smooth Normals: Generates smooth normals for all vertices in the mesh.
  • Split Large Meshes: Splits large meshes into smaller sub-meshes.
  • Pre Transform Vertices: Removes the node graph and pre-transforms all vertices with the local transformation matrices of their node.
  • Limit Bone Weights: Limits the number of bones simultaneously affecting a single vertex to a maximum value.
  • Validate Data Structure: Validates the imported scene data structure. This makes sure that all indices are valid, all animations and bones are linked correctly, all material references are correct…etc.
  • Improve Cache Locability: Reorders triangles for better vertex cache locality.
  • Remove Redundant Materials: Searches for redundant/unreferenced materials and removes them
  • Fix Infancing Normals: This step tries to determine which meshes have normal vectors that are facing inwards and inverts them.
  • Sort By P Type: This step splits meshes with more than one primitive type in homogeneous sub-meshes.
  • Find Degenerates: This step searches all meshes for degenerate primitives and converts them to proper lines or points.
  • Find Invalid Data: This step searches all meshes for invalid data, such as zeroed normal vectors or invalid UV coords and removes/fixes them. This is intended to get rid of some common exporter errors.
  • Gen Uv Coords: This step converts non-UV mappings (such as spherical or cylindrical mapping) to proper texture coordinate channels.
  • Transform Uv Coords: This step applies per-texture UV transformations and bakes them into stand-alone vtexture coordinate channels.
  • Find Instances: This step searches for duplicate meshes and replaces them with references to the first mesh.
  • Optmize Mesh: A postprocessing step to reduce the number of meshes.
  • Optimize Graph: A postprocessing step to optimize the scene hierarchy.
  • Flip UVs: This step flips all UV coordinates along the y-axis and adjusts material settings and bitangents accordingly.
  • Flip Winding Order: This step adjusts the output face winding order to be CW.
  • Split By Bone Count: This step splits meshes with many bones into sub-meshes so that each sub-mesh has fewer or as many bones as a given limit.
  • Debone: This step removes bones losslessly or according to some threshold.

TriLib – Tutorial : Enabling DevIL image library

Newest TriLib version includes DevIL image library (only for Windows, at the moment).

What is DevIL image library?

Developer’s Image Library (DevIL) is a programmer’s library to develop applications with very powerful image loading capabilities, yet is easy for a developer to learn and use. Ultimate control of images is left to the developer, so unnecessary conversions, etc. are not performed. DevIL utilizes a simple, yet powerful, syntax. DevIL can load, save, convert, manipulate, filter and display a wide variety of image formats.

Currently, DevIL can load .bmp, .cut, .dds, .doom, .exr, .hdr, .gif, .ico, .jp2, .jpg,.lbm, .mdl, .mng, .pal, .pbm, .pcd, .pcx, .pgm, .pic, .png, .ppm, .psd, .psp, .raw, .sgi, .tga and .tif files.
Formats supported for saving include .bmp, .dds, .h, .jpg, .pal, .pbm, .pcx, .pgm, .png, .ppm, .raw, .sgi, .tga and .tif.

To enable DevIL on your project, first, ensure you have checked these files when importing your TriLib package:

A menu item called “TriLib” will appear on your Unity menu bar.

To enable DevIL, check the “Devil Enabled  (Experimental – Windows Only”)

That´s it.
Now your TriLib models textures will be loaded using DevIL image library instead Unity internal image loader.

TriLib – Tutorial : Importing a model from within your game runtime

Let´s learn how to import an external model from our game code:

First, import TriLib package from the Asset Store.

For this simple model loading purpose, you can check only the “TriLib/TriLib” folder in the import dialog.

The first time you import TriLib to your project, Unity will ask you to restart the editor. If you choose “Ask to save changes and restart”, you will be prompted to save your changes before the editor restarts.

When Unity restart:

Create a new GameObject and add a new CSharp script to it.
We can name it “MyLoader” for the demonstration.

Add the following code to the script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TriLib;
using System.IO;

public class MyLoader : MonoBehaviour {
    protected void Start() {
        using (var assetLoader = new AssetLoader()) { //Initializes our Asset Loader.
            var assetLoaderOptions = ScriptableObject.CreateInstance<AssetLoaderOptions>(); //Creates an Asset Loader Options object.
            assetLoaderOptions.AutoPlayAnimations = true; //Indicates that our model will automatically play its first animation, if any.
            var filename = Path.Combine(Path.GetFullPath("."), "turtle1.b3d"); //Combines our current directory with our model filename "turtle1.b3d" and generates the full model path.
            assetLoader.LoadFromFile(filename, assetLoaderOptions); //Loads our model.

You have to replace the “turtle1.b3d” string with your model filename. The model will be loaded from within your application folder , so, remember to copy it to your final executable’s path when building it.

Your model is already being loaded from an external source.

TriLib – Tutorial: Importing a model from within Unity editor

In this tutorial, we will cover the steps to load your model using TriLib within Unity Editor.

First, import TriLib package to your project,  you can check only the “TriLib” folder for this tutorial, as shown in the following image:

Important: After that, you have to save your changes and restart Unity editor before proceeding with the tutorial, as TriLib native plugins needs to be loaded.

To do so, click on “Ask to save changes and restart”. Otherwise, you will have to restart Unity editor manually.

After the restart, TriLib will scan your “Assets” folder looking for files it can import, everytime a file is found, a prefab with the same name is created.

Note: For files that both Unity editor and TriLib can load (FBX files, for example), Unity native importer will be used.

To configure importing options, click on the original file under the Assets explorer.

Your asset inspector will look like this:

Here you can setup your model with various options, we will cover them here:

  • General Tab
    • Post Processor Options: Please refer to this link.
  • Meshes Tab
    • Scale: Use this field to override object scale.
    • Rotation Angles: Use this field to override object rotation angles.
    • Generate Mesh Colliders: Turn on this field to enable mesh collider generation (only valid for skinned meshes).
    • Convex Mesh Colliders: Turn on this field to indicate that generated mesh colliders will be convex.
  • Materials Tab
    • Dont Load Materials: Turn on this field to disable animations loading.
    • Textures Path Override: Use this field to override the object textures searching path.
    • Materials Override: Use this field to override materials with your own. If this array is not empty, each mesh material will be replaced by the material with the same index from this array.
  • Animations Tab
    • Dont Load Animations: Turn on this field to disable animations loading.
    • Auto Play Animations: Turn on this field to automatically play the first loaded animation (only for legacy animations).
    • Animation Wrap Mode: Use this field to change default animations wrap mode.
    • Use Legacy Animations: Turn on this field to use legacy Unity Animation component.
    • Animator Controller: If you don´t wish to use legacy animations, use this field to specify a Unity Animation Controller.

If your options are okay, you can simply drag your created prefab to the scene, or instantiate it via code later.

TriLib – Accepted File Formats

Here are the formats TriLib currently accepts:

Format Support ParTial Support
IFC (*)

Note: TriLib is based on Assimp (, an open-source project. We are always updating TriLib with the latest Assimp branch, to guarantee the most recent bug-fixes. We cannot guarantee your model to partially or fully load with TriLib.  (*) not supported on Android platform at the moment.

PsxPrev – TMD/PMD/TIM PlayStation file scanner

PsxPrev, a TMD/PMD/TIM PlayStation file scanner.

This tool uses:

You’ll need to run it:

  • An OpenGL 2.0 compatible video card
  • .NET Framework 4.5

Treat it as an experimental release and use this tool as your own risk!

The tool can use a big ammount of memory to scan the files, so,
I recommend you close all your work before starting the tool.

To launch the application, run “PsxPrevLauncher.exe”

First of all, select the Folder where are the files you want to scan.

You can specify a filter, to scan individual file/files.

You have option boxes to:

  • Scan for TMD models
  • Scan for PMD models
  • Scan for TIM textures
  • Scan for Resident Evil TIM textures
  • Generate a log file at the application folder
  • Output scan messages to the console window
  • Debug the processed triangles

To start scanning, click at the “Scan” button.

A console window will appear, the application will scan each byte of the files inside the folder/filter you specified trying to find the files types you specified, so, it can take a bit of time for this process to end.

After the scan has been completed, a new window will open, with the tabs:

  • Models: This is where you see the models that has been found on the scan
  • Textures: This is where you see the textures that has been found on the scan
  • VRAM Preview: This is where you have a replica of PSX Video RAM, which consist of 32 256×256 textures. You can use these pages to compose the final textures applied to the models.

Usage tips:

  • To Apply a Texture to a Model, first you have to look at the VRAM Page property of the Model you want to apply the Texture.After that have to draw the textures (at the VRAM Tab, called Draw to VRAM) on the desired VRAM Page (which is pre-defined in the Texture Properties area). After that, if you come back to the Model Tab, you may see your Model textured, if it has Uvs property enabled (True).
  • To Export a Model or Multiple Models,  tick their checkboxes at the Model Tab, click at Export Selected button, select the desired Output Format and the Output Folder. (Textures and materials will be automatically exported)
  • To Export a Texture or Multiple Textures, select them at the Texture Tab, click at Export Selected button and select the desired Output Folder.

Known issues/limitations:

  • The two 3D exportable file formats has disadvantages, .OBJ files cannot have vertex color information, and .PLY files will group all the sub-models in one single model. I’m looking for a better format for the exporter. An experimental .OBJ exporter option with Vertex Color is available.
  • The tool will only find files that are explicitly conformant to
    the file formats it’s looking for. Any compressed file cannot be scanned.

Download link:
Source code:

TriLib – Unity 3D model loader package

TriLib is a Unity model loader package designed to allow the user to load various 3D model formats inside the Unity editor or during the game execution.

  • Imports over 50+ 3D file formats.
  • Supports external and embedded materials.
  • Supports skinned meshes and animations.
  • Mesh post-processing features.
  • Multi-platform: Windows, OSX and Android (more platforms coming soon).
  • Scene/mesh exporting coming soon.

Important: TriLib is passing by a major update.
Please subscribe to our newsletter to stay in touch: 
TriLib – Newsletter

API reference
Known issues/limitations
Accepted file formats
Post processor options
Tutorial: Importing a model from within your game runtime
Tutorial: Importing a model from within Unity editor
Tutorial: Enabling DevIL image library