Technology Article

L3DX Files

Introduces Luster's L3DX files: what they do, and how you can edit them.

Introduction

L3DX files will be present in every Luster project you create. When you create a new Luster project, an L3DX file is one of the files that is auto-generated. This file tracks all your resources for your project. When the Luster runtime executes your project, it is the L3DX which controls what resources are loaded and what global properties your project runs with.

If you double-click the L3DX file in your project explorer this is the window that opens up. It is the first section of the L3DX editor which lets you edit all the details of your project file. The first to notice is that this editor is tabbed. Along the bottom you can see three sections: Attributes, Resources, and the file name itself. We'll start by talking about this first section.

Attributes

The attribute editor lets you control the basic global properties of your application. Most of the attributes in the first section of the l3dx file are self-explanatory.

  • Frame Title: This is the text which appears on the application's window.
  • Frame Width: This is the starting width of the window.
  • Frame Height: This is the starting height of the window.
  • Frame Rate: This will lock the application to a specific frame rate. The application will not update faster than this given frame rate. If this is set to 0 it will "unlock" the update rate and application will update as quickly as it can.
  • Anti-aliasing: This controls the level of anti-aliasing used. This will depend on the capabilities of the machine the application runs on. If the AA level is not supported this option will be ignored.
  • Enable VSync: VSync will lock the applications update rate to the monitor's refresh rate. This can have the effect of smoothing motion.
  • Open in Fullscreen: With this set, the application will start in fullscreen mode which covers the entire screen area at the given resolution.
  • Allow Frame Resizing: With this option set, in non-fullscreen mode, the user can change the size of the window dynamically.
  • Use DirectX: By default Luster will prefer to use OpenGL. With this option set the runtime will run this app using the DirectX rendering system.

The next option that can be controlled from this page is the Root class. By default, the editor creates a class called Root in a file called Root.lua. The Root class wil be automatically set here. You can, however, easily change it by changing the class name in the text box. Remember, this is the class name of the root object, not the file that contains it.

Lastly, this page lets you control what plugins are loaded with this application. The Luster runtime starts up with a basic set of functionality. There can be more functionality available at runtime by requesting that plugins be loaded. Developers can even write their own custom plugins which extend the capabilities of the runtime. The only thing to keep in mind is that unknown plugins and plugins known to be dangerous (like the file system plugin) will request the user's permission to load.

Resources

The next page lets you manage the resources which are part of your project. You can add and delete resources from your project in the project explorer, but this editor allows you finer control over how the runtime manages and loads those resources.

The L3DX file will be aware of all resources which are part of your project. However, it will usually be beneficial to have some resources be ignored by the runtime during loading. An example of this is PSD files (from photoshop). If you are editing a texture in photoshop you might end up with a PSD file and a JPG file. The JPG file is what you want to use for texturing in your application. By unchecking the PSD file in the resources editor the Luster runtime will ignore that file during loading. Also, when exporting your project to a final L3D package, unchecked resources will not be packaged which will decrease the size of your application.

If you select one of the files in the editor, it will open a special editor to the side of the resources explorer. Depending on the type of file different options will be available. For instance, if a texture is selected the editor will show the options below.

You can control the various options for the texture and what behavior occurs when the system loads it. You can tell the system to create different amounts of mipmaps, or change the texture type from the default 2D to 1D, 3D, or Cube. All resources have the auto-load and compress settings. Most resources will be set to compress by default. This means that when the project is exported to L3D it will be compressed. Since most textures are already compressed their compression setting is set to false by default.

XML

L3DX files are just XML files. All of the options and resource settings are encoded in plain text in the file. This means that if you want to you can just open the XML of your L3DX file and edit it manually. You should be warned that the projects depend on well-formed L3DX files, so if you make a mistake during editing you can make your project so that it won't run properly.