IBL/PBR Car Shader Assistance

Discussion in 'Car Modding' started by Chris Lesperance, Sep 5, 2019.

  1. Bjørn

    Bjørn Registered

    Joined:
    Oct 4, 2010
    Messages:
    1,821
    Likes Received:
    919
  2. Juergen-BY

    Juergen-BY Registered

    Joined:
    Jun 16, 2012
    Messages:
    3,089
    Likes Received:
    440
  3. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    928
    Likes Received:
    6,283
    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.
     
    Last edited: Feb 27, 2020
    Mauro, Corti, Gilles Benoit and 2 others like this.
  4. Feralarri

    Feralarri Registered

    Joined:
    Sep 21, 2014
    Messages:
    116
    Likes Received:
    40
    Wouldn’t you need a region file?
     
    Brent likes this.
  5. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    236
    Likes Received:
    111
    Yes @Feralarri and I'm assuming @svictor is using the 32x32black.dds as a generic region file/map. However it'll be just one material that you can control and because it doesn't match the size of the base template you won't be able to control the mappings of other materials.

    Another thing that should be included here is the material search path MaterialPath= added in the gen file(s) and point to the mymod_teams.mas where all of these textures should reside. It's come up here before and it was brought up again earlier in the week.

    It seems the dev guide needs to be updated with this information.
     
    Last edited: Feb 27, 2020
    dylbie, zxd1997 and svictor like this.
  6. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    928
    Likes Received:
    6,283
    Yep, 32x32black.dds is used as default region map. When you extract XXXX_BaseMat.json from one of tatuus car for example, you will find following lines in json:
    "Name": "region",
    "ShaderPass": 0,
    "ShadowMipBias": 0,
    "StageType": "CUBETST_SPECULARMAP",
    "TexChannel": 2,
    "Texture": "32X32black",

    Just replace 32X32black with your region map dds and you can have all the regions.
     
    Brent likes this.
  7. zxd1997

    zxd1997 Registered

    Joined:
    Sep 26, 2019
    Messages:
    306
    Likes Received:
    281
    I post here again because this thread is a very good guide that to implement PBR shader, I think many modders can use this way to make a good PBR car like chrome Mclaren F1 cars

    Hello, I finally found how to apply IBL/PBR shader for WCEXTRAs materials, for those old rf1 F1 mods which use more than one WC material to make the body, and what's more, to make the whole car use PBR shader, with @Coutie help hugh thanks for him, and try with Shumi's converted MMG07 Mp4-22, chrome looks good but still need some modify I think. And I have no original PSD of the skin so it make me harder to make the proper pbr region.....
    EDIT: IMPORTANT: THIS WAY CAN ONLY MAKE A CAR GLOBAL MATERIAL, CAN'T VARIOUS BY DIFFERENT SKINS. WE CAN JUST USE IT ON THE COMMON TEXTURE PART OF A CAR. (F1 cars seems all OK because a unique car have nearly the same skin.)
    I don't know whether I describe correct enough, if not, you can see the discussion under this post to find out.
    BUT ANYWAY WE HAVE A WAY TO APPLY PBR ON OTHER MATERIAL AT LEAST.
    And the way is :
    1. in car's .gen file, add a line MaterialPath=<VEHDIR>McLaren_2007\team (point it to your material json's path), and remember all the file material needed need to be in SearchPath.
    2.just with original way to make region、AO and so on textures to make it ready for material assign
    3.jump to http://localhost:5397/materialeditor/index.html#/ , select the material name, and just edit it, change shader to L2IBLCARBODY, assign region\damage maps, and tune the number of PBR effect like reflective ad so on, then save it. With MaterialPath set, it can work fine with Save to dev function. Just make it one by one until all the material you need to do with PBR done.
    Here's preview, I can't make a proper region map and can't do a AO map, so just for preview how it's works[​IMG](updated with original spec map pretend to be a ao map. looks a little better )
    [​IMG] [​IMG] [​IMG] [​IMG] [​IMG] [​IMG]
     
    Last edited: Apr 7, 2020
    dylbie, svictor and Juergen-BY like this.
  8. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    1,295
    Likes Received:
    2,061
    I'm actually struggling with the multiple IBL maps with the DP-01. There is a WCWING that needs to have the PBR with it, along with an WCEXTRA0 and WCEXTRA1 (Onboard camera).

    I have my "MaterialPath=<VEHDIR>\Panoz_DP01\maps". I have my 3 add on .JSON in the maps folder and maps.mas. I doesn't work
    If i change it to "MaterialPath=<VEHDIR>\Panoz_DP01\teams" and move my 3 add on .JSON in the teams folder and team.mas. I doesn't work

    I guess my question is, when you do this, it creates a WCWING.json, does that go into the "Teams.mas" or the "Maps.mas" or is it what it is listed in the .gen? Is the WCWING.json, is it supposed to be a copy of the basemat.json or a livery.json? The basemat.json has the additional information at the bottom that references the AO map, damage maps, etc.

    I would like to get this working before i release it, as I want to have the clear coat on the test DP-01.

    Slight OT: My OCD is still upset that those json files are not the same. It just makes all of this a lot easier as you know what you need. Looking at the Tatuus, there is a Tatuus_PM18_BaseMat.json and then each car has a .json. The .veh references the basemat.json. I still can't grasp if they are independent or work in conjunction with each other. My OCD just says that it should be the [veh file name].json with all of the basemat information in it.
     
    zxd1997 likes this.
  9. zxd1997

    zxd1997 Registered

    Joined:
    Sep 26, 2019
    Messages:
    306
    Likes Received:
    281
    You can use save to dev function of the material editor that will save to the path you define, I guess that you mean where or which mas you need to put the json in? Errr, maybe this is a question...I suggest you can put it in every mas and see which one works.... I think in teams.mas in my situation, or searchpath or masfile add some path....But may cause OCD, hahah
     
  10. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    1,295
    Likes Received:
    2,061
    I think that is the issue. No matter where I have them, it doesn't work :( Unless I'm missing a naming or something...
     
  11. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,779
    Likes Received:
    2,241
    Are you trying to use the car paint editor to edit them, or the material editor? I think you can only edit the WCCarbody with the car paint editor, but I could be wrong.
     
  12. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    1,295
    Likes Received:
    2,061
    Hopefully, this might make more sense. In my .gen and spinner.gen, I have:

    MaterialPath=<VEHDIR>\Panoz_DP01\maps

    The created .json are in the Panoz_DP01\maps folder.

    When it initially loads
    Untitled1.jpg
    Change to Chrome. Based on the last screen of the textures, the endplates should change to chrome along with the body
    Untitled2.jpg

    Material editor page
    Capture.JPG

    Please note, these screenshots were taken in Mod Dev.
     
  13. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,779
    Likes Received:
    2,241
    No, it only does the wccarbody texture. I'm pretty sure you can only edit that in the car paint editor. The others ones you would have to set globally, so you should probably merge them into the main texture.
     
    zxd1997 likes this.
  14. Rastas

    Rastas Registered

    Joined:
    Feb 17, 2017
    Messages:
    597
    Likes Received:
    1,281
    The new 3dsimed3 suports the IBL shaders for cars and tracks,but still not easy...at least for me... :/
     
    zxd1997 likes this.
  15. Bernd

    Bernd Registered

    Joined:
    Jul 9, 2013
    Messages:
    1,509
    Likes Received:
    755
    I think that is the deciding hint.
    Every part of the car, for that you want to use the IBL carbody shader, has to be mapped to the main wccarbody texture, that is linked as DefaultLivery= in the veh file.
     
  16. zxd1997

    zxd1997 Registered

    Joined:
    Sep 26, 2019
    Messages:
    306
    Likes Received:
    281
    other parts can do that, but on chris' situation i think the problem is materials besides wccarbody may only be set globally and can't changed with different skins.. seems like that
     
  17. zxd1997

    zxd1997 Registered

    Joined:
    Sep 26, 2019
    Messages:
    306
    Likes Received:
    281
    as coutie said, and I realized that in the way I said it can only be set globally with one gen,, can't various by skins.
    and most important thing is, the carpaintor can only edit wccarbody, if you wan to change other, you need do it in material editor, and without 6 preset 397 provided. but you can change the number more freely and maybe more accurate. But as a said before, unfortunately the others can only be one style mapping for one car. Only the main wccarbody can be define by materialoverrode I think. I haven't try it, but in file structure, maybe this is the truth, sadly truth. But with that we can apply pbr in some common part, interior, carbon bit, engine part and so on, and seems official gt3's interior have pbr effect.
     
  18. Bernd

    Bernd Registered

    Joined:
    Jul 9, 2013
    Messages:
    1,509
    Likes Received:
    755
    That is how it is meant.
    To get the full features of the IBL carbody shader for any part of the car, you have to use the wccarbody material and that uses the DefaultLivery= texture.
    So you have to map these parts to this texture and use the wccarbody material for them too.
     
    zxd1997 likes this.
  19. zxd1997

    zxd1997 Registered

    Joined:
    Sep 26, 2019
    Messages:
    306
    Likes Received:
    281
    yes, still need 397 to improve it, but at least we can use PBR in interior or some common parts, it may help. And as I edited on the post, F1 mods have nearly the same skin scheme of team's car, so it might be nice to update PBR on those mods without do a uv remapping, it might help.
    But we hope 397 can provide a better solution, to extend PBR to all parts
     
  20. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    1,295
    Likes Received:
    2,061
    So I'm just curious, how does it work on the McLaren? How is the two situations different? If there is any kind of workaround in my situation, I'll explore it. The one thing I don't have the ability to do is to add the wing to the WCCARBODY. Unless there is a really step by step mapping tutorial and if the texture could be 3072x2048, then maybe I would be able to do it LOL!
     

Share This Page