< Project setup | UserGuide | Model Resources >


ResourceManagement

A project consist typically of different kind of resources: Textures, models, sounds and so on. Per default, the project is configured that way, to look into different pathes, depending on the resourcetype:

  • /textures: The textures directory contains all textures used for the models / particles etc. (.tga, .png, .jpg)
  • /sounds: contains .wav files (.wav)
  • /particles: Particlescripts (.prt)
  • /shaders: Shader scripts for sophisticated effects (.shd)
  • /materials: Material scripts associated textures and shaders (.mat)
  • /models: The model path contains for displaying. (.f3d .mm)
  • /animations: Contains animation files that can be used for models (.ma)

You don't need to create these pathes, as long as you don't have any resources to put into.

When a resource is loaded, Luxinia will try to find the specified file in different locations:

  1. exact filestring passed
  2. file in same path as "parent resource" (e.g model loading texture)
  3. default search directory of project
  4. default search directory in "/base"

Some more infos:
  • loaded once into reschunk: Resources are loaded once and the needed memory is taken from the active reschunk. You cannot remove a single resource from memory again, but only destroy the used reschunk completely. By default luxinia uses one reschunk for everything at startup, as this is sufficient for general useage.
  • no gc:Garbage collection is not active for resources, once loaded they will remain in memory.
  • .load / .create: .load operations typically mean data that is stored in files, whilst .create is used to generate a new resource completely from Lua, with all its internal specifics from ground up. Once created, the .load mechanism often can be used as well for such user-create textures, they just use a specific name tag (e.g. ("USER_TEX(mytexname)").