Windshield letting rain through when using ksWindscreen shader

Discussion in 'Car Models | Physics' started by Graham, Sep 4, 2022.

  1. Graham

    Graham New Member

    Joined:
    Sep 4, 2022
    Messages:
    8
    Likes Received:
    1
    Hi all. I have the following problem.

    Currently I'm messing about with the RTM Oreca07 to learn about how the car models work and to fix it for myself to manage my OCD tendencies. I found that the windshield did not show any raindrops on it, although the side windows did. The weird thing was that the same shader was used and the objects seem to be linked somehow. I then created some internal windows and flipped their normals as per a tutorial that I have as well as added the required fields to the extension.ini for the wipers and windshield so that the wipers will wipe the rain off the glass. The shader was not ksWindscreen, so when I changed the shader to ksWindscreen as it is supposed to be, the rain appeared as it should and the wipers worked as expected. The odd thing I have now is that the raindrops also fall through the windshield onto the dashboard and then flows about as if it was an external surface. Note that the rain also falls and flows on the windscreen as it is supposed to.

    I've updated all my old URD mods using blender and changed the shaders in ksEditor to ksWindscreen without any problems so far. Perhaps it has something todo with the fbx persistence file or is there somewhere where one can adjust material properties for the windscreen and side windows? Previously I only had to change the shader in ksEditor and it worked perfectly.

    I could really use some advise and guidance.

    Thanks in advance.

    PS. This also happens when I replace the shader via the extension.ini file.
     
  2. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,117
    Likes Received:
    379
    dont put the windscreen mesh under any node, ie cockpit, it must be in the root of the car hierarchy, if its a door window, it must be in the root of the door empty
     
  3. Graham

    Graham New Member

    Joined:
    Sep 4, 2022
    Messages:
    8
    Likes Received:
    1
    Thank you so much, I will give that a try. The 3d model does not have separate doors with empties. Should I separate them and add an empty in for them? Another thing that is happening, is that the window objects go completely transparent when changing the shader to ksWindscreen and does not change back when using ksPerPixedreflection that was previously used. Any advice?
     
  4. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,117
    Likes Received:
    379
    if you want to animate the doors, yes, then you must separate them, if you dont care, keep it
     
  5. Graham

    Graham New Member

    Joined:
    Sep 4, 2022
    Messages:
    8
    Likes Received:
    1
    Unfortunately I just can't seem to get this crap to work. I've got the windows in the root and the problem persists.
     
  6. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,117
    Likes Received:
    379
    you have two meshes w two materials?
    inside: ksWindscreen shader
    outside: ksPerPixelReflection
     
  7. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,117
    Likes Received:
    379
    upload_2022-9-5_18-53-17.png
     
    Fuzo likes this.
  8. Graham

    Graham New Member

    Joined:
    Sep 4, 2022
    Messages:
    8
    Likes Received:
    1
    I have two meshes, but the materials seem to be linked so when I change the shader for the material it changes for the internal and external meshes. I can re-create the internal windows meshes. Do I need to flip the normals when I do that and how do you separate the materials so that the objects truly are independent?
     
  9. Fuzo

    Fuzo Member

    Joined:
    May 24, 2018
    Messages:
    101
    Likes Received:
    18
    Location:
    Bydgoszcz, Poland
    you need 2 meshes, 2 materials (different names), external window normals should face outside, internal window inside and you need to set shaders for both correctly as @fughettaboutit mentioned in his post. and dont forget to use blending mode for both and assign both as transparent in material properties.
     
  10. Graham

    Graham New Member

    Joined:
    Sep 4, 2022
    Messages:
    8
    Likes Received:
    1
    Thank you, what is blending mode? Is that in ksEditor or Blender?
     
  11. Fuzo

    Fuzo Member

    Joined:
    May 24, 2018
    Messages:
    101
    Likes Received:
    18
    Location:
    Bydgoszcz, Poland
    in kseditor in the window where you are setting shader properties, there is one line named BlendMode, by default you will have eOpaque, you need to change it to AlphaBlend for windows, it will make the texture transparent, so obviously the texture needs to have proper alpha channel. Then you need to flag the material as transparent, so go down to the menu on the bottom, there is Object tab and there change isTransparent to true. And I suggest to open the modding pipeline in SDK directory, all this stuff is written there.
     
  12. Graham

    Graham New Member

    Joined:
    Sep 4, 2022
    Messages:
    8
    Likes Received:
    1

    Thank you so much. I will definitely give this a go.
     
    Fuzo likes this.
  13. Graham

    Graham New Member

    Joined:
    Sep 4, 2022
    Messages:
    8
    Likes Received:
    1
    I'm still doing something wrong. I re-created the meshes, then created a new material for them and also flipped the normals. I've also set the blend mode to AlphaBlend and checked that the glass texture has an aplha channel. Below on the right is the object hierarchy in Blender and the ksEditor properties on the right. I have the windows in their own collection related to an empty. The internal meshes are set to ksWindscreen with the correct blend mode, but the rain still comes through the windscreen and now also the side windows, where it was only the windscreen before... All the windows are flagged as transparent as well.

    upload_2022-9-6_19-53-7.png upload_2022-9-6_19-58-47.png
     
  14. Fuzo

    Fuzo Member

    Joined:
    May 24, 2018
    Messages:
    101
    Likes Received:
    18
    Location:
    Bydgoszcz, Poland
    did you create UV map for the mesh?
     
  15. Graham

    Graham New Member

    Joined:
    Sep 4, 2022
    Messages:
    8
    Likes Received:
    1
    Hi, I managed to get it sorted out last night. To be honest, I haven't got a clue what I did differently apart from starting from scratch with the original model and that's basically it. I didn't change the hierarchy of the window meshes and I didn't have to create a UV map. I believe the UV map can be quite a challenge. Thanks for the help and the advice, it definitely helped me in fixing the mod :) .
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice