Windscreen Shader issue

Discussion in 'Car Modding' started by DiggerHawk, Jul 26, 2023.

  1. DiggerHawk

    DiggerHawk Registered

    Joined:
    Jul 29, 2020
    Messages:
    250
    Likes Received:
    315
    Does anybody know how to fix this issue with shadows seemingly appearing in front of the windscreen edge?

    I am using the outside windscreen shader with rain effects. The model is 3d as in not just a single face, it has a front and back with a top and bottom. The texture transparency is controlled using its alpha channel.

    Windcreen_issue.jpg

    I seem to remember reading that the issue is with how the transparencies (windscreen and shadow) are ordered in the view. I am using a json override for the material but I couldn't find any where this is set.

    Mark
     
  2. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    956
    Likes Received:
    2,192
    have you though of giving the edge of the windscreen another material? normally those are sanded glass edges.
     
  3. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,025
    Likes Received:
    2,883
    @DiggerHawk Set the Alpha Sort Value to 7 for the inner Part of the Windscreen Material.
    If the whole Mesh has the same Material, set it to 7 too.
     
  4. DiggerHawk

    DiggerHawk Registered

    Joined:
    Jul 29, 2020
    Messages:
    250
    Likes Received:
    315
    Thanks Thomas for your suggestion, that was my plan if I couldn't find another way.
     
    Last edited: Jul 26, 2023
  5. DiggerHawk

    DiggerHawk Registered

    Joined:
    Jul 29, 2020
    Messages:
    250
    Likes Received:
    315
    Thank you for your help.

    Is it this part of the Json?

    },
    "refName":"REFMAP0",
    "shader":"L2WINDSCREENOUTSIDE",
    "sortOffset":7,
    "srcBlend":"CUBEAB_SRCALPHA",
    "textures":[

    I tried it and it appears to work with 7.

    Just out of curiosity, why is 7 the magic number? What would 6 or 8 do?
     
    ThomasJohansen likes this.
  6. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,025
    Likes Received:
    2,883
    @DiggerHawk Yes, that is the correct Entry in the JSON.
    The Numbers 5-8 are used for Cars, 1-4 are for Tracks.
    8 has the highest Priority.
    We (SMMG) usually take 7 for Cockpit Windows and 6 for Outside View Windows, so that you always have the Cockpit Window in Front.
    But sometimes you have to Test it, because Things like Shadows, Rain, Dust... have to be visible, but behind of the Window.
    If i remember it right, we use 7 as highest Number for Cars, because we did have Problems with Rain and Dust in the Past, when we used 8 for Cockpit Windows.
     
    Emery, ThomasJohansen and DiggerHawk like this.
  7. DiggerHawk

    DiggerHawk Registered

    Joined:
    Jul 29, 2020
    Messages:
    250
    Likes Received:
    315
    Thank you for the solution and information. I looked through the Json files looking for something that sounded like it would do the trick but I swear there wasn't anything I could see. That was until you came to the rescue.
    I will edit all the visor materials for all the chassis when I next have a modding session, appose to a racing session.
     
    ThomasJohansen and redapg like this.

Share This Page