virtual-reality-in-flight-simulation
Creating Custom Scenery Objects for Prepar3d Using Blender and Gmax
Table of Contents
Introduction to Custom Scenery Creation for Prepar3D
Creating custom scenery objects for Prepar3D is one of the most rewarding ways to personalize your flight simulation environment. Whether you are building a detailed airport terminal, a unique landmark, or a series of generic buildings for a photorealistic cityscape, modeling your own objects gives you complete control over the visual fidelity and performance of your add-on. This guide walks through the complete workflow using two powerful but distinct tools: Blender (a free, open-source 3D modeling suite) and Gmax (the legacy game content creation tool that integrates tightly with the Prepar3D SDK). We will cover every stage from initial modeling to final placement in your sim, including essential export settings, texture optimization, and common pitfalls to avoid.
Why Use Both Blender and Gmax?
Many new creators ask why two applications are necessary. The reason is historical and technical. Prepar3D and its ancestor Microsoft Flight Simulator X (FSX) were built around the proprietary .mdl format compiled using tools in the legacy Gmax game pack. While modern third-party tools like ModelConverterX can convert newer formats, the most reliable and fully featured path remains compiling through Gmax. Blender, on the other hand, provides a modern, flexible, and free modeling environment with powerful sculpting, UV mapping, and animation tools. By exporting from Blender and then importing into Gmax for the final SDK compilation, you combine the best of both worlds: Blender's ease of creation and Gmax's native compatibility with the Prepar3D engine.
Tools You Will Need
- Blender (latest stable version – 2.8+ or newer) – download from blender.org.
- Gmax (free but requires registration) – available via Turbosquid's archive or other legacy software repositories. Note: Gmax is no longer officially supported but is widely used in the flight sim community.
- Prepar3D SDK – included with your Prepar3D installation or downloadable from Lockheed Martin's site. You will need the SDK tools (including the Game Pack for Gmax) to compile .mdl files.
- Texture images – preferably in DDS (DirectDraw Surface) format with appropriate mipmaps. You can use DXTBmp or NVIDIA Texture Tools to create DDS files from PNG or JPG sources.
- Optional: ModelConverterX (MCX) for previewing, optimizing, and converting models if needed, though for native P3D compatibility Gmax is still recommended for final compilation.
Phase 1: Modeling Your Object in Blender
Setting Up the Blender Scene for Flight Sim Export
Before you start adding geometry, configure your Blender scene for compatibility with Prepar3D's coordinate system. P3D uses a Z-up orientation. In Blender, set the scene's up axis to Z (usually the default) and ensure that the scale is set to Metric 1.0 = 1 meter. This will save you headaches when you import into Gmax later. Use the Properties panel > Scene > Units to set Unit Scale to 1.0 and Length to Meters.
Blocking Out the Object
Start with primitive shapes (cubes, cylinders, planes) to establish the overall silhouette. For an airport hangar, for example, use a large box for the main body, smaller boxes for side doors, and a plane for the roof. Keep the polygon count low in the blocking stage; you can refine later. Scale everything so that a 1 meter cube in Blender translates to a 1 meter object in the sim. You can use the MeasureIt add-on or simply compare against a reference such as a default runway width (60 feet = roughly 18.3 meters).
Modeling with Performance in Mind
Flight simulators must maintain smooth frame rates over vast areas. Avoid overly dense meshes. Use the following guidelines:
- Keep triangle counts reasonable: a single building might be 500–5000 triangles depending on complexity. Large airport terminals can go higher but always test.
- Use LODs (Level of Detail): Create multiple versions of your object with decreasing polygon counts. Gmax can handle up to four LODs. The SDK will automatically swap them based on distance.
- Apply mirror modifiers: For symmetric objects (like a hangar with a central door), use the mirror modifier to model only half, then apply it before export.
- Avoid N-gons: Triangulate or use quads. The SDK expects triangles; Blender can do this automatically on export.
UV Mapping and Texturing in Blender
Proper UV mapping is critical for good-looking scenery. Unwrap your model using seams and the Smart UV Project tool for a quick result. Aim for a single texture sheet per model to minimize draw calls, although you can use multiple materials if needed. Prepare your textures as separate image files (PNG or TGA initially) and then convert to DDS later. In Blender, set up materials using the Principled BSDF shader. For Prepar3D, only the Base Color (Diffuse) and Alpha channels are used – no roughness or metallic maps are supported in the legacy .mdl format directly. However, you can simulate specular effects by baking lighting into the diffuse texture. Export your texture at dimensions that are powers of two: 512×512, 1024×1024, or 2048×2048.
Exporting from Blender to Gmax
Blender can export to .fbx or .obj – both are readable by Gmax. For best results:
- In Blender, select your object(s) and go to File > Export > FBX (or OBJ).
- In the export settings, set Scale to 1.0 (or 100 if your units are meters; test and adjust).
- Enable Apply Scaling and Triangulate Faces.
- Set Path Mode to Copy and embed textures if possible, or note the image paths manually.
- Export with Z-up axis orientation (FBX default is Y-up – change to Z-up manually in the export dialog under Forward/Up).
Phase 2: Importing and Preparing in Gmax
Setting Up Gmax for Prepar3D
Gmax must be configured with the Prepar3D Game Pack. After installing the SDK, run the Game Pack installer (on newer P3D SDKs the Game Pack might be a separate download). Launch Gmax and select Maxscript > Run Script, then navigate to the SDK's Game Pack folder and run the appropriate startup script (e.g., P3D_tools.ms) to load the Prepar3D toolbar. You should see a P3D menu with options to assign LODs, collision, and other properties.
Importing the Blender Model
In Gmax, go to File > Import > Import FBX (or OBJ). If using FBX, you may need to install a free FBX importer plugin; OBJ is more universally supported. After import, check the scale. The model's size should appear roughly the same as in Blender. If it is huge or tiny, adjust the import scale factor (for OBJ you can set it in the import dialog – try 1.0 or 0.01).
Assigning LODs, Materials, and Collision
LOD Setup
Select your object and click the Create LOD button from the P3D toolbar. You will be prompted to add LOD levels. Typically you create three or four: LOD 0 (highest detail), LOD 1, LOD 2, and possibly a rough LOD 3. For each LOD, you must provide a separate geometry set. This means you need to have created simplified versions of your model. The easiest way is to duplicate the object in Gmax, reduce polygon count (using the Optimize modifier or manually deleting edges), and then assign that copy to the next LOD level. The SDK automatically uses the appropriate LOD based on distance from the camera.
Collision Model
Prepar3D objects can have a collision shell that interacts with aircraft and vehicles. This is a simplified mesh (often a simple box or convex hull) assigned via the Collision property in the P3D toolbar. The collision mesh must be a separate object named Collision or tagged appropriately. It will not be rendered but will provide realistic collision feedback.
Material Properties
In Gmax, each material slot must reference a DDS texture file. Use the Material Editor (hotkey M) and choose a Standard material. Assign your DDS texture to the Diffuse slot. For translucent surfaces (glass, fences), set the Opacity channel to use an alpha version of your DDS (or a separate alpha texture). The SDK recognizes the alpha for transparency. Ensure the texture is located in the project folder and referenced by a relative path.
Exporting the .mdl File
With all LODs, materials, and collision assigned, go to the P3D Game Pack menu > Export > Export X-file (this generates an intermediate .x file). Then use the SDK's XToMDL tool (command-line) to compile the .x into a final .mdl. Alternatively, some newer versions of the P3D SDK allow direct export of .mdl from Gmax. Follow the SDK documentation for your specific version. The resulting .mdl file should be placed in your scenery project's scenery folder.
Phase 3: Integration into Prepar3D
Folder Structure and Configuration
Create a dedicated scenery folder for your custom objects. The standard layout is:
- SceneryName\scenery\ – place your .mdl, .bgl (if using), and any placement files.
- SceneryName\texture\ – place all DDS texture files.
Add the scenery to Prepar3D via the Scenery Library (Options > Add-ons > Scenery Library > Add Area…). Browse to the parent folder and confirm. Restart Prepar3D or press Scenery Library > OK to reload.
Placing the Object Using Instant Scenery or ADE
To position your object in the world, you have a few options:
- Instant Scenery 3 (payware): A user-friendly tool to place individual objects with a mouse click.
- Airport Design Editor (ADE) (free): Primarily for airport layouts but can place library objects with precise coordinates.
- SBuild / XML placement: Manual XML files that reference the .mdl's GUID. This is more advanced but gives full control over rotation and altitude.
Whichever method you choose, ensure you have the object's GUID (generated during the SDK compilation). You can find it in the .mdl header or using tools like ModelConverterX. Test the placement in the simulator and adjust position as needed.
Texture Optimization and Common Pitfalls
DDS Compression Settings
Prepar3D performs best with DDS textures using DXT1 (no alpha) or DXT5 (with alpha). Use mipmaps generated by NVIDIA Texture Tools or DXTBmp. Avoid using 24-bit uncompressed textures for scenery; they will consume VRAM and cause stutter. Always preview your object in the sim to check for texture alignment or alpha transparency issues.
Common Mistakes
- Forgetting to apply scale: If your object appears tiny or huge, revisit the scale settings in both Blender and Gmax. P3D expects metric coordinates.
- Missing textures: The sim may show a white or purple model if the DDS file is not in the correct texture folder or has an incompatible format.
- Incorrect LOD assignments: If only one LOD is present, the object might pop in and out. Ensure at least two LODs for medium-sized scenery.
- Using unsupported features: Normal maps, specular maps, or PBR materials are not supported in the legacy .mdl format. Stick to diffuse+alpha.
Advanced Techniques: Animations and Night Lighting
Animations (Rotorblade, Hangar Doors)
Gmax supports basic animations for .mdl objects, such as rotating radar dishes or opening hangar doors. The process involves keyframing the object's transform within Gmax and marking the animation as a named part. The SDK documentation details Attached Tool and PartName attributes. This is an advanced topic but opens up dynamic scenery.
Night Lighting and Emissive Textures
To simulate lit windows or runway edge lights, you can assign a second material with a self-illuminated diffuse texture (typically a nighttime version) and tag it with luminous property via the Gmax toolbar. Alternatively, use the FX (effect) system in P3D for true dynamic lighting. For simple window glow, adding a bright yellow/white color in the texture and setting the material's self-illumination to 100% works.
Resources and Further Reading
- Official Prepar3D SDK Documentation – detailed exporting and configuration information.
- FSDeveloper Forum – community support, tutorials, and examples for flight sim modeling.
- SceneryDesign.org – a hub for tools, models, and guides including Gmax tips.
- Blender Manual – for advanced modeling, UV mapping, and export techniques.
Final Tips for Success
The learning curve for custom scenery creation is steep but surmountable. Work through a simple project first—such as a single hangar or a small shed—before tackling complex airport terminals. Test your model frequently in the simulator; it is much easier to catch scale or texture errors early than to debug a fully built scene. Use the ModelConverterX preview to validate your .mdl before placing it in P3D. With patience and practice, you will be able to populate your virtual world with unique, high-quality scenery that sets your flight simulation apart from the default environment.