My Modding Notes using Opensource & Free software

Discussion in 'Modding' started by svictor, Dec 24, 2021.

  1. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    926
    Likes Received:
    6,282
    This thread is dedicated to share my modding notes that I have learned and used with mostly opensource & free software. The first post will be used as a list of links to various related notes, including my posts from other threads. New notes will be posted & updated here.

    All notes are provided in hope that they will be some help, especially for modders using opensource & free software. And those notes are by no means 100% error free, or the definite way to achieve things, or up to date to RF2's constant evolving state. Feel free to correct any error, and give suggestions & solutions. Thanks.


    Modding Tools
    all are free or opensource, except 3dsimed
    GIMP (for creating & editing texture)
    krita (for drawing texture)
    Inkscape (for drawing high quality vector image)
    Blender (for 3D modelling)
    gJED (for applying specific RF2 functions)
    3dsimed (for converting and batching models)
    Notepad++ (for manually editing various game files)
    git bash & dos batch & Autohotkey (for script batching large amount files, and automate process)
    Imagemagick + texconv + 397's MapConverter (for batching textures & output dds)
    ESRGAN + ImageEnhancingUtility or Cupscale (for AI-Upscale textures)
    AwesomeBump (for generating additional PBR textures)
    ImageViewer (for proper viewing BC5 BC7 DDS and conversion)

    PBR guide:
    - Create PBR Material from scratch using Blender + GIMP
    - Create groove map & road textures using Blender & GIMP
    - Guide: Quick way to apply new IBL Tyre shader & PBR materials for old mods

    General:
    - How to apply & export individually centered Pivot Points on a group of objects in 3dsimed
    - How to separate part of an object using Cut & Paste in 3dsimed

    - How to add "sequenced animation" & Doubleside property for IBL shaders
    - 3D animation using Blender+GIMP

    Car:
    - Fix Upgrades/Models overlapping first model in Showroom(Spinner)
    - Guide: How to make Dashboard Backlights switch on & off in night like real life street car
    - Fix LOD issue for old RF1-like converted mods with 2 separated cockpit models
    - How to properly place mirror UV map & change mirror resolution for car
    - How to create & adjust high quality RF2's image based FONT for car dashboard (or ingame HUD)

    Track:
    - Create RF2's new billboards using 3dsimed+gJED
    - Missing "cap end of path segment" in AIW causes server crashing
    - Two road mesh system & how they interact with Real Road effect
    - Road surface subdividing in Blender
    - How to use Blender's LoopTools addon to smooth road bending and elevation (last update 2021/12/24)
    - Steps to create a track update package
    - How to merge "low poly" edge with "subdivided" road mesh edge & add road noise in Blender (last update 2021/12/24)
    - Steps to apply new Digital Flags material
    - Steps to create Road detail map in Blender, also see here (last update 2021/12/24)
    - Manually set initial position of garage in AIW
    - How to snap selected road edge to nearby grass(or the opposite) without affecting grass edge position in Blender
    - How to setup Point to Point timing layout for track (such as rally) (last update 2023/07/14)
    - Batch fixing upside down Billboards objects using Blender
    - How to customize Driving-Line texture
    - Alternative Point to Point timing sectors setup

    Scripts & batching:
    - Imagemagick tips
    - Imagemagick batching command for locally converting all car icons for new UI
    - Scripts for preparing PBR texture
     
    Last edited: Feb 20, 2024
  2. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    926
    Likes Received:
    6,282
    How to apply & export individually centered Pivot Points on a group of objects in 3dsimed:

    1. From main menu "Import as Objects" to import all objects.

    2. Switch to Edit tab, from Object Centers dropdown list, select Center Objects Pivots.
    upload_2021-12-24_14-36-51.png

    3. Select all objects by click All Visible button(or use Alt+A), select Objects > Set Tags
    upload_2021-12-24_14-39-26.png

    4. Then activate Moveable checkbox, and click ok, as pic shows. This step is very important, in order to save/store Pivot Point into exported GMT.

    5. Last, export GMT. Also make sure in SCN (for track) or GEN (for car) file, there is a line inside each GMT instance brackets as Moveable=True, otherwise you may not see the object in game.

    -----------------------------------

    How to separate part of an object using Cut & Paste in 3dsimed:

    3Dsimed has the ability to "cut" and paste mesh "face", so you can separate parts that is on same material.

    How to do it:
    Open the object as item (via "Import" from main menu, or "isolate object" from object property panel), then zoom in until you focus on the part that you want to "cut".

    Then hold down Ctrl, and drag left mouse button to draw a rectangle that highlights the part (as long as the rectangle touches even slightest of the face it will be cut) you want to cut, and then release mouse button, and it will pop a menu, from there choose: Faces > Cut.

    Now go to 3Dsimed main menu and click: File > New, which opens a new window(file), then press Ctrl + V to paste the face. Repeat this process until you have all faces cut and moved to this new window, then save both files. And now you have parts as separated objects.

    Note:
    Sometimes it is hard to cut only the faces you want, because there are other unwanted faces behind it. No worries, just cut and paste into new window, then from new window, cut those unwanted faces back to the original window.
    Also, sometimes when you cut a part, it does not disappear from original window, what you want to do is to click Undo button, then click Redo, and it will disappear correctly.
    Lastly, after Cut & Paste process, all affected mesh faces are actually "separated" (vertices), usually this doesn't cause any issue, and the only way to restore is by merging vertices in 3d software such as blender.
     
  3. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    926
    Likes Received:
    6,282
    How to snap selected road edge to nearby grass(or the opposite) without affecting grass edge position in Blender:

    1. Merge road & grass objects into one object. Or alternatively, in case you don't want merge road & grass, you can extract a copy of grass edge, and merge this grass edge object with road object.

    2. Select all the road edge vertices that you want to snap onto nearby grass edge, as pic shows:
    upload_2021-12-24_14-57-7.png

    3. Press "M", select By Distance, at lower left "Merge by Distance" box, check Unselected checkbox, then adjust Merge Distance until all edges snap onto grass edge. Done.
    upload_2021-12-24_15-4-38.png

    Note: This method will save a lot time from manually drag & snap, and will make sure the targeted edge is not affected/adjusted by merging.
     
    Last edited: Dec 24, 2021
  4. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    926
    Likes Received:
    6,282
    How to properly place mirror UV map & change mirror resolution for car:

    1. First need to determine view angle of the mirror. A good mirror.bmp with more grids will help determine the position better.

    2. Usually side mirror should have UV map located at the edge of center area, opposite to what may seems to be the logical Left & Right position (which are actually viewing the far side areas). Below illustration should help with understanding:
    upload_2021-12-24_15-30-7.png

    3. mirror resolution is controlled by mirror.bmp resolution, default size is 2048*128. To increase resolution simply by double or triple this size, but do note that this aspect ratio should not be changed, in order to avoid distortion. Attempt to correct view angle by changing aspect ratio to 4:3 (800x600 or 1024x768) is not recommended (as seen in some mod), which causes distortion on some part of mirror or in virtual mirror. The correct way is to properly position the UV map.

    Note: be aware that resolution and aspect ratio of virtual mirrors in DevMode is not affected by mirror.bmp, and should be tested in normal game to see if mirror is working ok, to avoid wasting time.
     
    Last edited: Dec 24, 2021
  5. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    926
    Likes Received:
    6,282
    How to add "sequenced animation" for IBL shaders:

    RF2's new IBL shaders has support for "sequenced animation", which a series of sequenced textures get played. However current Material Editor doesn't include options to enable and adjust this function.

    Here is a method to enable "sequenced animation" for IBL shaders by manually editing material JSON file.

    1. First, you will need to generate material JSON file using Material Editor. Once saved, exit to main screen of DEV mode.

    2. Open JSON file with notepad, find a line called "FrameCount":1,
    Note: there may be a few FrameCount lines, but each should be contained in their own section (inside brackets). You will need to find one of the section that also contains "Name":"albedoMap", it will looks like this:

    {
    "AnisoLevel":0,
    "ChromaColor":0,
    "Flags":[
    "CUBETF_AUTOMIPMAP",
    "CUBETF_TRILINEAR",
    "CUBETF_CHROMAKEY",
    "CUBETF_OWNEDBYMATERIAL",
    "CUBETF_NOZBUFFERREQUIRED"
    ],
    "FrameCount":1,
    "MipBias":0,
    "MipLevels":-1,
    "Name":"albedoMap",
    "ShaderPass":0,
    "ShadowMipBias":0,
    "StageType":"CUBETST_SRGB",
    "TexChannel":0,
    "Texture":"bird",
    "hasDefault":true,
    "inactive":false,
    "runtime":false
    },

    3. Now you need to add a few extra lines into above code, see colored code below:

    {
    "AnisoLevel":0,
    "ChromaColor":0,
    "Flags":[
    "CUBETF_AUTOMIPMAP",
    "CUBETF_TRILINEAR",
    "CUBETF_CHROMAKEY",
    "CUBETF_OWNEDBYMATERIAL",
    "CUBETF_NOZBUFFERREQUIRED"
    ],
    "FrameCount":14,
    "Method":"CUBETAM_CYCLE",
    "MipBias":0,
    "MipLevels":-1,
    "Name":"albedoMap",
    "Rate":6,
    "Sequence":[
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13
    ],

    "ShaderPass":0,
    "ShadowMipBias":0,
    "SkipFrame0":false,
    "StageType":"CUBETST_SRGB",
    "TexChannel":0,
    "Texture":"bird",
    "hasDefault":true,
    "inactive":false,
    "runtime":false
    },

    Explain:
    "FrameCount":14, is the total different amount sequenced textures, and this must set correctly, otherwise game crashes.

    "Method":"CUBETAM_CYCLE", is the type of animation, there are total 6 types (info extracted from UI file), which are Cycle,Pendulum,One Shot,Transient,Random,Manual. For normal looping animation, only Cycle is needed, which writes as CUBETAM_CYCLE.

    "Rate":6, is the update frequency (play speed), value 1 = 1 texture per second, value 2 = 2 texture per sec, value 0.5 = 1 texture per 2 seconds.

    "Sequence":[ is a list of texture frame index that plays in listed order, value 0 means texture name + 00. In this case, 0 = bird00.dds, and 5 = bird05.dds, etc. You can add as many sequence as you want, but all frame index must have its corresponding texture. Note that last line of number does not have a comma. (JSON file must be written with correct format)

    "SkipFrame0":false,
    this line determines whether skip frame 0, and must be added to JSON, otherwise game crashes. If you set this value to true, it will skip bird00.dds in this case.

    "Texture":"bird", is the prefix of sequenced textures, in this case, all your textures will be named as bird00.dds bird01.dds bird02.dds , etc.

    Once added those lines, and have done preparing textures with correct names, it should work in game. If it doesn't, check JSON format for possible typing error or missing lines. This method is only a temporally workaround until 397 would add "sequenced animation" options to Material Editor.

    Note that I have also highlighted a line called "CUBETF_CHROMAKEY", this line is used to add "alpha chroma blending" transparency to material. If you don't need transparency, then you can safely remove this line.

    Also note that you can add sequenced animation to other material, such as normal map for water animation (you will add all those lines into sections that contains "Name":"normalMap",)

    One more note, currently for JSON file with sequenced animation, material editor can not edit them, if you change anything with material editor, those animation codes may be lost.

    ---------------------------

    How to add Doubleside property to IBL shaders:

    In old shaders, there is an property to turn a single side face object as Doubleside. For new IBL shaders, you can do this by manually add "CUBEMAT_TWOSIDED", line in the beginning of JSON file's "flags" section, such as:

    {
    "dstBlend":"CUBEAB_ZERO",
    "flags":[
    "CUBEMAT_AMBIENTMAT",
    "CUBEMAT_TWOSIDED",
    "CUBEMAT_DIFFUSEMAT",
    "CUBEMAT_SPECLARDIR",
    "CUBEMAT_EMISSIVMAT",
    "CUBEMAT_EMISSIVDIR"
    ],
     
    Last edited: Dec 24, 2021
  6. Alex Sawczuk

    Alex Sawczuk Administrator Staff Member

    Joined:
    Oct 4, 2010
    Messages:
    851
    Likes Received:
    971
    Two sided is not recommended as you will not get accurate normals on the reverse faces. Just duplicate and flip your faces, modern hardware can manage the triangles no problem.

    Also it would be better to merge your grass edge to the road rather than the other way around. At least you would not expect the Z axis of the road to be so noisy at the edge.
     
  7. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    926
    Likes Received:
    6,282
    How to create & adjust high quality RF2's image based FONT for car dashboard (or ingame HUD):

    1. RF2's image FONT supports BMP, TGA, and DDS format. Older mods usually use a special BMP format that contains transparent info. However it is not possible to retain this transparent info while editing and saving BMP in GIMP, so it is best to edit or create new FONT with TGA format (and TGA has far better transparency support).

    Note: while saving TGA format through GIMP, make sure you have unchecked RLE compression checkbox, otherwise it may not work. Also need to edit cockpitinfo.ini and change each Font= section with correct .tga file extension.

    2. FONT image consists many grids, usually draw with blue lines, each grid represent a single character. Unused character grids can be left empty so they won't show anything.

    3. Characters boundary and text alignment are controlled by a single dot pixel at the top of the frame, usually purple color. The dot of the first grid controls how text will align, you may have to do some testing to find best position (dot at left side = left align, right side = right align, and in the middle you can tweak center align).
    Also, there must be a single pixel dot at the bottom of last grid, otherwise text alignment will fail to work (and possibly other unwanted results), as below pics show:

    upload_2021-12-25_11-2-48.png
    upload_2021-12-25_11-12-0.png

    4. FONT image does not require to have full character grids drawn on the image.

    For example, a full grids set is usually 10*22 characters, which half of them are special characters. But if you don't need those special characters, you can remove those rows (such as 10*11 grids, by adjusting canvas size in GIMP), then make sure you add a single pixel dot at the bottom of last grid.

    However, using half grids is highly not recommended for car dashboard! Because half grids FONT image will cause render artifacts on car's dashboard, which you will see a thin black edge line flashing at the edge of FONT. As far as I know, this issue can only be solved by using a full grids FONT image. Ingame HUD can still use half grids FONT image without this problem.

    5. Ingame FONT image resolution is controlled by 2 factors: one is the FONT image size; one is the render target BKG image size (uses TGA format as well, and can be totally transparent). And this BKG image size is the more important factor. If the BKG image size is small, even with a high resolution FONT image, it will still be rendered as lower resolution in game.
     
    Last edited: Dec 25, 2021
  8. mantasisg

    mantasisg Registered

    Joined:
    Aug 17, 2016
    Messages:
    2,926
    Likes Received:
    3,876
    This is amazing, @svictor. I have no other choice, but start trying all your information in practice. So much to learn from you.

    Thank you !
     
    svictor, Emery, atomed and 2 others like this.
  9. EmperorOfFinland

    EmperorOfFinland Registered

    Joined:
    Jan 26, 2021
    Messages:
    501
    Likes Received:
    1,098
    Nice now we have everything we need to make mods in a good way i finally figured out how to make the merge by distance from this guide so i can finish up the meshmerging of sergio loros eläintarharata conversion much faster than manually merging the vertices.

    I hope we see some AI upscaling texture tutorials soonish and how to use awesomebump so i can get into work improving the textures on the F1 1982 League Edition.

    So there is alot to learn and this will lead into better modding techniques being available for more people so the quality of the mods should also improve as a result.

    Thank you for the guide svictor :D
     
  10. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
  11. bears

    bears Registered

    Joined:
    Apr 4, 2015
    Messages:
    806
    Likes Received:
    3,094
    Amazing stuff mate… the way you share your knowledge so freely is just brilliant :)
     
    Bostrom likes this.
  12. Wizzo58

    Wizzo58 Registered

    Joined:
    Apr 15, 2022
    Messages:
    40
    Likes Received:
    23
     
  13. davehenrie

    davehenrie Registered

    Joined:
    Jul 6, 2016
    Messages:
    7,454
    Likes Received:
    4,369
    I read through some of this, but I didn't see the numbers inside the lines so I don't know which of my 64 colors I can use.....
     
  14. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    926
    Likes Received:
    6,282
    Can you post your json code here, it will help identify the issues.
     
  15. Wizzo58

    Wizzo58 Registered

    Joined:
    Apr 15, 2022
    Messages:
    40
    Likes Received:
    23
    Here it is, Thanks
    The thing is I read somewhere in the dev guide that anything created using Dx9 will work with Dx11. The water plane and the heli rotor stopped working with the recent new updates, but still works with the old dx9 viewer.
    {
    "dstBlend" : "CUBEAB_INVSRCALPHA",
    "flags" : [ "CUBEMAT_ALPHACHANNEL", "CUBEMAT_AMBIENTMAT", "CUBEMAT_DIFFUSEMAT", "CUBEMAT_SPECLARDIR", "CUBEMAT_EMISSIVMAT", "CUBEMAT_EMISSIVDIR" ],
    "name" : "HELIROT",
    "parameters" : {
    "StandardInfo" : {
    "ambientColour" : [ 1, 1, 1, 0 ],
    "blendPercent" : 0,
    "bumpScale" : 0,
    "cubeMapFresnel" : {
    "Exp" : 5,
    "Max" : 0.9,
    "Min" : 0.1
    },
    "diffuseColour" : [ 1, 1, 1, 1 ],
    "emissiveColour" : [ 0, 0, 0, 0 ],
    "refEnhance" : 0,
    "specFresnel" : {
    "Exp" : 5,
    "Max" : 0.9,
    "Min" : 0.1
    },
    "specPower" : 1,
    "specularColour" : [ 0, 0, 0, 0 ]
    }
    },
    "preprocessorFlags" : {
    "NOALBEDOCORRECT" : "@Undef"
    },
    "refName" : "",
    "shader" : "L2SPECULART0",
    "sortOffset" : 0,
    "srcBlend" : "CUBEAB_SRCALPHA",
    {
    "AnisoLevel" : 0,
    "ChromaColor" : 0,
    "Flags" : [ "CUBETF_AUTOMIPMAP", "CUBETF_TRILINEAR", "CUBETF_CHROMAKEY", "CUBETF_OWNEDBYMATERIAL", "CUBETF_NOZBUFFERREQUIRED" ],
    "FrameCount" : 6,
    "Method":"CUBETAM_CYCLE",
    "Rate":6,
    "Sequence":[0,1,2,3,4,5],
    "SkipFrame0":true,
    "MipBias" : 0,
    "MipLevels" : -1,
    "Name" : "HELIROT00",
    "ShaderPass" : 0,
    "ShadowMipBias" : 0,
    "StageType" : "CUBETST_SRGB",
    "TexChannel" : 0,
    "Texture":"heli_rot00",
    "hasDefault" : true,
    "inactive" : false,
    "runtime" : false
    } ]
    }
     
    Last edited: May 10, 2022
  16. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    926
    Likes Received:
    6,282
    I see you are not using IBL shader, and if you don't use IBL shader, it is pointless to use JSON file for animation, as old way of setting for old shader still works.

    Here is a IBL shader based Json file example (alpha chroma):
    Code:
    {
      "dstBlend":"CUBEAB_ZERO",
      "flags":[
        "CUBEMAT_AMBIENTMAT",
        "CUBEMAT_DIFFUSEMAT",
        "CUBEMAT_SPECLARDIR",
        "CUBEMAT_EMISSIVMAT",
        "CUBEMAT_EMISSIVDIR"
      ],
      "name":"BIRDS",
      "parameters":{
        "StandardInfo":{
          "ambientColour":[
            1,
            1,
            1,
            1
          ],
          "blendPercent":0,
          "bumpScale":1,
          "cubeMapFresnel":{
            "Exp":4,
            "Max":1,
            "Min":0
          },
          "diffuseColour":[
            1,
            1,
            1,
            1
          ],
          "emissiveColour":[
            0,
            0,
            0,
            1
          ],
          "refEnhance":0,
          "specFresnel":{
            "Exp":4,
            "Max":1,
            "Min":0
          },
          "specPower":1,
          "specularColour":[
            1,
            1,
            1,
            1
          ]
        },
        "cbParameters":{
          "Base_Material":{
            "AO":1,
            "Metallic":0.5,
            "Roughness":0.5,
            "Specular":1
          },
          "Material_Adjust":{
            "AlbedoTint":[
              1,
              1,
              1,
              1
            ],
            "Metallic":0.5,
            "NormalIntensity":1,
            "NormalShadowInfluence":0.5,
            "Roughness":0.5,
            "Specular":1
          },
          "UV_Scale":{
            "Albedo":[
              1,
              1
            ]
          }
        }
      },
      "preprocessorFlags":{
        "ALBEDOMAP":"@Null",
        "ALBEDOUV":"UV_A",
        "AOSPECALTMAP":"@Undef",
        "AOSPECALTUV":"UV_A",
        "AOSPECMAP":"@Undef",
        "AOSPECUV":"UV_C",
        "BILLBOARD":"@Undef",
        "DETAILALBEDO":"@Null",
        "DETAILALBEDOBLEND":"@Undef",
        "DETAILAO":"@Undef",
        "DETAILMAP":"@Undef",
        "DETAILMETALLIC":"@Undef",
        "DETAILNORMAL":"@Undef",
        "DETAILROUGHNESS":"@Undef",
        "DETAILSPEC":"@Undef",
        "DETAILUV":"UV_B",
        "EMISSIVEMAP":"@Undef",
        "EMISSIVEMODE":"@Undef",
        "EMISSIVEUV":"UV_C",
        "METALLICROUGHNESSMAP":"@Undef",
        "METALROUGHUV":"UV_A",
        "NORMALMAP":"@Undef",
        "NORMALUV":"UV_A",
        "RETROREFLECTOR":"@Undef",
        "TRANSLUCENCY":"@Undef",
        "TRANSLUCENCYALBEDO":"@Undef",
        "VERTEXALPHA":"@Undef",
        "VERTEXCOLOR":"@Undef"
      },
      "refName":"",
      "shader":"L2IBLSTANDARD",
      "sortOffset":0,
      "srcBlend":"CUBEAB_ONE",
      "textures":[
        {
          "AnisoLevel":0,
          "ChromaColor":0,
          "Flags":[
            "CUBETF_AUTOMIPMAP",
            "CUBETF_TRILINEAR",
            "CUBETF_CHROMAKEY",
            "CUBETF_OWNEDBYMATERIAL",
            "CUBETF_NOZBUFFERREQUIRED"
          ],
          "FrameCount":14,
          "Method":"CUBETAM_CYCLE",
          "MipBias":0,
          "MipLevels":1,
          "Name":"albedoMap",
          "Rate":6,
          "Sequence":[
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13
          ],
          "ShaderPass":0,
          "ShadowMipBias":0,
          "SkipFrame0":false,
          "StageType":"CUBETST_SRGB",
          "TexChannel":0,
          "Texture":"BIRDS",
          "hasDefault":true,
          "inactive":false,
          "runtime":false
        }
      ]
    }
    And this is lake(water) example using Src alpha (alpha blending transparency):
    Code:
    {
      "dstBlend":"CUBEAB_INVSRCALPHA",
      "flags":[
        "CUBEMAT_ALPHACHANNEL",
        "CUBEMAT_SPECULAR",
        "CUBEMAT_AMBIENTMAT",
        "CUBEMAT_DIFFUSEMAT",
        "CUBEMAT_SPECLARDIR",
        "CUBEMAT_EMISSIVMAT",
        "CUBEMAT_EMISSIVDIR"
      ],
      "name":"LAKE",
      "parameters":{
        "StandardInfo":{
          "ambientColour":[
            1,
            1,
            1,
            1
          ],
          "blendPercent":0,
          "bumpScale":1,
          "cubeMapFresnel":{
            "Exp":4,
            "Max":1,
            "Min":0
          },
          "diffuseColour":[
            1,
            1,
            1,
            1
          ],
          "emissiveColour":[
            0,
            0,
            0,
            1
          ],
          "refEnhance":0,
          "specFresnel":{
            "Exp":4,
            "Max":1,
            "Min":0
          },
          "specPower":1,
          "specularColour":[
            1,
            1,
            1,
            1
          ]
        },
        "cbParameters":{
          "Base_Material":{
            "AO":1,
            "Metallic":0,
            "Roughness":0,
            "Specular":1
          },
          "Material_Adjust":{
            "AlbedoTint":[
              0.792157,
              0.894118,
              0.956863,
              1
            ],
            "Metallic":0.5,
            "NormalIntensity":1,
            "NormalShadowInfluence":0.5,
            "Roughness":0,
            "Specular":1
          },
          "UV_Scale":{
            "Albedo":[
              1,
              1
            ],
            "Normal":[
              8,
              4
            ]
          }
        }
      },
      "preprocessorFlags":{
        "ALBEDOMAP":"@Null",
        "ALBEDOUV":"UV_A",
        "AOSPECALTMAP":"@Undef",
        "AOSPECALTUV":"UV_A",
        "AOSPECMAP":"@Undef",
        "AOSPECUV":"UV_C",
        "BILLBOARD":"@Undef",
        "DETAILALBEDO":"@Null",
        "DETAILALBEDOBLEND":"@Undef",
        "DETAILAO":"@Undef",
        "DETAILMAP":"@Undef",
        "DETAILMETALLIC":"@Undef",
        "DETAILNORMAL":"@Undef",
        "DETAILROUGHNESS":"@Undef",
        "DETAILSPEC":"@Undef",
        "DETAILUV":"UV_B",
        "EMISSIVEMAP":"@Undef",
        "EMISSIVEMODE":"@Undef",
        "EMISSIVEUV":"UV_C",
        "METALLICROUGHNESSMAP":"@Undef",
        "METALROUGHUV":"UV_A",
        "NORMALMAP":"@Null",
        "NORMALUV":"UV_A",
        "RETROREFLECTOR":"@Undef",
        "ROUGHNESSALBEDOALPHA":"@Undef",
        "TRANSLUCENCY":"@Undef",
        "TRANSLUCENCYALBEDO":"@Undef",
        "VERTEXALPHA":"@Undef",
        "VERTEXCOLOR":"@Undef"
      },
      "refName":"STATIC01",
      "shader":"L2IBLSTANDARD",
      "sortOffset":0,
      "srcBlend":"CUBEAB_SRCALPHA",
      "textures":[
        {
          "AnisoLevel":0,
          "ChromaColor":0,
          "Flags":[
            "CUBETF_AUTOMIPMAP",
            "CUBETF_TRILINEAR",
            "CUBETF_OWNEDBYMATERIAL",
            "CUBETF_NOZBUFFERREQUIRED"
          ],
          "FrameCount":1,
          "MipBias":0,
          "MipLevels":1,
          "Name":"albedoMap",
          "ShaderPass":0,
          "ShadowMipBias":0,
          "StageType":"CUBETST_SRGB",
          "TexChannel":0,
          "Texture":"lake",
          "hasDefault":true,
          "inactive":false,
          "runtime":false
        },
        {
          "AnisoLevel":0,
          "ChromaColor":0,
          "Flags":[
            "CUBETF_AUTOMIPMAP",
            "CUBETF_TRILINEAR",
            "CUBETF_OWNEDBYMATERIAL",
            "CUBETF_NOZBUFFERREQUIRED"
          ],
          "FrameCount":60,
          "Method":"CUBETAM_CYCLE",
          "MipBias":0,
          "MipLevels":1,
          "Name":"normalMap",
          "Rate":6,
          "Sequence":[
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26,
            27,
            28,
            29,
            30,
            31,
            32,
            33,
            34,
            35,
            36,
            37,
            38,
            39,
            40,
            41,
            42,
            43,
            44,
            45,
            46,
            47,
            48,
            49,
            50,
            51,
            52,
            53,
            54,
            55,
            56,
            57,
            58,
            59
          ],
          "ShaderPass":0,
          "ShadowMipBias":0,
          "SkipFrame0":false,
          "StageType":"CUBETST_LINEAR",
          "TexChannel":4,
          "Texture":"lake_nm",
          "hasDefault":true,
          "inactive":false,
          "runtime":false
        }
      ]
    }
     
  17. Wizzo58

    Wizzo58 Registered

    Joined:
    Apr 15, 2022
    Messages:
    40
    Likes Received:
    23

    Okay Thanks for that.
    Which IBL shader should I use, IBL Standard shader ?
     
  18. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    926
    Likes Received:
    6,282
    The json code I posted uses IBL Standard shader (you can find line says "shader":"L2IBLSTANDARD"). Normally IBL Standard should be enough.

    If you are going to adjust material setting further in materialeditor, do note that once any value has changed in materialeditor, the animation will stop playing. But dont worry, animation won't be lost, once you have saved changes to json, and Reloading track, animation will work again.
    (in short, editing material that contains animation in materialeditor will stop it from playing, only resume playing after reloading the track again)
     
    Last edited: May 10, 2022
  19. Wizzo58

    Wizzo58 Registered

    Joined:
    Apr 15, 2022
    Messages:
    40
    Likes Received:
    23
    Okay thank you.

    So in Max I don't have to worry about setting up the animation?

    Let me know if this is the right procedure;

    In Max 2017
    - use the IBL standard shader
    - open the DX11 viewer
    - open the web material editor
    - create a json file
    - Edit the json file by adding your code
    - Close and open the viewer and check the result
     
  20. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    926
    Likes Received:
    6,282
    You should follow the original post procedure, as it already described with all things need to know: https://forum.studio-397.com/index....-opensource-free-software.70938/#post-1085292

    The code I posted earlier are just for example, and still requires to edit some of the value if you want to copy and use the code(such as to change material name & texture name & number of sequence & material values, etc).

    It should also work without JSON file (at least tyre animation can work without JSON). For example in 3dsimed (should be similar in Max), assign IBL standard shader and textures to each correct channel with animation sequences, which almost same as the old shader (only difference is that, unused channel has to be filled with placeholder texture, such as those started with _DEFTEX_ prefix, can't remember all).
     

Share This Page