Shader Correspondence between 3dSimed and Blender

Discussion in 'Track Modding' started by Barnaudprod, Jul 17, 2023.

  1. Barnaudprod

    Barnaudprod Registered

    Joined:
    Jan 24, 2021
    Messages:
    30
    Likes Received:
    4
    Hello, can someone explain me what is the shader correspondence of the T0 Lerp T1 vertex Alpha of 3dSimed in the Blender software. Thanks in advance to the community
     
  2. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    900
    Likes Received:
    6,168
    Blender does not natively support any shaders presented in RF2 (other than plain T1), and you don't really setup those game specific shaders in blender. There are a few ways to transfer shader info into newly exported FBX or GMT files:

    First method:
    1. After done modelling & texture mapping in blender, export model to FBX format, then import FBX file in 3DSimed.
    2. Open old GMT file that contains corresponding materials & shader setting. Once done, you will see two tabs on top.
    3. Keep tab at the old GMT file, at top of tool bar, select "Edit" > "Editing Materials", then select first material in the list, which opens side panel.
    4. Click "Copy Material". Then switch to the other imported FBX file tab, also open "Editing Materials" and click "Paste Material" as following:
    upload_2023-7-17_17-32-20.png
    5. Repeat this process for every materials until everything is set, then export file to rf2 GMT format, done.
    The above process can also be automated using custom batching scripts such as autohotkey.

    Second method:
    Save every material settings to JSON file in "Materials" folder of the track, which game will read JSON file instead of setting in GMT. This method is much easier and much less work in the long run, because it no longer cares about settings in GMT file, and no need to edit exported FBX files, as long as material name matches JSON file. All you need is to add "MaterialPath=TrackFolder\ASSETS\Materials" in SCN and corresponding folders, then in dev mode, load track once and open material editor to manually save every track materials to JSON.
     
    Last edited: Jul 17, 2023
    R Soul, Barnaudprod and Gilles Benoit like this.
  3. Barnaudprod

    Barnaudprod Registered

    Joined:
    Jan 24, 2021
    Messages:
    30
    Likes Received:
    4
    Thank you very much for your return and all this very detailed information that you have given me, especially those concerning Json files, for which I still do not understand much ..
    I try to explain the situation better:
    I develop a large part of my projects with the BTB software, by exporting the objects in GMT format (rFactor), and then I transform the format of the objects via the export of 3dSimed (GMT rFactor 2).
    But sometimes I edit objects in FBX format (mesh, material or edit UVs) in Blender.
    And for terrain type objects created in BTB , for which I blend one texture into another in order to have a Blend transition.
    When I open this type of object in 3dSimed, the corresponding SHADER is:
    BUMP SPECULAR MAP T0 Lerp T1 VERTEX ALPHA .
    But when I open it in BLENDER via an export in FBX format, the shader is not automatically parameterized..
    the object appears with a single texture.
    In Blender,
    I sometimes use in Blender, a shader that mixes three textures via vertex painting, but if I use this one, I have to repaint what I have already painted in BTB...
    Hoping to have been more specific.
    THANKS
     
  4. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    900
    Likes Received:
    6,168
    To help understand the method I mentioned earlier, see following diagram:
    upload_2023-7-18_10-51-45.png

    Note: if you are looking for a way to display RF2 shader in blender, then answer is it is not possible, and pointless anyway, because blender does not render stuff the same way as in RF2. You only re-assign shaders after exporting from blender and imported in 3Dsimed(or using JSON/material editor).

    The BUMP SPECULAR MAP T0 Lerp T1 VERTEX ALPHA shader (from BTB) you mentioned is from one of those old shader system that is outdated and not really used nowadays.

    The best way to get into new IBL shader system & material editor is by checking official guide:
    https://docs.studio-397.com/developers-guide/general-reference/pbr-a-guide-in-rfactor2

    And check out official example tracks in rFactor 2\ModDev\Locations folder.
    For example, to understand old shader system, check Joesville track. For new IBL system, check Loch Drummond track.

    A quick start to material editor:
    Load track in devmode, once track loaded, open following link in web browser:
    http://localhost:5397/materialeditor/index.html#/
    Then hit Ctrl+F and type a material name to search, click a material name to edit.
    Note: the track must have following line in top of SCN file (and corresponding folder) before any editing can be saved:
    MaterialPath=YourTrackName\ASSETS\Materials
     
    Last edited: Jul 18, 2023
    Barnaudprod, philrob and Corti like this.
  5. Barnaudprod

    Barnaudprod Registered

    Joined:
    Jan 24, 2021
    Messages:
    30
    Likes Received:
    4
    Thank you Victor for the time you took to enlighten me on the different technical solutions.
    Have a nice day
     
    svictor likes this.

Share This Page