Tunnel

Discussion in 'PC Editor Discussion' started by pilot21, Nov 16, 2023.

  1. pilot21

    pilot21 Well-Known Member

    Joined:
    Feb 28, 2023
    Messages:
    106
    Likes Received:
    478
    Hello, can somebody help me on making it darker inside the tunnels?
    I already know its done through light baking but i'm not quite sure how this is done inside the editor.
     
    • Like Like x 3
  2. jackthom

    jackthom Active Member

    Joined:
    Aug 22, 2020
    Messages:
    377
    Likes Received:
    186
    I’d also like some information on this. Building the lighting in my route may have helped a little.

    I did have to place a very large plane made from a flattened cube (with matt black applied to its faces just to be sure) over my tunnel to prevent sunlight somehow getting through into it.
    I’ve also just discovered how to cut a hole in a landscape so the design of the tunnel may change. At present it’s in a valley made by dipping the landscape and then placing various coverings over the tunnel which doesn’t look too good.
     
    Last edited: Nov 16, 2023
    • Like Like x 1
  3. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    278
    Likes Received:
    449
    I'm on my phone, away from my computer, but I believe either the track loft descriptor, track rules (or both,) have a checkbox for "track has tunnel," which the lighting engine might depend on, and an option to restrict the camera view. Otherwise, have you rebuilt the lighting? Haven't tried making a tunnel yet myself, just a station.

    edited to add: found it, it's in the track rules. Still not sure if it effects the lighting.
     
    Last edited: Nov 17, 2023
    • Like Like x 1
  4. pilot21

    pilot21 Well-Known Member

    Joined:
    Feb 28, 2023
    Messages:
    106
    Likes Received:
    478
    No the lighting is done by bake lighting. You put a lightmass importance volume into your scene, scale it and then you build your lighting and unreal is calculating the light inside this volume. On the dropdown menu of the build is also a tsw extension to build the lighting but when I do this and the normal build lighting method, the editor freezes after finishing the light calculation, so I assume there is a special volume by the tsw editor to calculate the light but I haven't found anything yet
     
    • Like Like x 1
  5. pilot21

    pilot21 Well-Known Member

    Joined:
    Feb 28, 2023
    Messages:
    106
    Likes Received:
    478
    Hello, i know this thread is quite old but i found a solution.

    1. Move your Tunnel Spline to the persistent level.
    2. Move all your Landscape and scenery tiles out of your tiles folder so you just have the Track Scenery tiles and the Track tiles. (If you dont do this, the scene is too complex and the light baking process crashes.)
    3. Cover your Tunnel with Lightmass importance volumes from the place actors tab, select all the levels in the world compositor where the tunnel is and open the dropdown menu next to build and select the first option build lighting for selected levels.
    4. In the place actors tab search for occlusion and cover your Tunnel with TS2Ambient Occlusion Volumes and tick Fog Occlusion (Local)
    5. Then close the editor, move your Landscape Tiles and Scenery tiles back into the project.

    tunnel2.PNG
     
    Last edited: May 8, 2024
    • Helpful Helpful x 4
  6. RobertSchulz

    RobertSchulz Well-Known Member

    Joined:
    Oct 10, 2023
    Messages:
    1,863
    Likes Received:
    2,609
    What I wonder is why light gets under the terrain at all?

    Because if you have a hill at the surface of the terrain, the elevation draws a shadow to the side opposed to the sun light source.

    Why is it that light is coming under the landscape then, if the terrain creates a shadow on itself when being above the surface?

    Or is there a way to make the landscape opaque for the lighting to shine through?

    BTW: I had the same issue as pilot21 for building the lighting. In my case the Editor freezes too. I guess I will try the way mentioned by him above to see if it works.
     
    Last edited: Feb 14, 2024
  7. jackthom

    jackthom Active Member

    Joined:
    Aug 22, 2020
    Messages:
    377
    Likes Received:
    186
    I don't know much at all about this lighting stuff.
    I'm still stuck with an eerie glow from the tracks in my tunnel which I'm guessing could easily be fixed, but as always I'm busy with working out how to carry out other tasks in the editor.

    Tunnel Light.jpg
     
    • Like Like x 1
  8. pilot21

    pilot21 Well-Known Member

    Joined:
    Feb 28, 2023
    Messages:
    106
    Likes Received:
    478
    Follow my tutorial from step 4. This fixes the exposure inside the tunnel.
     
    • Like Like x 1
    • Helpful Helpful x 1
  9. ffabio89

    ffabio89 Well-Known Member

    Joined:
    Aug 15, 2020
    Messages:
    270
    Likes Received:
    250
    Hi, i've got some problem with the 2nd step: Move all your Landscape and scenery tiles out of your tiles folder so you just have the Track Scenery tiles and the Track tiles.

    When I do it, firstly I haven't any tile where coocking light and secondly, when I'll put all back, I loosing all the terrain proprieties...
    What's I'm doing wrong?
     
  10. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    278
    Likes Received:
    449
    pilot21 I know this is an older thread, but I'm trying to tackle this exact problem, and if you have a spare moment, I had a couple of follow-up questions:

    Is step 1 really necessary for the lighting?

    In step 3, the lighting importance volume doesn't seem to be doing much to keep out this "ambient-ish" light in my tunnel, should I be seeing more of an effect at this point of the process? ScreenHunter_103 Apr. 20 19.43.jpg
    (That's after baking, and it's definitely not getting directly lit or anything. Do you think the lightness of the base texture in the material could be a factor?)

    in step 5, did you mean the Min EV100 is supposed to be 9.7? I'm thinking the comma was probably just a typo. also I noticed the post processing volume only really started making my tunnel dark when I dialed back the exposure correction slider, but then when I look out the tunnel, the outside looked too dark.

    and lastly, step 6 didn't seem to be doing much of anything except making everything inside it look indirectly lit. any thoughts?

    I wonder if I threw some TOD setting out of whack troubleshooting something else, and forgot to set it back; it just seems like there's too much ambient lighting during the day, particularly under the terrain, where I would have expected there to be none, at least if Unreal Lighting made an ounce of sense.
     
  11. pilot21

    pilot21 Well-Known Member

    Joined:
    Feb 28, 2023
    Messages:
    106
    Likes Received:
    478
    If you have complex scenery with vegetation, for the light baking process you need to move the Scenery tiles out of the map folder otherwise the Light baking process will crash. So you can move the tunnel to the track scenery tiles or the persistent level. (I prefer the persistent level because you can use longer splines without them disappearing.
    If you dont have complex scenery with vegetation yet you can leave them in the scenery tile and you dont need to move the Scenery tiles out of the folder.

    I'm not sure why this is not baking. I used the dtg default tunnel splines and it worked fine. Could be something with the material or the mesh.

    No this is correct. When the tunnel is baked you see the effects.

    The whole problem is that your tunnel doesn't bake.
     
    Last edited: Apr 21, 2024
    • Like Like x 1
  12. pilot21

    pilot21 Well-Known Member

    Joined:
    Feb 28, 2023
    Messages:
    106
    Likes Received:
    478
    Sorry this message slipped somehow.
    Yes you have the track scenery tiles in which you can cook.
    Before moving your scenery tiles out of the folder you need to move the tunnel to the persistent level or the track scenery tiles so it stays in the map.
    Are you moving the tiles inside the editor? Because it needs to be done in the windows explorer
     
  13. ffabio89

    ffabio89 Well-Known Member

    Joined:
    Aug 15, 2020
    Messages:
    270
    Likes Received:
    250
    Understood!
    Thanks...
     
  14. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    278
    Likes Received:
    449
    Thanks for getting back to me!

    You were spot-on, my mesh had a few problems that were preventing it from being lit correctly. Have a look at it now!: ScreenHunter_103 Apr. 21 13.25.jpg
    (this is with two SM sections on their own.)

    I will revisit the procedure for splines as they do indeed seem to handle occlusion differently than Static Meshes do on their own, but I'm confident I'll be able to get something working!
     
  15. ffabio89

    ffabio89 Well-Known Member

    Joined:
    Aug 15, 2020
    Messages:
    270
    Likes Received:
    250
    I've got mesh build myself too, could I ask which particular problem have you encountered? Because I think I've got the same problem!
     
  16. pilot21

    pilot21 Well-Known Member

    Joined:
    Feb 28, 2023
    Messages:
    106
    Likes Received:
    478
    Maybe select the spline and export it and then reimport it. This converts the editable spline to a static mesh.
     
    • Like Like x 1
  17. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    278
    Likes Received:
    449
    In my case, I had some misplaced vertices ("Clean Up" in the Blender menu has options that can gelp with this, if you happen to be using Blender.)

    Also the editor needs actual wall thickness to do the occlusion properly, I think; in a quick experiment I moved the camera into a simple cube I made, still lit when lighting was built, versus one that was hollowed out with another cube, which was nice and dark after the build. I think "shadow both sides" may also have to be enabled.

    I'm missing something though, because I'm still not getting Pilot21's results, when I use my mesh in a spline using their method. I may just end up modeling my tunnels all as one piece. (Edit: Pilot21 just suggested exporting the spline, and re-importing the geometry, which may do the trick. I'll have to give it a try later today.)
     
    Last edited: Apr 22, 2024
  18. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    278
    Likes Received:
    449
    Thanks for the help, pilot21 ! I think I've got it worked out! Just had to keep the geometry super basic, and not try to "clean up" the result in Blender after merging. The lightmap resolution might be a bit low, but setting it to anything higher makes the baked lighting go nuts for some reason, and I may end up doing the end sections as separate actors for better detail anyway. I'm sure trying your setup with the A.O. fog will help, now that it has something reasonable to work with in the first place!
    ScreenHunter_103 Apr. 24 18.53.jpg
     
  19. pilot21

    pilot21 Well-Known Member

    Joined:
    Feb 28, 2023
    Messages:
    106
    Likes Received:
    478
    Yes, awesome. Theres just the step with the TS2 ambient occlusion necessary and the Tunnel is finished. Good job!
     
  20. 2TallTyler

    2TallTyler Well-Known Member

    Joined:
    Apr 6, 2023
    Messages:
    120
    Likes Received:
    279
    I've followed these steps, but my tunnel is not dark. There are also dark sections of the tunnel walls near each end of the spline, which didn't exist before I started light baking and post-processing.

    Any ideas?

    tunnel.png
     
  21. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    278
    Likes Received:
    449
    Since you mentioned your spline, my first thought is to ask if you've tried exporting the spline (file:export in the main menu, I believe.) This should give you the option to save it as an .fbx file. Importing that .fbx and using it instead of the spline is what I ultimately had to do to get the lighting to bake properly.
    If you've tried that, I'm not sure what to suggest.
     
    • Helpful Helpful x 1
  22. 2TallTyler

    2TallTyler Well-Known Member

    Joined:
    Apr 6, 2023
    Messages:
    120
    Likes Received:
    279
    Thanks. I tried that, and the re-imported tunnel lost its texture.

    tunnel.png
     
  23. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    278
    Likes Received:
    449
    It may just be they lost association with your material. If you are using 3d modeling software such as Blender (sorry if you've mentioned whether you are or not, I've lose track easily,) you can combine some or all of those into one mesh, which would allow for easier UV remapping, if that is needed. I may do a mini-tutorial this weekend, if I can find the time. In the end, each situation is different, and I'm far from being an expert, alas.
     
  24. 2TallTyler

    2TallTyler Well-Known Member

    Joined:
    Apr 6, 2023
    Messages:
    120
    Likes Received:
    279
    I have Blender, but for this I just exported and re-exported the DTG tunnel spline.
     
  25. pilot21

    pilot21 Well-Known Member

    Joined:
    Feb 28, 2023
    Messages:
    106
    Likes Received:
    478
    You need to reassign the correct materials to this object again. In the material slots is also a textbox where the name of the original material is.
     
  26. 2TallTyler

    2TallTyler Well-Known Member

    Joined:
    Apr 6, 2023
    Messages:
    120
    Likes Received:
    279
    Thanks. The problem was that the materials were almost wiped when exporting and reimporting. I copied the material from the original folder and overwrote the imported copy, and they show up properly. :)
     
    • Like Like x 1
  27. moofers#8902

    moofers#8902 Well-Known Member

    Joined:
    Dec 6, 2021
    Messages:
    349
    Likes Received:
    473
    Followed the instructions and I'm getting glowing tracks, I've done exactly as mentioned in the tutorial.

    Oh are splines buggy?
     
    Last edited: Jun 30, 2024
  28. pilot21

    pilot21 Well-Known Member

    Joined:
    Feb 28, 2023
    Messages:
    106
    Likes Received:
    478
    The tracks need to be converted to static mesh and yes the splines are buggy. Export them as fbx file and reimport them as a mesh.
     
    • Helpful Helpful x 1
  29. moofers#8902

    moofers#8902 Well-Known Member

    Joined:
    Dec 6, 2021
    Messages:
    349
    Likes Received:
    473
    That'll explain why the official maps where weird when selecting tracks =P
    Luckily I'll be creating my own custom tunnels at the point I finish all the track gradients and elevations.
     
    Last edited: Jun 30, 2024
    • Like Like x 1
  30. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    278
    Likes Received:
    449
    Sorry for a follow-up on a somewhat older post, but your help with tunnels has been indispensable!

    I've got a diamond crossover in my tunnel. Do you know if there's a way to re-import my tracks that will allow me to retain the switch animations? For what it's worth, my track switches don't seem to have switch animations set up yet anyway. (One more item on the to-do list.)

    As an aside, I noticed it is specifically the continuous rail and ballast splines that don't get shadowed properly, as the repeating elements of the track (ties, braces for the 3rd rail) behave themselves quite nicely. But yes, occluded bits will have to be re-imported.

    Without re-importing any of the track, yet;
    By day:
    ScreenHunter_144 Oct. 14 13.26.jpg
    By night:
    ScreenHunter_143 Oct. 14 13.25.jpg
     
  31. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    278
    Likes Received:
    449
    Well, using the built in "convert to mesh" option in the context menu of the relevant NetworkRenderProxyActor seems to have the desired effect, looking properly lit after baking...
    ScreenHunter_148 Oct. 15 20.08.jpg
    except for the blades of the switches, which are movable, and don't seem to expose a mesh component for baking that I can tell. :(
    ScreenHunter_150 Oct. 15 20.13.jpg
    ScreenHunter_149 Oct. 15 20.10.jpg

    And that's literally all the time I have to spend on it tonight, unfortunately.
    p.s. the switches are animating nicely, I was watching a different switch than I was toggling on the map :/
     
    Last edited: Oct 16, 2024
  32. raptorengineer

    raptorengineer Active Member

    Joined:
    Jan 16, 2018
    Messages:
    514
    Likes Received:
    152
    i made my own tunnel spline and i try fl
    what 3d program were you using? i'm using blender 2.79. i made my own spline tunnel i watched on you tube.
     

    Attached Files:

  33. moofers#8902

    moofers#8902 Well-Known Member

    Joined:
    Dec 6, 2021
    Messages:
    349
    Likes Received:
    473
    The london underground map has switches maybe check that out see what they did?
     
  34. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    278
    Likes Received:
    449
    It's been a few months, but I think my spline-based tunnels looked a lot like that even after baking the lighting, due to general spline lighting wackiness. If you export the spline as a mesh (.fbx file) and re-import that, and then bake the lighting, you may get better results.

    To help diagnose lighting and lightmap issues, you may want to try clicking the option to re-calculate the lightmap from an existing uv channel, and the option for recalculating normals (both of these are in the righthand panel of the window of the PC editor, that comes up when you edit a mesh actor. You can learn a lot just by changing one option, re-importing the model, and seeing what if anything has changed.

    And I was also using 2.79 as it happens, but I went straight from 2.79 to Blender 4.2. It's worth checking out in my opinion, as the UI is still basically the same, which was a pleasant surprise.
     
  35. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    278
    Likes Received:
    449
    That's not a bad idea at all! Also, I think i may have spotted an option towards the end of the loft descriptor that may have something to do with generating some of the geometry, so I'll be checking that out too when I get a chance.
     
  36. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    278
    Likes Received:
    449

Share This Page