Here is a much simple way of applying PBR (
idea from this post), no longer have to deal with "Error, Couldn't save material because" and other error or missing file issues.
Files to prepare:
First decide car name, such as "
somecar", will be used for file name.
somecar_AO.dds
usually mod comes with body AO.dds or SPEC.dds, which will do.
Folder to place:
maps
metallicNoise.dds
Can be found and extract from other mod, such as official car TATUUS.
Folder to place:
maps
CAR_DAMAGE.dds
Can be found and extract from other mod, such as official car TATUUS.
Folder to place:
maps
CAR_DAMAGE_Bump.dds
Can be found and extract from other mod, such as official car TATUUS.
Folder to place:
maps
32x32black.dds
This is the region map. For some official mods such as Tatuus, it uses Black texture for simple base region map. You can always make your own region map later (just replace
32x32black name with yours in
.json file).
Folder to place:
maps
somecar_BaseMat.json
Base PBR file, the eaiest way is extracting from other mod, such as official car TATUUS (looking for filename that contains
_BaseMat.json ). Other troublesome method to generate this file is described in early posts using
http://localhost:5397/materialeditor/index.html#/
Folder to place:
teams
Modify VEH file:
Open .VEH file that you want to apply PBR (located under teams folder usually).
Go to second line and Insert a new line with following:
MaterialOverride="somecar_BaseMat.json"
and then save and close.
Note: after save VEH file, must quit and restart game for it to work. Only cars with MaterialOverride in .VEH will be able to use PBR skin.
Modify BaseMat.json manually:
Open
somecar_BaseMat.json, find
aoSpecMask section, go down 5 lines and change the name behind
"Texture" to
somecar_AO, note that you don't write .dds file extension here. Example:
"Name": "aoSpecMask",
"ShaderPass": 0,
"ShadowMipBias": 0,
"StageType": "CUBETST_SPECULARMAP",
"TexChannel": 3,
"Texture": "somecar_AO",
And then save and close.
Now in DEV mode showroom:
Open
http://localhost:5397/carpainteditor/index.html#/carpainteditor
Check if the sliders and all the effects are working.
To change PBR setting (BaseMat.json), there is two way:
1. Package the car into main game and create PBR skin according official guide. Then copy corresponding json value over.
2. Or better way to save time, open BaseMat.json and adjust following region values manually:
"baseCoatRefractiveIndex"
"baseCoatRoughness"
"baseCoatSpecStrength"
"clearCoatRefractiveIndex"
"clearCoatRoughness"
"clearCoatSpecStrength"
"lacquerColour"
"metallicFlakeColour"
"metallicFlakeStrength"
"metallicPaintStrength"
Then save and hit reload in dev mode.
It takes some time to find out what each value does, but this also let you to have more control over some values which ain't availble in carpainteditor, and no need to pack mod and all the trouble.