Need help to make transparent parts of textures

Discussion in 'Track Modding' started by trollray, Aug 6, 2021.

  1. trollray

    trollray Registered

    Joined:
    Jun 13, 2011
    Messages:
    494
    Likes Received:
    1,875
    Hi all.
    I've searh on this forum but no luck since now.
    Here is my problem:
    I'm converting a track to use pbr shaders, but when i have some textures (foliage and a barrier for example ) with transparent parts it goes black when passing in ibl shader (Normal or vegetation, nothing work)
    Th estrange thing is that, when i use json and revert back to original shader, my texture still show the transparent parts in black.
    The only solution is to delete the json in fact.

    - What's not working?
    - How to make it to work?

    Many thanks in advance for any help given. ;)

    (ps :I only use 3dsimed, gimp and substance designer )
    Cheers
     
  2. trollray

    trollray Registered

    Joined:
    Jun 13, 2011
    Messages:
    494
    Likes Received:
    1,875
    No answer? maybe it's my post that is transparent lol ;)
     
  3. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    3,959
    Likes Received:
    2,809
    If you upload a Mesh with that it happens, with all used Textures and the JSON File with that the Transparency gets lost and send me the Link by a private Conversation, i can take a Look at it.
     
    Corti likes this.
  4. TTM

    TTM Registered

    Joined:
    Dec 20, 2012
    Messages:
    68
    Likes Received:
    34
    Hopefully this helps. Alex mentioned this on discord....

    Check from material json that albedo map has a texture flag of "CUBETF_CHROMAKEY". If not, just manually add it.

    ...
    "refName":"",
    "shader":"L2IBLSTANDARD",
    "sortOffset":0,
    "srcBlend":"CUBEAB_ONE",
    "textures":[
    {
    "AnisoLevel":0,
    "ChromaColor":0,
    "Flags":[
    "CUBETF_AUTOMIPMAP",
    "CUBETF_TRILINEAR",
    "CUBETF_CHROMAKEY",
    "CUBETF_OWNEDBYMATERIAL",
    "CUBETF_NOZBUFFERREQUIRED"
    ...
     
    Corti and redapg like this.
  5. trollray

    trollray Registered

    Joined:
    Jun 13, 2011
    Messages:
    494
    Likes Received:
    1,875
    Hey, @redapg and @TTM ,so many thanks for the help.

    The solution from TTM is working!!
    I still don't understand how Alex found this and how it works, for me it's far out of my capabilities but it's working now. Thanks so much. ;)
    Cheers
     
    Corti, redapg and TTM like this.
  6. TTM

    TTM Registered

    Joined:
    Dec 20, 2012
    Messages:
    68
    Likes Received:
    34
    It seems that sometimes material editor not save all necessary information to material json file. I also had same transparency problem with tree material, but luckily Alex wrote about this on discord when someone else had same problem.
     
    Last edited: Aug 9, 2021
  7. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    3,959
    Likes Received:
    2,809
    I can confirm that.
    A longer While ago, i did have the same Problem with a Video Screen Material, where the deciding Entries/Values, to get it working, were not saved into the JSON File, when the Web-Browser Material Editor was used.
    Such Things should be fixed immediately, but unfortunately still exist as it seems.
     
  8. Alex Sawczuk

    Alex Sawczuk Administrator Staff Member

    Joined:
    Oct 4, 2010
    Messages:
    851
    Likes Received:
    971
    If you have problems saving transparency for now you just need to save the settings manually by editing the json file when you do not have the track loaded.

    You can enable Alpha Test by adding "CUBETF_CHROMAKEY" flag to the albedo texture.

    You can enable Alpha Blend by setting
    "dstBlend":"CUBEAB_INVSRCALPHA"
    "srcBlend":"CUBEAB_SRCALPHA"
    and adding "CUBEMAT_ALPHACHANNEL" to the Material Flags

    I've attached examples.

    I know it should be possible to set it in the editor, but it's not right now, sorry.
     

    Attached Files:

    Corti likes this.
  9. Alex Sawczuk

    Alex Sawczuk Administrator Staff Member

    Joined:
    Oct 4, 2010
    Messages:
    851
    Likes Received:
    971
    TTM, Mitch9 and Corti like this.

Share This Page