Need help on analog gauge

Discussion in 'Car Modding' started by ThomasJohansen, Apr 28, 2023.

  1. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    951
    Likes Received:
    2,188
    I have a gmt where analog gauge works, but when I try to alter shader with moddev the needle disappears. The material.json ruins it.

    To change shader, I then have to setup material again in 3dsmax, and reassign to mesh export to gmt etc.
    Made a multisub, added a gmat T1 with texture target true. used same dash background TGA, uvmap is fine.
    Assign it to mesh this case mat id2.

    cockpitinfo left untouched since it worked before:
    test in moddev, I can see background TGA but not needle.

    then tried to make another mesh for the needle map etc but that doesnt work either.
    Doesnt expect the needle to fit first time but atleast be present.

    The tga maps for both speedo and needle are the ones that work in the gmt file.

    What am I missing here?
    Udklip.PNG
     
  2. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    3,999
    Likes Received:
    2,873
    @ThomasJohansen The Needle is always a Map only, no Mesh.
    And the Material must use "Render to Target" to get it working.
    I did read something about it in an official Update List, that the Dashboard Element Shader, that we did use for Gauges, gets replaced by a new IBL Shader automatically now.
    But take that without any Guarantee, i may be wrong and i haven't tested it yet.
    What happens when you use the Dashboard Elements Shader, with the "Render to Target" Tag without a Material JSON?
    Does that work?
    And did you check, if the Material JSON, that "corrupts" the Functionality, uses something like "Render to Target" too?
    BTW In a Mod, for that another User asked me for Help, i had to use dds Textures for the Needles, to get them working, what was a bit strange.
    Unfortunately seem to affect some new Features/Functionalities, Things that worked since Years in a bad Way.
    And sometimes it's simply the Fact, that some official Information, about how to use New Features, is missing too.

    And ensure, that you don't use 2 Meshes with the same Material, but different Material Settings, if you don't use a Material.JSON.

    EDIT And if you can not get it working at all, send me the Mesh, and all used Textures to:
    chris_rf2onlXXoddXXgmx.de, where XXoddXX = @ of course. ;)
     
    Last edited: Apr 29, 2023
  3. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    951
    Likes Received:
    2,188
    @redapg once again thx for the offer. I gave it one more try - new day clear head. Deleted my needle mesh. tried the T1 shader. Deactived the old "working" gauge gmt in the gen file to not have same material assigned to two meshes as you adviced. And BAM it worked with the T1 shader.
    Funny thing as soon I try to correct something with the material editor in moddev it breaks the shader. So have to finetune it from 3dsmax. Trying to get a "glass" effect on top of it, and some shadow dept.

    20230429100654_1.jpg
     
    Last edited: Apr 29, 2023
    Mauro and redapg like this.
  4. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    3,999
    Likes Received:
    2,873
    @ThomasJohansen As said, i didn't tested it yet, but when you use a Material JSON with a IBL Shader for Example, does it have a "Render to Target" Entry?
    Or do you see a specific IBL-Gauges Shader in the Web based Material Editor List?
     
  5. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    951
    Likes Received:
    2,188
    I cant find "render to target" or any similar in the material.json. so yes I would guess it's missing.
    Code:
    "textures":[
        {
          "AnisoLevel":0,
          "ChromaColor":0,
          "Flags":[
            "CUBETF_OWNEDBYMATERIAL"
          ],
          "FrameCount":1,
          "MipBias":0,
          "MipLevels":1,
          "Name":"albedoMap",
          "ShaderPass":0,
          "ShadowMipBias":0,
          "StageType":"CUBETST_SRGB",
          "TexChannel":0,
          "Texture":"GORD_SPEEDO_COCKPIT",
          "hasDefault":true,
          "inactive":false,
          "runtime":false
        }
      ]
     
     
  6. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    3,999
    Likes Received:
    2,873
    Maybe it works with an IBL Shader, when you use the Entry
    "CUBETF_RENDERTARGET",
    in the "textures":[ Section, that it looks like that in your Example:

    "textures":[
    {
    "AnisoLevel":0,
    "ChromaColor":0,
    "Flags":[
    "CUBETF_OWNEDBYMATERIAL"
    "CUBETF_RENDERTARGET",
    ],
     
    ThomasJohansen likes this.
  7. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    951
    Likes Received:
    2,188
    @redapg

    just tried it, but didnt work
    Udklip2.PNG
     
    redapg likes this.
  8. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    3,999
    Likes Received:
    2,873
  9. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    3,999
    Likes Received:
    2,873
    @ThomasJohansen I get it working with the IBL Standard Shader.
    Thy this:
    Set up the Material in the Web based Material Editor, save the JSON and leave the DevMode.
    Open the JSON and go to the Section where your tga File is defined (it must be tga, to get the Render to Texture working (at least that is how it had to be in the Past))
    I have tested with the Skip Barber and my Section looks like this:
    {
    "AnisoLevel":0,
    "ChromaColor":0,
    "Flags":[
    "CUBETF_OWNEDBYMATERIAL"
    ],
    "FrameCount":1,
    "MipBias":0,
    "MipLevels":1,
    "Name":"albedoMap",
    "ShaderPass":0,
    "ShadowMipBias":0,
    "StageType":"CUBETST_SRGB",
    "TexChannel":0,
    "Texture":"RTER_RPM.tga",
    "hasDefault":true,
    "inactive":false,
    "runtime":false
    },

    Now add the Line "CUBETF_RENDERTARGET" to the Flags Section, that it looks like this:
    {
    "AnisoLevel":0,
    "ChromaColor":0,
    "Flags":[
    "CUBETF_OWNEDBYMATERIAL"
    ,
    "CUBETF_RENDERTARGET"

    ],
    "FrameCount":1,
    "MipBias":0,
    "MipLevels":1,
    "Name":"albedoMap",
    "ShaderPass":0,
    "ShadowMipBias":0,
    "StageType":"CUBETST_SRGB",
    "TexChannel":0,
    "Texture":"RTER_RPM.tga",
    "hasDefault":true,
    "inactive":false,
    "runtime":false
    },

    Save the JSON and try it out.
     
  10. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    951
    Likes Received:
    2,188
    weird, mine is completely identical.
    The only thing different is that the filename is without ".TGA", but it could find background anyway.

    As a sitenote, since this, I have changed background and needle to DDS, it works too. Also L2IBLSTANDARD.

    Just as long I dont touch it in moddev it works.

    Reason I tried to change it to dds was to add better shadow to needle.
    Well lets leave it at that, I just wont touch it in moddev.
     
  11. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    3,999
    Likes Received:
    2,873
    The "Problem", as said, is, that you have to use a tga File to get "Render to Texture" working for the Needle.
    You can check it in 3DSMax.
    Check "Render to Texture" for a DDS File and you will get an Error Message.
     
  12. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    951
    Likes Received:
    2,188
    the problem was there with TGA, and identical json as yours.
    After that, I gave up on using moddev to fine tune these, I then last night, tried with dds, since I tried to get good shadows on my needle, and i have better control with dds than tga, and it worked using dds instead of tga (still not in with moddev), just wanted to let you know that.

    Thank you for your effort
     
    Last edited: May 1, 2023

Share This Page