Mods and the Beam.NG Exporter: Difference between revisions

From Automation Game Wiki
m (Added some images to clarify following instructions)
 
Line 1: Line 1:
Car body and fixture mods should in theory export to Beam.NG just like the built in bodies and fixtures. If it works in Automation, then the exporter should be able to deal with it. One exception to this is custom materials.
Car body and fixture mods should in theory export to Beam.NG just like the built in bodies and fixtures. If it works in Automation, then the exporter should be able to deal with it. One exception to this is custom materials.
=Custom Materials=
=Custom Materials=
''See [[Export Material User Data]] main page''
When the exporter exports a material, it checks which base material is being used and chooses from a series of built-in handlers based on that. Custom materials that are material instances of existing car/fixture materials should already export properly. Where possible, it’s best to use instances of existing materials rather than create new ones.
When the exporter exports a material, it checks which base material is being used and chooses from a series of built-in handlers based on that. Custom materials that are material instances of existing car/fixture materials should already export properly. Where possible, it’s best to use instances of existing materials rather than create new ones.
==Textures==
==Textures==
Line 14: Line 16:


For best results on export, make sure the “Global Force Resident Mip Levels” option is ticked on, otherwise the texture may export down-resed, depending on whether or not Unreal feels like loading the full resolution texture at that time.
For best results on export, make sure the “Global Force Resident Mip Levels” option is ticked on, otherwise the texture may export down-resed, depending on whether or not Unreal feels like loading the full resolution texture at that time.
= Material Export Parameters =
This is the data attached to Automation materials to help the BeamNG exporter know how to interpret these materials in order to build one that works in BeamNG. Developed after all attempts at naming conventions failed, it lists material parameter names according to the function those parameters perform, as well as a few other bits of information that the exporter needs to know about.
Many of the parameters use the '''Combined Parameter Data''' type, which allows a group of parameters to be combined into one for export.
* An exported material defaults to a colour and opacity of #FFFFFFFF. This is a hexadecimal colour of "White, and completely opaque."
* If a vector or texture parameter is specified in the Colour Param or Diffuse Tex variables within the Export Material User Data, those variables will be used for the colour of the exported material.
* If both are specified, they will be multiplied together.
* The exported opacity is assumed to be 1 (completely opaque) if no Alpha Param is specified. if a Diffuse Tex variable is specified, then the opacity is defined by the alpha channel of the texture. If the texture is single-channel, it is assumed to be an alpha texture as well as a diffuse texture. If a texture is RGB without an alpha, the alpha is unaffected by the diffuse tex.
== To Add ==
[[File:Asset User Data.png|thumb|604x604px]]
To add export parameters, click the plus icon next to Asset User Data, in the material editor. In the dropdown that appears, select "Export Material User Data".
==Basic Parameters==
===Material Type===
The type of material. Some materials need special handling by the exporter. The type is used to help determine these. If in doubt as to the correct type, leave it as the default (Other) value.
[[File:Material Type.png|thumb|312x312px]]*'''Grille''' - The exporter will create a proper two layered material and generate a blend map. One layer is chrome, the other is black.
*'''Clear Glass''' - For transparent glass materials.
*'''Decal''' - This is for multicoloured decals. Because these don’t work in a consistent way in Automation, the output is hard-coded for each base material. Don’t use this value for a brand new material as the exporter won’t know what to do with it.
*'''Number Plate''' - Another one that needs a two-layered material, one for the plate background and one for the numbering/lettering.
*'''Badge, Mirror''' - These are treated the same as “Metal” for BeamNG, though custom exporters may wish to separate them.
*'''Metal''' - For metallic materials. These default to full metallic and specular values, if those parameters are not specified.
*'''Black Plastic, Carbon Fiber, Leather, Opaque Glass''' - These are treated the same as “Other” for BeamNG, though custom exporters may wish to separate them.
*'''Other''' - default behaviour. If in doubt, use this value.
===Colour Param===
This group of parameters controls the diffuse colour of the material. See '''[[Mods and the Beam.NG Exporter#Combined Parameter Data|Combined Parameter Data]]''', below.
===Opacity Param===
This group of parameters controls the opacity of the material. See [[Mods and the Beam.NG Exporter#Combined Parameter Data|'''Combined Parameter Data''']], below.
===Roughness Param===
This group of parameters controls the roughness of the material. See [[Mods and the Beam.NG Exporter#Combined Parameter Data|'''Combined Parameter Data''']], below.
===Metallic Param===
This group of parameters controls the metallic value of the material. See [[Mods and the Beam.NG Exporter#Combined Parameter Data|'''Combined Parameter Data''']], below.
===Specular Param===
This group of parameters controls the specular value of the material. See [[Mods and the Beam.NG Exporter#Combined Parameter Data|'''Combined Parameter Data''']], below.
===Diffuse Tex Param Name===
The name of the parameter that refers to the diffuse texture.
==Extra Parameters==
===Alpha Cutoff Name===
This parameter determines the alpha cutoff, or the point where the pixel being rendered gets culled.
===Secondary Colour===
This is a secondary colour parameter. Not currently used.
===Multi Colour Decal Texture===
This parameter identifies the texture for a multicoloured decal.
==Normal Map==
===Bypass Normal Map===
If true, this material will not be exported with a normal map.
===Normal Switch Name===
The name of the switch parameter that turns normal mapping on/off for this material.
===Explicit Normal Map===
Normally, the exporter will pull out all of the textures in a material and use the first one it finds with the normal map pixel type as the material’s normal map. If the material has a 'detail normal' and a 'normal map', or multiple normal maps, the explicit normal map should be set to 'normal map' (or the same name as the variable name of the texture you want to be the normal map).
==UV Tiling==
UV tiling in Automation uses all kinds of projection maths that is not available to us in BeamNG. These parameters are used to help us get something that looks approximately right, though it will likely never be an exact match.
Because BeamNG does not support UV offset and scale, the UV data in the mesh vertices need to be modified for tiled UVs to work.
===UV Tiling===
The name of the parameter that controls UV tiling.
===V Stretch===
This parameter controls a scaling multiplier in the Z axis of the object. Only has effect if World Scaled UVs is true.
===World Scaled UVs===
If true, the UV scale is determined by the size of the mesh.
===Uniform Scaled UVs===
If true, UV scale values are forced to be the same in all 3 axes. Only has effect if World Scaled UVs is true.
===Force Rescale UVs===
If true, overrides the meshes UVs to a Z-projected (top-down) version of the vertex position, scaled to 2cm per UV tile.
=Combined Parameter Data=
This data allows for a group of parameters to be combined into one for export.
===Param Name===
The main parameter for the value. If Param Name 2 is empty, this will be the only parameter used and its value will be exported as is.
===Param Name 2===
The second parameter for the value. Many Automation materials blend between colours or other values via a noise/bump map or via some other user or child driven value. Because BeamNG needs a single value, we need to do the blending once for the whole material.
===Param Name Lerp===
This parameter, if named, controls the blending between the values of Param Name and Param Name 2. If Param Name 2 is empty, this value has no effect. If this value is empty but Param Name 2 is not, the two values will be averaged.
===Override===
If set to true, the above parameter names will be ignored in favour of the given override value.
===Value Override===
If Override is true, this value will be used for the parameter instead of the named material parameter.

Latest revision as of 21:31, 18 January 2023

Car body and fixture mods should in theory export to Beam.NG just like the built in bodies and fixtures. If it works in Automation, then the exporter should be able to deal with it. One exception to this is custom materials.

Custom Materials

See Export Material User Data main page

When the exporter exports a material, it checks which base material is being used and chooses from a series of built-in handlers based on that. Custom materials that are material instances of existing car/fixture materials should already export properly. Where possible, it’s best to use instances of existing materials rather than create new ones.

Textures

Pixel formats (selected in the “Compression settings” dropdown) supported by the exporter:

  • RGBA8d
  • DTX1/BC1
  • DXT3/BC2
  • DXT5/BC3
  • BC4 (Alpha)
  • BC5 (Normal map)

RGBA textures will be saved with DTX5/BC3 compression by the exporter.

For best results on export, make sure the “Global Force Resident Mip Levels” option is ticked on, otherwise the texture may export down-resed, depending on whether or not Unreal feels like loading the full resolution texture at that time.