A Game Engine Built For Optimisation

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024

Комментарии • 514

  • @SatisfiedOnion
    @SatisfiedOnion 5 месяцев назад +3283

    I can sleep well at night knowing that my TI-NSpire 84 calculator will always be able to run this man's games

    • @Stromoto
      @Stromoto 5 месяцев назад +72

      Maybe Vercidium will make sure that your TI-NSpire 84 calculator can finally play Sector's Edge in the future

    • @attilavs2
      @attilavs2 5 месяцев назад +26

      "The Nspire 84 can't hurt you, it's not real"
      The nspire 84 :

    • @NoorquackerInd
      @NoorquackerInd 5 месяцев назад +8

      Frick, as someone that got into embedded because of calculators, now I wanna port this to the Nspire

    • @cinderwolf32
      @cinderwolf32 5 месяцев назад +6

      Aside from Nspire 84 not being a thing: I learned much of my initial programming knowledge on a TI-84 Plus Silver Edition, and I think that really taught me to value efficiency. Love seeing other people with similar stories!

    • @amir32806
      @amir32806 4 месяца назад

      You like modern AAA laggy games?

  • @bacon_with_brussels_sprout
    @bacon_with_brussels_sprout 5 месяцев назад +1956

    Jokes on you, my shitty laptop is still gonna find a way to lag from just rendering glorified pngs

    • @CharlesVanNoland
      @CharlesVanNoland 5 месяцев назад +109

      I'm a sucker for coding stuff to run on ancient hardware because I started coding when I was a preteen in the 90s, when you had to know how to get the most out of a computer or your game ran like unplayable garbage. Nowadays devs just do whatever and ignore performance and optimization because they just let their end-user's hardware go to waste. EDIT: Indie devs, for the most part, is who I was referring to, but also companies like Bethesda that build layercakes of flashy FX ontop of their ancient engine.

    • @cosy_sweater
      @cosy_sweater 5 месяцев назад +14

      I have a decent pc that can even run Cyberpunk 60fps. But for some unknown reason it freezes randomly even with no load. Like im experiencing 10 second freezes: on desktop; on lockscreen; opening explorer; randomly at any point. So even if the game can run at 10k fps on a calculator im still gonna have ~0.1fps

    • @pluralphilosophy6657
      @pluralphilosophy6657 5 месяцев назад +15

      Jokes on you my shity laptop freezes when loading regular pngs

    • @alfiegordon9013
      @alfiegordon9013 5 месяцев назад +21

      ​@@cosy_sweatermight wanna have a look at your power supply, if it's defective it could have random voltage drops on certain lines that would cause GPU issues

    • @theairacobra
      @theairacobra 5 месяцев назад +7

      @@cosy_sweater i've had a similar issue, it was my motherboard doing silly things to the RAM voltage which sometimes crashed my entire PC, what motherboard do you have?

  • @sharksandbananas
    @sharksandbananas 5 месяцев назад +783

    Amazing z-buffer visualization, never thought of the data in that way before!

  • @lf6914
    @lf6914 5 месяцев назад +661

    There is also a much better way to render volumetric lighting. It's called "Froxels". It was first introduced in Assassin's Creed Black Flag and was later adopted by EA, Naughty Dogs, Rockstar and many more! And also it looks absolutely stunning!

    • @juliandurchholz
      @juliandurchholz 5 месяцев назад +133

      That's a state of the art approach, but what's "better" or "worse" really depends on your goals and target hardware ;)

    • @rednicstone3299
      @rednicstone3299 5 месяцев назад +141

      @@juliandurchholz its not really state of the art, its close to 10 years old at this point. It ran great back then, and if you cant run foxels, you might as well give up running anything serious. Also it looks great in comparison with the nonsensical method proposed in this video.

    • @buzinaocara
      @buzinaocara 5 месяцев назад

      @@rednicstone3299 Yeah. they were first used in Assassin's Creed Black Flag for XBone and PS4 if I'm not mistaken.

    • @juliandurchholz
      @juliandurchholz 5 месяцев назад +22

      @@rednicstone3299 Well, RDR2 and Last of Us 2 use it, for instance. What more modern approaches would you say it's been succeeded by?

    • @SimonBuchanNz
      @SimonBuchanNz 5 месяцев назад +69

      ​@@juliandurchholz"state of the art" technically just means "what the people that know what they're doing use", but the common use is "just invented, best available way to do something".

  • @LimakPan
    @LimakPan 5 месяцев назад +144

    So it's not lighting, but god rays?

  • @alexm666
    @alexm666 5 месяцев назад +11

    I don't know what's more precious in your videos - the insights to the amazing rendering tricks or the way you visualize them!

  • @magnomliman8114
    @magnomliman8114 5 месяцев назад +215

    This optimization content is super interesting man.

  • @mz_eth
    @mz_eth 5 месяцев назад +11

    The editing on this is stunning 😍Also the fact that it was all about lighting had me instantly in love

    • @Vercidium
      @Vercidium  5 месяцев назад +2

      Thanks Zeth! I agree, we need more videos about lighting

  • @cortanathelawless1848
    @cortanathelawless1848 5 месяцев назад +11

    I love people who focus on optimisation because besides the truly impressive technical skills, you only get into optimisation out of two reasons: you cant run your own game/feedback from players, or and thats the reason i respect a lot because they want to make games more accessible. Games are art, more people should be able to enjoy art. Thank you!

    • @anon_y_mousse
      @anon_y_mousse 3 месяца назад +2

      Completely agree. Making a game more accessible by optimizing it for potato hardware is awesome. To this day I have never owned a discrete graphics card.

  • @buzinaocara
    @buzinaocara 5 месяцев назад +319

    This works somewhat ok for your specific scene because you expect a buch of sparesly scattered beams in that specific scenario. This will just look weird in a scene not covered with trees, becaue those few hundred beams will not average out into a homogeneus volume, and if you increased their amount to the point where they do, you will be running slower than aproach nº 2, and will be severely bottlenecked by fillrate.
    You also seem to be spawning the beams from the floor towards the sky and checking for the shadowmap at that position. That means a beam that is being occluded by a tree before it hits the floor gets faded out in its entirety: no beam after the tree NOR BEFORE IT. That too might not look so obviously wrong in that scene, but can look decidedly worse in scenarios with higher depth complexity.
    Its a clever hack, but with very limited aplicability.

    • @kabinet0
      @kabinet0 5 месяцев назад +55

      I agree, it's certainly no volumetric light system. Definitely cool, but more a highly specific trick than anything else.
      Unrelatedly, the CPU readback being involved immediately makes me dislike the technique. It would be slightly less painful if they operated on the opacity data in a compute shader.
      Kind of does get me thinking about some kind of cached (perhaps voxel based) approach though.

    • @DireWolfAirstrike
      @DireWolfAirstrike 5 месяцев назад +11

      As long as the trees are also receiving shadows, I imagine you could do the same technique at the edges of those shadows.
      Looking at the window lighting that inspired this technique, I'd expect it to be one of those things like billboarding where it's "good enough" until you really pay attention to it.

    • @Vercidium
      @Vercidium  5 месяцев назад +52

      Can you please elaborate on your second sentence about a few hundred beams and homogenous volumes?
      Great point about checking from the floor up. An enhancement could be to check the min and max shadow depth values of each sample, then render the beam between the highest position and the lowest position (using the same opacity formula)

    • @Vercidium
      @Vercidium  5 месяцев назад +36

      @kabinet0 persistent mapped buffers and fences allow the CPU readback to happen asynchronously. With 2048 beams that's 2048 * 6 floats * 4 bytes = 49kb of data, which isn't enough to cause a bottleneck

    • @buzinaocara
      @buzinaocara 5 месяцев назад +57

      @@Vercidium Your aproximation looks somewhat plausible in a scene with very spotty coverage such as bellow trees. A swiss cheese world would also apply hahaha. But try doing that in a wide open landscape. You will still have a bunch of randomly scattered beams instead of a homogeneous solid fog volume. The random beams will make no sense (what is dividing light up into small spot-light-like rays in an open sky?". It will look more like rain than fog in that context. I said "few hundred" out of guesswork. I dont know how many billboards you are actually spawning across the scene. But still, in reasonably consistent and robust implementations of god-rays the same fog that creates these small beams in some scenes, is the fog that creates a dense Z-buffer-fog-like effect in other contexts. Its all recreations of real-world light scatering and shadowing interacting.
      For good reference of how broad the effect is, take a look at a RDR2 presentation on their atmospherics system they show comparisons to real world and artistic depictions of the same phenomena. AC4:BF also has a description of their implementation in a graphics presentation of theirs, which I believe was the firsr shipping "Froxel" solution. TLoU2 also has an extensive presentation on myriad optimisations and quality improvements they did to it.
      All that said, what you came up with is still a clever little hack that can work in specific scenes. For a broader game you'll probably want some artist control over where billboards spawn and where they don't, so they are limited to places where they look plausible. If you have a clearing in the forest for example, you'd want to have no beams in the middle of it because then again, they'd lool like weird rain in that context instead of light.
      Even for a window, your solution might look inproper once you have dinamic objects. Since oclusion is checked from the floor, if a character steps in front of the window, not only will the beams be bocked from reaching the floor, they will misteriously not even hit the character either. A tall enough window and a short enough dynamic object can create a very visible effect of a moving object magically making the sun-rays disapear from the window as long as it passes over the sun-lit part of the floor.
      PS: I just rewatched the video and remembered your trick is to only draw beams "at the edge of light". Yeah, that reduces the occurance of the "light looking like rain" problem I described. Yet, the reality is that those wide open spaces should also have the volumetric light in them (including the ocean) just instead of scattered beams, it should be a larger volume. Your solution emulates the "feeling" of a subset of a light phonomena, rather than the real thing. Thats why I recomened looking up the RDR2 presentation, they really explain all the different cases where atmospheric scatering can influence a scene.

  • @Digiur
    @Digiur 5 месяцев назад +24

    Is that "optimized"? Or is it a completely different technique?

    • @perplexedon9834
      @perplexedon9834 5 месяцев назад

      I think it's fair if the output looks comparable to the human eye. The thing that is being optimised is the graphical output, not the completion of a specific process. The fast inverse square Quake is a classic example. If someone replaced the true inverse square with the fast inverse square, I'd certainly consider that an optimisation even though it technically gives a slightly different output and technically isn't the inverse square.

    • @Digiur
      @Digiur 5 месяцев назад

      @@perplexedon9834 Sure, sure. Some results different techniques. Not "optimization".

    • @survival_man7746
      @survival_man7746 5 месяцев назад +4

      That's why it's much faster, it was reengineered. It is less acurate but still looks good like transforming a map into a grid for pathfinding

    • @Digiur
      @Digiur 5 месяцев назад

      @@survival_man7746 I'm just being pedantic about the word "optimize"

    • @AlphaSeagull
      @AlphaSeagull 4 месяца назад +4

      I mean, a lot of bigger optimizations are just that: using a better technique

  • @digitalgh0stt
    @digitalgh0stt 5 месяцев назад +28

    It looks alright, but you can tell all the beams are the same size.
    I wonder if increasing their width with the decrease in opacity would help make the overall scene look better and less uniform. Kind of simulating the beams becoming blurrier.

  • @Mushroom38294
    @Mushroom38294 5 месяцев назад +3

    We need more game devs like you, I'm sick and tired of games taking up loads more resources than necessary

  • @juliandurchholz
    @juliandurchholz 5 месяцев назад +27

    Hey there, good video! Certainly a decent way to fake light shafts, but I wouldn't say it "looks the same" as raymarched volumetric lighting. True single-scattering will always be the most convincing second to raytracing. Your technique appears more flat and is restricted to a fixed amount of random light shafts, which probably leads to scene-dependent artifacts.
    What's your hardware for the given benchmarks? Would be nice to have that included somewhere.
    The "first" approach (screen-space post process) can also be extended to somewhat work for off-screen light sources, to a degree. Are you sure using an intermediate texture with directional blur is superior to epipolar sampling with weight function, as per the traditional GPU Gems 3 solution?
    I wish your video was a bit longer to cover those details and nuances, go into more depth when comparing other techniques, so as to really give an impression of the tradeoffs.

    • @Vercidium
      @Vercidium  5 месяцев назад +4

      I haven't heard of epipolar sampling, I'll check that out thank you!
      I have a 10700F CPU and an RTX 3070 GPU

    • @abhishekak9619
      @abhishekak9619 5 месяцев назад +1

      @@Vercidium i dont know what both of you are talking about. the other person never said epipolar sampling. am i missing something?

    • @Vercidium
      @Vercidium  5 месяцев назад +1

      @@abhishekak9619 epipolar sampling is in the 2nd last paragraph of the original comment here

    • @abhishekak9619
      @abhishekak9619 5 месяцев назад

      @@Vercidium oh i see now.

  • @TileBitan
    @TileBitan 5 месяцев назад +140

    Maybe it's just me but the second approach still looks 100 times better than the last one. Last one makes it look like some early 2000s game

    • @trued7461
      @trued7461 5 месяцев назад +35

      It does look better but 100 times better is pretty close to 70 times which his how much performance is saved, so tbh, worth it maybe?

    • @TileBitan
      @TileBitan 5 месяцев назад +15

      @@trued7461 there is probably a middle ground where you gain a little bit of performance and it actually looks the same. But from those images it ain't it chief

    • @trashtrash2169
      @trashtrash2169 5 месяцев назад +4

      They could be made wider. Maybe dynamically. They're pencil thin. Maybe if they're full opacity they're also double width and you scale the same as opacity...

    • @muggzzzzz
      @muggzzzzz 5 месяцев назад +3

      It still could be useful for mobile game development.

    • @martinsanchez2395
      @martinsanchez2395 5 месяцев назад +2

      For people with potato PC's is much better than disabling the effects all together

  • @DdiiaabbllooBlanco
    @DdiiaabbllooBlanco 5 месяцев назад +1

    >Sees video title that I'm interested in.
    >All I hear is static in my brain with the well put together information because I don't understand.
    >Nice video.

  • @Skeffles
    @Skeffles 5 месяцев назад +1

    What a fantastic improvement!

  • @mypaxa003
    @mypaxa003 5 месяцев назад +34

    5:08
    "In this video on screen"
    Where? I dont see anything.

    • @Vercidium
      @Vercidium  5 месяцев назад +17

      Just added it, thanks for letting me know!

  • @martin128
    @martin128 5 месяцев назад +18

    I think the static 2d planes variant of god rays was used in multiple games in 00s. I think Hitman 2 has it and Freedom Fighters, both are from IO Interactive.

    • @Capewearer
      @Capewearer 5 месяцев назад +4

      Even Crysis 3 uses them, and still looks stunning. But such usage is limited to static scenes only. For dynamic things Crysis 3 uses screen-space Godrays effect. Works pretty well.

  • @nolram
    @nolram 5 месяцев назад +7

    I don't think it's fair to say this looks the same as fully integrated volumetrics. Like, sure, in this one particular scenario in a forest where you want lots of small shafts this may work great, but what about other outside scenes where they aren't as closely occluded? What about local lights? What about generally open areas where the vast majority would be fog-filled? Generally this is a lovely technique for those very specific small beams of light, but I don't think this is anything even remotely close to volumetric scattering - hence why there aren't many games that use this particular method.
    Great video nonetheless, even if I would have hoped for a few more details about placement and transformation of the beams.

  • @askeladden450
    @askeladden450 5 месяцев назад +38

    bro out here casually dropping absolute masterpieces every month

  • @techbytefrontier
    @techbytefrontier 4 месяца назад

    you are built different man. just the animations to show this would take all my knowledge

  • @fffrikkie1236
    @fffrikkie1236 5 месяцев назад +9

    I like your content man, very well edited. Just wondering (and sorry if it's a stupid question), but do these optimizing techniques translate to other game engines or are they just specific to the one you're using?

    • @vexflorez6220
      @vexflorez6220 5 месяцев назад

      If you want to, you can apply these optimization techniques yourself to other engines, though that means throwing away what the engine itself offers and writing things from scratch, while also building it in such a way that it works with all the other parts of the engine.

    • @Vercidium
      @Vercidium  5 месяцев назад +1

      This should be possible in any engine that supports shadows and vertex readback. For example Valheim uses a custom render pipeline within Unity, I reckon they could add beams of sunlight like this.

  • @SirGilt
    @SirGilt 5 месяцев назад +2

    if we like this, and get this to the front page of youtube, we may see better performance in games if we are lucky.

  • @nevintilch4962
    @nevintilch4962 5 месяцев назад +128

    If you and acerola collaborated on a project, you would somehow manage to optimize something to render at the speed of light in a 360° POV with 4k resolution on every texture and also the game would do my homework and take me out to dinner

  • @athithyaparamesh8251
    @athithyaparamesh8251 5 месяцев назад +58

    NVIDIA hates this guy

    • @Ljoijij889
      @Ljoijij889 5 месяцев назад +4

      😂😂😂😂

  • @VaibhavShewale
    @VaibhavShewale 5 месяцев назад +2

    ooh man this one is just mind blowing!

  • @Chaos_God_of_Fate
    @Chaos_God_of_Fate 5 месяцев назад +8

    Very clever. I never got into the technical side of things but when I worked in CryEngine (2007-2015ish). I was the optimization guy in the editor- did most of the optimizations for Mechwarrior: Living Legends environments... Kagoshima (a MW:LL level I designed) took a lot of tricks to get to run reasonably. Making Levels for that game/mod are some of my best memories, and it's still alive today, 15 Years later!

  • @ponyforhire
    @ponyforhire 5 месяцев назад +1

    I always find it fascinating to see experts go ham in thier in their interests and listen in no matter how much i actually understand on the subject at hand 😂

  • @r2d2vader
    @r2d2vader 5 месяцев назад +11

    First
    Edit: Great video! But the end screen video doesn't seem to show up.

    • @6Eev
      @6Eev 5 месяцев назад +2

      beat me to it 😔

    • @Vercidium
      @Vercidium  5 месяцев назад +1

      Thank you! I've just added it

  • @nathanfranck5822
    @nathanfranck5822 5 месяцев назад +17

    I had no idea a Feedback buffer was a thing! Thats cool

  • @floschy_1
    @floschy_1 5 месяцев назад +1

    1:19 I didnt know I need this visualisation in my life, but i do.

  • @mezohx
    @mezohx 5 месяцев назад +12

    I learned more in 5 minutes by watching this video than I did in a week doing my own research. Wild

  • @GreySectoid
    @GreySectoid 5 месяцев назад +1

    Cool algorithm, graphics programming is so much fun!

  • @Jabjabs
    @Jabjabs 5 месяцев назад +1

    I would recommend folks look at the GDC talk for how light beams were handled for the game Abzu. Very cool. In that talk as well is a great summary of how to animate thousand of creatures simply via vertex offsets on the GPU - but that isn't so related to this.

    • @Vercidium
      @Vercidium  5 месяцев назад

      Thank you for the recommendation, I'll check it out

  • @solhsa
    @solhsa 5 месяцев назад +1

    Wow, someone actually found a use for transform feedback.

  • @atunalamarinera
    @atunalamarinera 5 месяцев назад +1

    Maybe it can't replace the second method but surely it will replace the first one, not only runs faster but also looks better.

  • @SylvesterAshcroft88
    @SylvesterAshcroft88 5 месяцев назад +1

    This is so incredibly clever!

  • @MachineCog-i2l
    @MachineCog-i2l 5 месяцев назад +1

    Very cool and you got a new sub.

  • @milanst6385
    @milanst6385 5 месяцев назад +2

    Beams of light in games is called god rays

  • @SaenGaems
    @SaenGaems 5 месяцев назад +1

    would be cool to have the beams also move a little with the wind applied to the trees, looks just a little too static

    • @Vercidium
      @Vercidium  5 месяцев назад

      That's a great idea! I could shift the beam towards the samples that are in the light

  • @mild2616
    @mild2616 5 месяцев назад +1

    Idk if this just common knowledge or if this man is just a genius but my god the game space is gonna be so much better from here on out if this guy is working on em. Great video!

  • @swagatggautam6630
    @swagatggautam6630 5 месяцев назад +1

    This guy deserves a Nobel prize for Game Development.

    • @Vercidium
      @Vercidium  5 месяцев назад

      Haha too kind!

  • @sandwich2473
    @sandwich2473 5 месяцев назад +1

    That's really really cool :O

  • @nicklasfejersen4202
    @nicklasfejersen4202 5 месяцев назад +1

    i can't wait for someone to implement this into a minecraft mod

  • @I2ed3ye
    @I2ed3ye 5 месяцев назад +1

    Now all my games run so well!

  • @Aminsx_
    @Aminsx_ 5 месяцев назад +1

    The 3rd method in the first chapter of the video reminds me a lot of LIMBO

  • @bs_blackscout
    @bs_blackscout 5 месяцев назад +1

    btw this is a much better title
    the previous one felt like a copy paste from another video I've seen before

  • @Greywander87
    @Greywander87 5 месяцев назад +1

    The key to creating a simulation that is both accurate and fast is to forget about accuracy, cheat as much as possible, and tell no one.
    No but for real there will be times when relying on good old RNG gives a result that is only slightly worse than running an expensive simulation. The real key is finding shortcuts and approximations that get you that "good enough" result where no one can honestly tell it isn't 100% accurate without costing too many system resources. Creating an accurate simulation is only half the job, the other half is figuring out the tricks that let you run the simulation in real time.

  • @Chris-op7yt
    @Chris-op7yt 5 месяцев назад +1

    light is everywhere, except where there is shadows, which much attenuate it

  • @JCMSimon_
    @JCMSimon_ 5 месяцев назад +1

    Great video. Thats all i have to say tbh... which is why ill ask a off-topic-ish question instead,
    What did you use to create all the motion graphics like the diagrams and the code boxes?

    • @Vercidium
      @Vercidium  5 месяцев назад

      Thank you, it’s all done using code and then screen recorded. I used C# and SkiaSharp for the diagrams, and RichTextKit for the syntax highlighting

  • @Hector-bj3ls
    @Hector-bj3ls 5 месяцев назад +2

    No wonder it goes faster. He was using some flat out floats in that shader code. They're way faster than normal floats.

    • @Vercidium
      @Vercidium  5 месяцев назад +1

      Haha that's one tiny optimisation, but they all add up

  • @ИванБоженко-ч6т
    @ИванБоженко-ч6т 5 месяцев назад

    awesome ,thank you for a great job

  • @CaioStange
    @CaioStange 5 месяцев назад +1

    only problem i see is when the sun's rotation changes quickly, as in 4:53. The rotation pivot should be on the object castig the shadow on the beam, not on the beam's contact with the ground.
    Outside of that, great approach!

    • @CaioStange
      @CaioStange 5 месяцев назад +1

      I guess you could turn accumulation off on these moments and it should look alright

    • @CaioStange
      @CaioStange 5 месяцев назад +1

      also i guess make the sprite used for the beams less blurred, to make it look higher res

    • @Vercidium
      @Vercidium  5 месяцев назад

      Yes that's true haha, I'd like to fix that. You'd only notice it in a timelapse as the sun moves pretty slowly in-game.

  • @matthewboyd8689
    @matthewboyd8689 5 месяцев назад +1

    Misread the title
    Thought it said gamers are for optimizing
    Started thinking about talk that a game developer said something about, gamers will optimize the fun out of a game. And I realized that in my own life and working life I've been optimizing things to work more efficiently as well. And to such degree that at one point I realized I was turning away experiences that I actually wanted to do just because it conflicted with my schedule that I made up and didn't have to follow.

    • @Vercidium
      @Vercidium  5 месяцев назад

      That’s deep. I can relate to this

  • @IstyManame
    @IstyManame 5 месяцев назад +13

    Yea you definitely do not have adhd lol

    • @coreyscanlon1238
      @coreyscanlon1238 5 месяцев назад

      Idk this seems like the video is a product of hyper focus and that outta the box thinking. ADHD all over it

    • @RagePower2000
      @RagePower2000 4 месяца назад

      ​@@coreyscanlon1238Yep!

  • @Boba19423O
    @Boba19423O 5 месяцев назад +1

    This is awesome but tbh I typically disable god rays as I find them distracting like bloom or lens flare

  • @knyght27
    @knyght27 5 месяцев назад +7

    Very interesting! Always happy to see optimisation techniques explained in beginner-friendly terms

  • @BMRG14
    @BMRG14 5 месяцев назад +13

    Perfect perfect video and info, with a very bad title. :(
    It's not even searchable really.

    • @AkshayKumarX
      @AkshayKumarX 5 месяцев назад +9

      This is the norm now with majority of youtube channels.
      Titles and thumbnails like these drive curiosity and get people to click on the video. Then the creator increases the viewer watchtime by being as vague as possible for the first minute or so to game the system and boost the video's popularity.
      The downside being that if you aren't staying up to date with every new video, old content is almost impossible to find via search.

    • @Vercidium
      @Vercidium  5 месяцев назад +3

      Thank you :) I come up with 5-10 different titles and thumbnails for each video and test each of them, then leave it on the one that brought in the most views. It's all an algorithmic game

  • @fx-modding
    @fx-modding 5 месяцев назад +2

    You should be able to use atomic's within the shader instead of a feedback transform. This will skip the extra step of having to communicate with the cpu.

    • @Vercidium
      @Vercidium  5 месяцев назад

      I'll check atomics out, thank you!

  • @darkfllame
    @darkfllame 5 месяцев назад +2

    not gonna lie, i'm developping a 2D automation game and i'll make so that it can run smoothly on the most shittiest laptop you've ever seen. 16 bits vertex data, instancing and more. And the maps could be HUGE, up to 2^70^2 tiles: by separating the world into regions split into chunks. All of that with not that much resources consumption (in theory).
    I haven't done the game yet and i hope i could share it to the world. god dammit i love game dev.
    Also everything will be done with opengl in zig ! I'll a devlogs when I finish the rendering stuff (at least some sort of good rendering)

  • @lievenpetersen
    @lievenpetersen 5 месяцев назад +12

    The thumbnails are a bit too abstract in my opinion (triangles interfacing half-circles?). They don't give any hint as to the content of the video. And while I like the content, I need to force myself to click on it if I don't get any kind of promise about what I will be presented with.

  • @OGPatriot03
    @OGPatriot03 5 месяцев назад +3

    The end result isn't stunning to me visually, however the approach to get there is highly intriguing and gives me all sorts of ideas. These videos are great for getting the indie dev mind thinking.

  • @badoli1074
    @badoli1074 5 месяцев назад +1

    Wouldn't it be even more efficient just lerping the intensity of the beam slowly to the next calculated intensity? That way you also eliminate flicker, keep the beam dynamic and only need to store the last intensity to compare...? Just an idea ;)

    • @Vercidium
      @Vercidium  5 месяцев назад

      Great point, that would be faster than calculating a moving average!

  • @creatersbr
    @creatersbr 5 месяцев назад

    hey man, i have a question that are not about the video, but how do you edit these videos? the edit of your videos are just INCREDIBLES! it made to me want to watch more video of your channel

  • @KawaMarinho
    @KawaMarinho 5 месяцев назад +1

    legends says that this game will run even on a toaster

  • @dkaraush
    @dkaraush 5 месяцев назад

    you can create two feedback buffers and swap them for input-output in vertex shader. this way you don't involve cpu there at all

  • @bunnybreaker
    @bunnybreaker 5 месяцев назад +1

    As a gamedev that likes to target potato hardware, I am very impressed with such hacks. Kudos 👍🏽

  • @gbnam8
    @gbnam8 5 месяцев назад +3

    the gpu-cpu-gpu roundtrip in 4:28 seems quite suboptimal, can a compute shader replace this step?

    • @Vercidium
      @Vercidium  5 месяцев назад +1

      With persistent mapped buffers and fences the roundtrip happens asynchronously. There is a 2-3 frame delay but you'd never know while playing.
      Some other comments have mentioned that the vertex shader could read/write directly to an SSBO and calculate the average itself, I'll have to check that out

  • @Rundik
    @Rundik 2 месяца назад

    The final result looks nothing like what was shown at the beginning. It's more like laser beams than the sun rays

  • @filettv8102
    @filettv8102 5 месяцев назад +1

    Finally a light pasta.

  • @MonsterTeegs
    @MonsterTeegs 4 месяца назад +1

    There is a notable visual difference between having the beams originate from the ground vs from the sun/sky. The bottoms of the beams dont move, the tops do, where its the opposite for the real thing. Very noticable in timelapses like at the end, doesnt look natural. Could there be a way of further simulating the real thing?
    To better visualize, get a piece of spaghetti or a straw, hold it at the bottom resting on a surface then move the top of the straw, simulating the sun moving. That is what your optimization does. Now do the same thing but hold it about half way up (where the branches and leaves would be) and move it around again. Notice the very clear difference in movement of the bottom.

    • @MonsterTeegs
      @MonsterTeegs 4 месяца назад +1

      Had a thought, (and I am almost a layman here so forgive me my ignorance) could you place the light detectors about tree height and draw them from there, extending both directions but always facing the sun?

  • @Mr371312
    @Mr371312 5 месяцев назад

    Back in the day godrays was like tessalation, or rtx now. Time flies.

  • @TrippleXD545
    @TrippleXD545 4 месяца назад

    fucking einstein out here in his own league

  • @raveltammeleht6278
    @raveltammeleht6278 5 месяцев назад +1

    Not sure how well it would fit to a realistic environment. But for some people this might be useful indeed. Its a oldschool trick. Games like hl2 and mp2 place sprites under lights, making them seem volumetric. You are doing the same, but with nodern languages. So I personally dont find it very interesting. Since it still wouldnt run in a windows 98 or XP machine. Yet the technique is from that era.

  • @HuMoDz
    @HuMoDz 5 месяцев назад

    Another great video, but why do you make the title and thumbnail so vague? ;_;

  • @Xizilqou
    @Xizilqou 2 месяца назад +1

    Wouldn't another option be to do a shell texturing approach where you have planes always in front of the screen that are lit by the shadow map lighting you already have in a certain way that looks like volumetric "god rays?"

  • @severinehedi
    @severinehedi 5 месяцев назад +1

    This man will be optimizing GTA V to run at 5000 FPS on Thinkpad laptop

  • @FelipeMendez
    @FelipeMendez 5 месяцев назад +2

    Id be curious to know if distance fields would help reduce the sample count while keeping good quality in approach 2

  • @spartanwar1185
    @spartanwar1185 3 месяца назад

    People saying the third option looks bad
    I don't get what they mean, the third one looks better because it's not overbearing with it's use of light
    I get it's the outdoors but if you really want to make that point just put together an auto-exposure system

  • @kilroymyboy
    @kilroymyboy 2 месяца назад +1

    Love your videos, but can you please title them better? When viewing your channel its hard to understand what you'll be chatting about and im unlikely to go through all your vids to find a specific topic again in the future

  • @dayanson6920
    @dayanson6920 5 месяцев назад +1

    This feels like how the ps2 went from playing the game Bouncer which was blocky as hell to FFX/X-2. They optimized the fuck out of that system. I do wish more studios did this to their game instead of just relying on Unreal/Unity to do it.

  • @patty4449
    @patty4449 5 месяцев назад +1

    Ok I can add on this...
    When the day passes less beams should be on screen...
    Beams should't be statics but move slightly over time...
    Great concept...
    But I still can't get dynamic snow done in this way as the sheer amount of vertex points saved is the problem... Im getting closer tho...

  • @callibor3119
    @callibor3119 5 месяцев назад +2

    I think the best move is color your models and textures like if light actually hit and color it like if light didn’t.
    What’s going on from I am seeing is everything is completely singularly functioned and not programmed to act like how light should hit the environment.
    The light shouldn’t be faked, but how you color the textures and models can be faked to the point that it looks real.
    If you let the engine itself do all the work, you won’t get the performances with its default settings, so getting the models and textures early on in development to look like it is real-time before the game engine, can break the limits of the engine and you won’t see the work break itself.

  • @BL00F0X
    @BL00F0X 5 месяцев назад +1

    This is where the industry should be going but instead they rely on raw power to hide their mistakes. Imagine they could optimize everything and still use some of the tech they relied on for so long to enhance those optimized effects instead. I'm no game dev so perhaps I'm speaking out of my ass. 😗

  • @asdanjer
    @asdanjer 5 месяцев назад +1

    These videos are really good, but pls don't call something rnandome lighting when lighting is a very establishced and clearly defined term in games.
    also they are also not called "beams of sunlight" but god rays.

  • @zipsexe
    @zipsexe Месяц назад +2

    Give this man triple A budget

  • @HypeLozerInc
    @HypeLozerInc 5 месяцев назад +7

    Legend

  • @P-39_Airacobra
    @P-39_Airacobra 3 месяца назад +2

    I really appreciate content like this that tells us how to make our code both efficient and simple. I know what it's like to have a low-budget PC and still want to play games on it, and optimizations like this save the day for such gamers.
    Even if unoptimized code is "enough", it's preventing you as a game dev from implementing lots of interesting features. I wish the software engineering community as a whole would stop pretending resources are unlimited.

  • @khlorghaal
    @khlorghaal 5 месяцев назад

    instead of doing readback you should do feedback, data never needs to leave the gpu that way

  • @frankdelahue9761
    @frankdelahue9761 4 дня назад

    Jensen Huang also liked this video.

  • @player92381
    @player92381 5 месяцев назад +1

    one day hope either he himself or someone else takse the code he makes and finds a way to implement it in every game like how fsr and dlss exist i know they are not the same at all and these are game optimizations and fsr is an upscaler but like it would be cool

  • @DracoTheNinja
    @DracoTheNinja 3 месяца назад

    could you maybe make your game engine more easy to use and/or have its own programm dedicated for easy building? i think that your engine could change a lot in the gaming industry, this would fix overly unnecessary big game file size's

  • @alphus1331
    @alphus1331 5 месяцев назад +1

    1:40 I was expecting some kind of ray marching-like trick there. Could that actually work?

  • @land3021
    @land3021 4 месяца назад

    1:35 Fascinating 4:52 Yuh

  • @notapplicable7292
    @notapplicable7292 5 месяцев назад +1

    I mean this technique is absolutely the fastest way I can think of doing it but imo it doesn't really look quite right.

  • @DireWolfAirstrike
    @DireWolfAirstrike 5 месяцев назад +1

    I wonder if there's an intelligent way to be intentional about where to put these light shafts.
    Could some of these computations be amortized into the blurring/anti-aliasing pass on the shadows?

    • @Vercidium
      @Vercidium  5 месяцев назад

      When the CPU reads the ray opacities back, it could reposition the sun rays that are fully in shadow or fully in sunlight. Then you'd get the most amount of rays visible on screen at once
      Another person commented here about blurring the shadows, it seems like that would work but haven't fully wrapped my head around it

  • @zachbaldwin2925
    @zachbaldwin2925 5 месяцев назад +2

    The dynamic beam approach was very interesting. I couldn't help but consider biasing the "dynamic beam" size/ density depending on distance to camera or splaying thebeam's mesh from the threshold of object and sky towards the ground, creating a trapezoid, to emulate penumbra.

  • @rototype786
    @rototype786 5 месяцев назад +1

    Saving data on the GPU, moving it to the CPU, and back again into a fragment shader seems like it would come with some hefty bandwidth bottlenecks. I have no idea how you pulled this off.

    • @Vercidium
      @Vercidium  5 месяцев назад +1

      There's only 49kb of data (2048 beams x 6 floats) so it's unlikely to cause a bottleneck.
      The readback happens asynchronously as well with persistent mapped buffers and fences, so the CPU won't stall waiting for the GPU

  • @Akkbar21
    @Akkbar21 2 месяца назад +1

    If the devs for Star citizen watched this video, their brains would explode.