Skip to main content

Model Structure

Understanding the 3D model structure of FiveM vehicles.

Model File Types

YFT Files (Model Files)

  • Binary 3D model format
  • Contains mesh geometry
  • Includes bone/skeleton structure
  • Cannot be edited directly - requires special tools

YTD Files (Texture Files)

  • Contains all vehicle textures
  • Includes paint, interior, decals
  • Can be edited with texture editors
  • Often reused across variants

LOD Models

  • Level of Detail versions
  • LOD0 - High detail (close distance)
  • LOD1 - Medium detail (medium distance)
  • LOD2 - Low detail (far distance)
  • LOD3 - Very low detail (very far)

Model Hierarchy

A typical vehicle model structure:

Vehicle
├── Chassis (main body mesh)
├── Windows (glass meshes)
├── Doors
│ ├── Door_FL (Front Left)
│ ├── Door_FR (Front Right)
│ ├── Door_RL (Rear Left)
│ └── Door_RR (Rear Right)
├── Hood (Engine cover)
├── Trunk (Boot/rear cover)
├── Wheels
│ ├── Wheel_FL
│ ├── Wheel_FR
│ ├── Wheel_RL
│ └── Wheel_RR
├── Interior
│ ├── Seats
│ ├── Steering wheel
│ └── Dashboard
└── Extras
├── Bumpers
├── Spoilers
├── Wheels variations
└── Lights

Creating Custom Models

3D Modeling Software

  • Blender (Free, recommended)
  • 3DS Max (Commercial)
  • Maya (Commercial)

Model Requirements

  1. Polygon Count

    • LOD0: 20,000-50,000 polygons
    • LOD1: 10,000-20,000 polygons
    • LOD2: 5,000-10,000 polygons
    • LOD3: 1,000-3,000 polygons
  2. Materials & Textures

    • Standard vehicle materials
    • Paint shader
    • Glass shader for windows
    • Interior materials
    • Decal support
  3. Bone Structure

    • Must match vehiclelayouts.xml
    • Proper bone rigging
    • Weight painting for deformation

Texture Mapping

UV Mapping

  • Each mesh face mapped to texture coordinates
  • Essential for proper paint application
  • Custom decal placement on UV coordinates

Texture Channels

Standard vehicle textures include:

ChannelPurpose
DiffuseBase color/albedo
NormalSurface detail normal map
SpecularShine/reflection map
EmissiveSelf-illumination
DecalPaint job/livery layer

Model Optimization

Mesh Optimization

Original Model: 45,000 polygons
├── High LOD (LOD0): 45,000 polygons
├── Medium LOD (LOD1): 15,000 polygons
├── Low LOD (LOD2): 5,000 polygons
└── Distant LOD (LOD3): 2,000 polygons

Texture Optimization

  • Use Power-of-2 texture sizes (512, 1024, 2048, 4096)
  • Compress textures appropriately
  • Combine multiple small textures when possible
  • Use mipmaps for better scaling

Model Export Workflow

  1. Model in Blender

    • Import base vehicle or create new
    • Add custom geometry
    • Apply materials and textures
    • Create LOD versions
  2. Prepare Bones

    • Rig model with proper skeleton
    • Weight paint for deformation
    • Test bone rotation/movement
  3. Optimize Geometry

    • Reduce polygon count for LODs
    • Ensure proper normals
    • Check for overlapping geometry
  4. Export Settings

    • Use FiveM-compatible exporter
    • Include all LOD levels
    • Embed textures or link externally
  5. Convert to YFT

    • Use CodeWalker or similar tool
    • Verify bone structure
    • Test in FiveM

Common Model Issues

Rendering Issues

  • Black textures - Missing texture references
  • Floating geometry - Model not properly attached to bones
  • Flickering - Normal map problems
  • Invisible parts - Faces reversed (wrong winding order)

Deformation Issues

  • Doors don't deform - Improper bone weighting
  • Distorted mesh - Weight painting errors
  • Stuck geometry - Bone limits exceeded

Performance Issues

  • Frame rate drops - Too many polygons
  • Texture flickering - Mipmaps not generated
  • Memory overflow - Texture resolution too high

Material Setup

Paint Material

Shader: Vehicle Paint
- Diffuse: Paint color
- Normal: Surface detail
- Specular: Shine amount
- Metallic: Metal vs matte

Glass Material

Shader: Vehicle Glass
- Transparency: 0.7-0.9
- Refraction: enabled
- Reflection: enabled
- Tint: slightly tinted

Interior Material

Shader: Vehicle Interior
- Diffuse: Interior color
- Specular: Low shine
- Normal: Fabric detail

Asset Integration

After creating your model:

  1. Reference in vehicles.meta - Link model name
  2. Create YTD textures - Package all textures
  3. Define in carvariations.xml - For customization
  4. Test thoroughly - In various LODs
  5. Optimize for distribution - Compress appropriately

Best Practices

  1. Use existing vehicle models as reference
  2. Maintain consistent polygon density
  3. Test all LOD transitions
  4. Keep texture sizes consistent
  5. Document bone structure clearly
  6. Version your models
  7. Backup original models
  8. Test performance on various systems