IBL/PBR Car Shader Assistance

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

  1. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    754
    Likes Received:
    566
    I've had a small back burner project going for getting the URD Formula Lights cars updated with the newest rFactor 2 configuration, with updated materials. As this would be the last step in the Road to Indy ladder between the S397 Tatuus USF2000, S397 Tatuus PM-18, and the two current Indycar IL18 mods

    The original can be found here.
    https://forum.studio-397.com/index.php?threads/urd-indycar-2016-and-indylights.55779/

    Some quick background, I'm still really new and inexperienced to this type of modding. Painting and some file management is about as far as it gets with me. I don't have 3DS Max, and not familiar enough with Blender. I'm confident with most things with 3dSimEd.

    I have a question on using the shaders. I see that the Tatuus cars are mostly unlocked (THANK YOU S397!!). With 3DSimEd, I see that the WCCARBODY is a T1 texture with a .json material override listed in the .veh.
    PM18.JPG

    One of the mods that I initially thought was using the new material system, the RSS DPi and SlowMotion's GP3, has the WCCARBODY with "CARPAINT + DAMAGE + RAIN". I don't remember looking to see if it had the .json Material override
    DPi.JPG

    So my question, is that, is there a difference between the two? Will both allow the Material System to work? And then how do I set up the Material Override .json? Do I just copy from an existing one, and change the textures within that? Is that set up from Mod Dev or do I have to package everything and run it in the main game?

    I am aware of this. I'm trying to still get my head around all of it to get a proper workflow going :confused:
    https://docs.studio-397.com/developers-guide/cars/car-art/working-with-new-ibl-pbr-car-shader

    My main goal is to have the look of the cars to be on par with the Tatuus and Coutie's Indycar mod. I wish I knew the physics a bit better to fix that as well. But that is completely out of my knowledge base
     
    Last edited: Sep 5, 2019
    Gilles Benoit likes this.
  2. Coutie

    Coutie Moderator

    Joined:
    Oct 5, 2010
    Messages:
    2,259
    Likes Received:
    1,200
    As you see, you can now overwrite materials with a json file(not just the ca rbody, but everything), so I would just export everything as t1, but I guess it really doesn't matter. You're going to have to launch the game in devmode, go into the showroom or on track, and go to http://localhost:5397/materialeditor/index.html#/, once you're there, you'll see WCCarbody, you need to select that, and choose IBLCarbody for the shader. Then from there, it's pretty straight forward. The carpaint+damage+rain is out-dated now, but it needs to be left in with all the other shaders or else older mods won't work anymore. Once you do the "MaterialOverride="AstonMartinGT3_BaseMat.json"" in the teams file, everything will save to that file, for the car you're working on. You can then copy and paste that material, then edit it for all the other cars.
     
  3. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    754
    Likes Received:
    566
    Awesome! Thanks. I'll give that a shot!
     
  4. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    754
    Likes Received:
    566
    So I think I got the initial pass on the BaseMat.json. Now how would I go through saving the individual car region.json? I can pull up the http://localhost:5397/carpainteditor/index.html#/carpainteditor and changing the different options work, but I don't see a car .json show up when I click on the apply in the tuning menu.

    That material editor is pretty cool. I can see how, in the future web based UI, how that could be incorporated into the Dev Mode version of the game.

    Exported with T1, then created the MaseMat.json. This is the initial result. Once I get the car regions defined, it should look a lot better.

    PS: Not sure why the AI was defaulting to wet tread tires. Something I'll have to look into.
    20190905185528_1.jpg 20190905185621_1.jpg 20190905185703_1.jpg
     
    Last edited: Sep 6, 2019
    Gilles Benoit likes this.
  5. Coutie

    Coutie Moderator

    Joined:
    Oct 5, 2010
    Messages:
    2,259
    Likes Received:
    1,200
    You would need to have the material already made before you could use the skin editor thing.
    Edit: You need a base material for every car, or you could share one, you just need to point to it in each teams veh file.
     
    Gilles Benoit likes this.
  6. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    88
    Likes Received:
    20
    When I click on the Save To / ModDev button I get this dialog box error:

    Error, Couldn't save material because:
    MaterialPath was not set in the scn file, please set this value before saving materials

    I have the "MaterialOverride="samenameasdds_BaseMat.json" with samenameasdds is only 8 characters. This is just below the DefaultLivery line in the veh file. The paths in the gen files work, the vehicle loads just fine in ModDev and RF2.

    My search paths in the upper right are:

    Search Paths:
    vehicles\
    vehicles\mymod\maps\
    vehicles\mymod\teams
    vehicles\mymod\teams\


    I don't mean to takeover your thread Chris, I'm working on this too and found this thread helpful and thought this would be the best place to ask this question.
     
  7. I_Bellett

    I_Bellett Registered

    Joined:
    Jan 12, 2012
    Messages:
    114
    Likes Received:
    75
    I think it is necessary to set "IBLCarShader" in 3Ds Max and output GMT now.
     
  8. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    88
    Likes Received:
    20
    I have not done that and might explain why. SCN is normally for tracks so I've been doing some head scratching.

    What's the best workflow to get an existing GMT into 3Ds Max? Would you export it from 3DsimED or Blender to another format (fbx or something else?). Does the model lose it's UV mappings for the textures doing that?
     
  9. D.Painter

    D.Painter Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,026
    Likes Received:
    2,298
    When writing the GEN.ini files whether track or spinner what material and GMT are first inline will automatically be the default.
    If the wet tyres are first inline in the GEN they'll load as default.
    Most have slicks as default so should be the first inline down the GEN text.
     
  10. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    754
    Likes Received:
    566
    No worries! There hasn't been much that utilize it. Documentation is ok, but this is putting more lines between the dots.

    I came across this same thing and figured it out. Click on the "Save" file and save it in your teams folder. Then change the name of it what you would like, and make that reference in the .veh (MaterialOverride="samenameasdds_BaseMat.json). Reload the car. I actually closed out of the game and reopened it. Then you should be able to do the "Save to / ModDev" from that.

    I do need to make the region texture yet. Just looking at your Indycar mod. I'm going to be paraphrasing here as I'm not in front of my PC to get the exact file names. I think for Colton Herta, the MaterialOverride= is set to "andretti_BaseMat.json". Then there is an ADC_IC18_88.json, which I would assume is the part of skin editor. My question is how do I create the "ADC_IC18_88.json" for the Indy Lights car.

    Once I create a region.dds, does hitting apply create that .json? Do I copy an existing Json, name it accordingly and that will write in the correct info? Or is everything just based on the MaterialOverride json?

    I know I have some parts that I need to define as carbon fiber and vinyl. Some other cars will have some chrome. I just didn't see a way to define that from the http://localhost:5397/materialeditor/index.html#/ screen
     
  11. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    754
    Likes Received:
    566
    I'll have to reverify. I didn't make any changes to the .GEN from the original mod. I'm just not sure if I accidentally over wrote something. It may have been there originally (in ModDev) too, and I just didn't notice.
     
  12. Coutie

    Coutie Moderator

    Joined:
    Oct 5, 2010
    Messages:
    2,259
    Likes Received:
    1,200
    You might need to create a json file first, but it should create the file for you once you hit save to mod dev. For each team, I have a separate json, but I share regions for the Andretti, Penske and SPM cars.
     
  13. Coutie

    Coutie Moderator

    Joined:
    Oct 5, 2010
    Messages:
    2,259
    Likes Received:
    1,200
    Have you tried creating a blank json file with that name in your team folder?
     
  14. Coutie

    Coutie Moderator

    Joined:
    Oct 5, 2010
    Messages:
    2,259
    Likes Received:
    1,200
    No, it works either way, I've done both(carbody and t1, or any shader), and both work.
     
  15. I_Bellett

    I_Bellett Registered

    Joined:
    Jan 12, 2012
    Messages:
    114
    Likes Received:
    75
    Thank you infomation.
    I will try it again.
     
  16. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    754
    Likes Received:
    566
    I'm slowly getting there... I think. The base mat .json is different than a car.json. I copied an existing car.json. It worked... kinda. I created a package, got it ingame. Created the Dir, and then attempted to load the car paint editor but get this error. Not sure why it is reference a .bmp.

    Not going to lie, it is crazy complicated, but I feel obtainable

    So next part, I'm just editing the WCCARBODY. Is it possible to have the PBR on two textures at the same time? I have set up almost exactly as the Indycar mod, (EXTRA1 = FLOOR), is it possible to have both work with the material system at the same time? Untitled-1.jpg
     
  17. Coutie

    Coutie Moderator

    Joined:
    Oct 5, 2010
    Messages:
    2,259
    Likes Received:
    1,200
    Part 1, maybe you forgot a texture when you packaged it.
    Part 2, as of right now, I don't think so.
     
  18. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    754
    Likes Received:
    566
    .BMP seems really weird. Every thing seems ok. In the .json, it doesn't list an extension. I'm not sure. But by loading ingame, creating a new stand alone car, setting the material settings, saving and then copying that back over to mod dev, seemed to have provided my desired result. Very round about, but it worked. (Note the chrome on the #27 and #28 cars)

    I'm missing a few layers from the template sent to me from the Indy Lights 2019 skins. I have one skin to finish painting. Once I get that done, I feel comfortable enough to do an initial release. If there is any bugs after that, I will attempt to fix. I'm hoping this weekend to have that done.

    And then to follow up from my question from before with two PBR textures, not sure if Rims could be set up with chrome settings separate from the WCCARBODY. Can't load enough files to tell how that works.

    20190905185703_1.jpg

    This pic highlights the issue of not having two textures as PBR at the same time. The logos on the side seem highlighted( Dynamic, Racer etc) 20190906224119_1.jpg 20190906224915_1.jpg 20190906225208_1.jpg
     
    UnitedRacingDesign likes this.
  19. Coutie

    Coutie Moderator

    Joined:
    Oct 5, 2010
    Messages:
    2,259
    Likes Received:
    1,200
    The logos being bright just look like they're in the sun, and the others are in a shadow.
    You can't have more than one material override in the veh file it seems, but you can put MaterialPath=xxxxx in the gen file, and then have other materials with the carbody shader, or whatever shader, but people won't be able to edit the region file(I think, at least) for them.
     
  20. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    88
    Likes Received:
    20
    Wheels can be setup with chrome region mapping. I've done it with a mod but it has to be setup this way... the WCCARBODY material has to be used on the wheels, the wheels are included and mapped to the main body template. Then you can assign a region color to the region.dds for the wheel and set that as chrome. I'm curious about what Coutie suggested with more than one material override.

    I have a couple basic questions I can't seem to find in the guides:
    - Does the region.dds files for each vehicle have to be included in the teams mas when packaged into the mod? Or is only the .json needed after the region mapping is applied?
    - Does the IBL texture maps, albedospec,aospecmask, go in the maps or teams folder/mas? The guide isn't specific on this, it only says the metallicflakes texture be saved the maps folder/mas. Can I assume all of the IBL texture maps go in the maps mas?

    I experimented with ModDev and still was getting the material path error. Then I experimented by adding a json from another vehicle in the teams folder and things seemed to be working. I need to try to clear out everything in the json and try it again next chance I get to work on this.

    I had one out of a handful of vehicles where I'd apply the IBL changes I want but they wouldn't stay when I click reload in the showroom. Everything seemed to be correct in the veh file. I need to tinker some more, perhaps some of the issues will get resolved with answers to my above questions.
     

Share This Page