‹ BackHN Continuity

Thread

Show HN: I made a flight simulator, except you're just a passenger

446 points · 205 comments · rkotcher

  1. LukaD · · focus · HN ↗
    Wow, this is so unbelievably unoptimized. The sound of my computer fans makes it so immersive. The shadow map is being rendered twice with 300+ draw calls and 1M+ triangles. Full resolution GTAO is probably even more expensive with a lot of fetches per texel. I'm sure there are a ton of low hanging optimization fruits and I'm confident claude et. al can fix all those issues, but if you don't know where to look and never profile the app then you get a vibe coded unoptimized mess.
    1. rkotcher · · focus · HN ↗
      It's a work in progress. I have cut down on the original mesh size by quite a bit but continue to do that. I also fade out the resolution of the map tiles as you approach the horizon so you aren't loading ihgher res satellite images than you need. I've run entire flights on my 2022 mac pro with no issue, but as this is a side project it remains not as optimal as it could be. Any suggestions for order of operations / what should be fixed next are welcome :-)
      1. LukaD · · focus · HN ↗
        I have a few suggestions:

        - as I mentioned above, the shadow map is drawn twice, probably it's being auto updated by three.js at some point

        - the entire cabin has a lot of triangles while the player only sees a small portion of it

        - cabin lighting could be baked

        - a lot of triangles seem to be rendered without backface culling, that's probably not intentional

        - don't run GTAO at full resolution, try half

        And also, use the spector.js [1] browser extension to profile the app and have your AI agent analyze the capture.

        [1]: <a href="https:&#x2F;&#x2F;spector.babylonjs.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;spector.babylonjs.com&#x2F;

        1. rkotcher · · focus · HN ↗
          awesome, I will look at each of these, one at a time. my bigger issue today was that I was not expecting so many people to try the app and have unoptimized bandwidth costs. bringing those down first and then will be looking into optimizations like you have listed. I honestly just built this thing for fun &amp; it was running fine for me. now that others are using it it&#x27;s time to start thinking about performance more. Appreciate the thoughts.
        2. rkotcher · · focus · HN ↗
          fixed the shadow map being drawn twice, and have deployed that. going through each of these and considering. thank you for your suggestions.
          1. LukaD · · focus · HN ↗
            Cool! And sorry if my original comment came across as overly harsh. It’s a fun side project!
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.