IBL/PBR Car Shader Assistance

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

  1. zxd1997

    zxd1997 Registered

    Joined:
    Sep 26, 2019
    Messages:
    306
    Likes Received:
    281
    I just use the way I describe above, and... just for one car testing, And I haven't check another car, just test it.
    For what I've done, just simply
    1. add MaterialPath mapping in .gen file
    2. assign PBR for those materials you want to in http://localhost:5397/materialeditor/index.html#/
    3. press save to dev when you done. just don't use carpaintor in dev mode I think.
    4. in devmode, it's done, in user mode, I'm not sure that, like pack in which mas and so on..
    you can try it in dev mode first, if done, try on user mode.
    Sry for my poooor description, hope you can understand it.
    And what's more, the solution only works for global you know, all car's .veh use this gen will take this materialpath and use the material beside wccarbody will be override by materialoverride (I think so).
     
  2. zxd1997

    zxd1997 Registered

    Joined:
    Sep 26, 2019
    Messages:
    306
    Likes Received:
    281
    and what's more the texture resolution can be 2048x1024, so why not it can be 3072x2048 haha. Remapping UV is also not in my poor skill tree so I try to find that way.
    But for your mod I think unless you create gen for each car have different WCEXTRA material mapping path and create different folder to put jsons, you can't do it perfectly(PBR differ from every car on WCEXTRAs)
     
  3. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    935
    Likes Received:
    6,341
    Hi, to any one having errors while loading PBR, including:
    1. Source map for render target XXXX.DDS CANNOT be a DXTn format
    2. Error getting stats for texture XXXX.DDS Error loading texture XXXX for material XXXXX.
    3. Error loading global material XXXXX
    sadas.png

    The cause of this BUG:
    This error, IS NOT due to wrong MaterialPath setting, BUT due to wrong UTF-8 codepage used by material editor while saving json file from http://localhost:5397/materialeditor/index.html#/

    HOW to fix this problem:
    First download and install notepad++, then open your PBR XXXX.json file in notepad++, go to Main menu > Encoding , then select Encode in UTF-8-BOM and save your file, then check it in game, your PBR should load now.
    413162939.png

    PS: I have tested this in both firefox & chrome, and they have all saved XXXX.json file in UTF-8, which is causing loading bug. If 397 see this, please take a look at material editor for possible bug.
     
    Hazi, Corti, zxd1997 and 2 others like this.
  4. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    1,299
    Likes Received:
    2,066
    I haven't come across that one. But I do get this one with the Panoz when attempting to create a virtual ride. Could this be because I use separate .mas files for the Teams and Maps? The Teams.mas has the _basemat.json, and the maps.mas has the CC07_WCCARBODY.dds. Should these be merged into one?

    Capture.JPG
     
  5. zxd1997

    zxd1997 Registered

    Joined:
    Sep 26, 2019
    Messages:
    306
    Likes Received:
    281
    try to put the needed files into one mas where the json at, I thinl that maybe enough
     
  6. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    1,299
    Likes Received:
    2,066
    I just did a test, and moving everything into one file does seem to fix that issue. Looks like I'll have to do that from now on. It could get a bit messy with some mods. :confused:
     
    zxd1997 likes this.
  7. zxd1997

    zxd1997 Registered

    Joined:
    Sep 26, 2019
    Messages:
    306
    Likes Received:
    281
    you can only move needed things..... but need try again and again....but less mess isn't it
     
  8. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    237
    Likes Received:
    113
    What are the steps involved for applying the IBL/PBR shader to an object with the WCWING material? It seems from what I read you cannot use a custom region file to adjust the material like you can with WCCARBODY. I've been trying for hours to get this to work and it's not working

    I have the material path in the gen file. Do I need to include another json? If so what should it be named WCWING.json? Does it need a reference in the veh file?
     
  9. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    1,299
    Likes Received:
    2,066
    I spent the same amount of time on it as well, and at this time, it is not possible. For the DP01, I had some one map the WCWING texture to the WCCARBODY so it was all on one.
     
  10. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,780
    Likes Received:
    2,242
    You can't have multiple region files that users can edit. You could use the ibl car body shader for multiple materials, but the regions would be fixed to whatever you set.
     
  11. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    237
    Likes Received:
    113
    @Coutie Right, I understand that. What I'm asking is how do I apply a fixed IBL to a wing? Do I need a second basemat.json reference in the Veh file? Does the json need to be in a certain format? I apply the IBL/PBR shader in DevMod and I can get it to apply the IBL/PBR but it doesn't seem to apply it permanently, when I leave the session and come back, it's gone.

    And I've gotten this error using the material editor trying to "save to devmod" before. But I have a material path in the gen file. Does the json need to be in with the general maps or does it have to be in the teams path?
     

    Attached Files:

    Last edited: Apr 25, 2020
  12. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,780
    Likes Received:
    2,242
    I've just created a separate folder for materials, maybe you've encountered a bug, because the way you describe doing it is the same way I do it, and it works for me.
     
  13. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    237
    Likes Received:
    113
    Yep I gave up on applying the IBL/PBR shader to the WCWING Chris. I combined the main and wing templates and have just one WCCARBODY material that controls both. I'm having someone help me with remapping the wings as well. What a PITA
     
  14. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    1,299
    Likes Received:
    2,066
    Yeah I gave up as well but was lucky enough to find some one to be able to change it for the DP01. It would be great if this could be something that could be added in the future.
     
    zxd1997 likes this.
  15. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    1,299
    Likes Received:
    2,066
    So a small update. In a conversation with @ChiefWiggum, he may have figured it out. I haven't done full testing on it, but I applied it to the camera texture on the DP01 and now the helmet.

    I missed a 3DSimEd update that had the IBL shaders added. Here's Chief's post:
    ----------------------------------------------------------------------------------
    I found out that the textures have same order as the json file

    Direct X Shader = IBL Carbody Shader
    Primary texture map
    texturemap = basic Skin

    Secondary texture map
    channel 1
    Diffuse map t2 = damage texture
    channel 2
    specular map = region texture
    channel3
    specular map = AO texture
    channel 4
    cube map = the json file have no texture, I used the carcube DX9 for the helmet
    channel 5
    bump map = damage bump texture
    channel 6
    rain drop map = 32x32flatn texture
    channel 7
    bump map = mettalicNoise texture

    for me it works very good with the helmet, the helmet looks great
    ----------------------------------------------------------------------------------

    Anybody know what the official take is on the Channel 4 and Channel 6 textures? It has good shading that matches the rest of the car, but I haven't gotten the region part to work either. I'm assuming because it might have something to do with not having a proper json.

    Just putting this out there for the people that might know better than me :)
     
    svictor, Corti and zxd1997 like this.
  16. Arnaud Plume

    Arnaud Plume Registered

    Joined:
    Jul 5, 2019
    Messages:
    178
    Likes Received:
    1,100
    The new build 1.118 altered in a bad way the colors of our converted GTPC mod because I used old CARBODYPAINTWITHDAMAGE shader.

    When switching to lastest L2IBLCARBODY I recover original colors so here are my solution to make a quick switch even if the mod are using multiple wcextra textures.

    Pay attention that I'm not fully using PBR capacity as everycar use the same defined region with my method.

    * Add a line MaterialPath=[directory_of_you_car]\teams in your .gen files
    * Add some dds files in your teams directory (metallicNoise.dds / a damage.dds & damage_bump.dds / a Region.dds full black in my case / your AOmap.dds)
    * No change in veh file as every car will use same region.dds
    * Load your car on track in devmod and go to http://localhost:5397/materialeditor/index.html
    * Find the material you want to change, WCCARBODY_000 for example, select L2IBLCARBODY shader in the list
    * Fill the channel with your dds files like explained in several post of this topic
    * Change the parameters of the regions (alpha/black/blue etc.) to your taste
    * Save your .json file or download it

    * At the end, you want this json file in your team directory. The json have to be named like the original material name. In my example, I've edited WCCARBODY material so my file is named WCCARBODY.json (for WCWING material the name is WCWING.json and so on)

    * Open this file in notepad, find the first "Texture" line, fill it like this:
    "Texture" : "wccarbody",
    Check the other textures (some of them are already filled)
    2nd "Texture": "name_of_your_damage_file",
    3rd "Texture": "name_of_your_region_file",
    4th "Texture": "name_of_your_AOmap_file",
    5th "Texture": "CAR_CUBE_DX9",
    6th "Texture": "name_of_your_damage_bump_file",
    7th "Texture": "a rain normal file",
    8th "Texture": "metallicNoise",
    NB: I had to change "runtime" to true for damage & damage_bump to activate those textures

    *
    You can do that for each material you want. It's also working with wcextra & wcwing (just place wcwing instead of wccarbody in your first texture line of your json)

    ***************************************

    I've also tried to have one specific region file for each skin (with a MaterialOverride= in the veh file) but it worked only partialy. It was ok for the selected car but nok for AI cars (I don't know why but the AI region map was automaticly replaced by the defaultlivery.dds of the AI car giving strange results).
    EDIT: Bug solved => in .veh the DefaultLivery line must have the extension .dds added to the name of the livery or you'll encounter a bug with AI region map.
     
    Last edited: Sep 30, 2020
    Mauro, svictor, dylbie and 2 others like this.
  17. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    1,299
    Likes Received:
    2,066
    I have a slight update. So looking at @Coutie 2018 Indycar (again S397 having some examples of car not encrypted helps modders), I figured out how the IBL works on the support textures. I'm not sure if I was doing something different before, but doing everything from the Material Editor worked.
    http://localhost:5397/materialeditor/index.html#/

    I followed along with the RIMS, using he same settings, same json material values, and I'm getting some strange artifacts. Any ideas?
    20200524113730_1.jpg

    For @Coutie, question for you. I was looking at the rims I noticed that you had a working normal/bump map for the rim (IC18_Rim_N.dds). Just wondering how you got that to work? I'm not seeing any references for that. I don't know if I am missing something. That would come in useful for my case as it would work for the body panel lines. I know it would come in useful for other cars
     
  18. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,780
    Likes Received:
    2,242
    The normal map isn't being used, I just didn't take the file out.
     
  19. JorgeAH

    JorgeAH Registered

    Joined:
    Jan 25, 2018
    Messages:
    83
    Likes Received:
    5
    What beta is this menu from? i can not enter in dev mod in the public beta
     
  20. TheGame316

    TheGame316 Registered

    Joined:
    Sep 27, 2015
    Messages:
    180
    Likes Received:
    186
    Opt out of betas and you can access. Not available in new UI yet.
     

Share This Page