Skip to content

Textures ​

  • One square atlas per mesh group, on the active UV map:
    • textures/entity/vehicle/<name>.png: outside, front, wheel;
    • <name>_wheel.png (optional): the wheel's own atlas. The four wheels share one mesh, so an atlas of its own shows far more detail (tread, brake discs); used when the file is there, else the outside atlas;
    • <name>_cab.png: cab and seats;
    • <name>_under.png: engine bay and underside (if any).
  • Paint the paint areas light grey or white; the player picks the colour.
  • Shader-pack materials (optional, LabPBR): _n (normal; RG DirectX normal, B ambient occlusion) and _s (R smoothness, G reflectance, A emission) beside each atlas.
  • Paint the paint areas white (or a very light grey): the chosen colour multiplies them, so a darker base darkens every colour.
  • The baking script makes the paint parts' base white by itself.
  • Wear (optional): <name>_wear_1.png to _wear_10.png, laid out like the outside atlas, transparent, with rust and dirt. A vehicle without them is drawn without wear.
  • Under a shader pack all vehicle glass uses Vettura's own glass texture (the shader pack finds windows by it); you don't paint it.

A white box can use colour swatches: every face mapped into one small flat colour.

Baking an atlas from a model with many materials (a detailed finished model: hundreds of materials, tiled detail textures): tools/blender/bake_vehicle_atlas.py, run before exporting. Used like the export script, its values set at the top or passed on the command line:

bash
blender my_coupe.blend --background --python bake_vehicle_atlas.py -- D:/MyMod/src/main/resources/assets/mymod my_coupe 4096

It changes the .blend and saves it (vertices merged, a new UV map VETTURA made active): keep a copy of your model first. It:

  1. merges duplicate vertices (imported meshes often have every triangle's corners split, so every face would be its own UV island);
  2. makes a new UV map, VETTURA, unwrapped and packed per group (the wheel a group of its own, half the outside's size). Parts with hundreds of tiny islands (grilles, screws) get them laid over each other first (mostly one colour). Parts named *_decal (badges, labels, stitching) are never stacked and get twice the texels;
  3. bakes the colour and the alpha (decals and mesh grilles are cut out by it), the paint parts made white. 32 samples a pixel average tiled fine detail (perforated leather, drilled discs, tyre lettering, carbon weave) to its tone; with too few it comes out as grain;
  4. bakes roughness, metallic and the normal (16 samples a pixel) into LabPBR _s and _n (skip with --no-pbr).

Then export as usual and run python tools/vehicle_atlas_fixup.py <assets dir> <name>: by the part names, the glass is made see-through and the lamps filled with their lit colour (a lit lamp shows its texture at full brightness, and a baked lens is usually dark).

A detailed car at 4096 bakes for over an hour (every material is compiled again for each bake). Try the whole way at 1024 first, then bake at 4096.