I added portals into software Quake

Поділитися
Вставка
  • Опубліковано 4 лют 2025

КОМЕНТАРІ • 143

  • @MattsRamblings
    @MattsRamblings  Рік тому +81

    As I mentioned there's a lot more work to make this robust, and there's also more I could do to make it faster. For instance, I could use (something like) frustum culling to ignore geometry outside of the portal edges. These test levels work well enough on my modern PC though, so I'll leave it here for now...

    • @orbatos
      @orbatos Рік тому +5

      Nice work! I was wondering why you don't mention frustum culling As part of the partitioning step. Looking forward to more on this.

    • @СашаЕгоров-п1ъ
      @СашаЕгоров-п1ъ Рік тому +1

      Hello, I have one multiplayer project on ue5 in which I would like to add motion as in quake 3, could you give a formula to calculate motion in quake 3, in the form of a normal mathematical formula(Maybe with some notes. ) ? I searched for it on the Internet, found only the source code, but in them I do not know where to look for the piece of code I need, and I saw a little of it, after which I realized that it would be easier to ask a knowledgeable person for a formula and write everything from scratch than to try to rewrite the original code.
      I would be very grateful if you would provide this.
      PS
      I apologize for my English, I used a translator.

    • @viciious1234
      @viciious1234 Рік тому

      Hi! Ive worked on a similar feature for qfusion and also worked on my software quake engine tochris so I feel I need to share my thoughts on this ;)
      To facilitate near plane clipping, I would suggest adding the fifth plane to the frustum in the generic rendering pipeline, this will eliminate a huge amount of polygons that need to be clipped

    • @popcultureprogrammer2171
      @popcultureprogrammer2171 5 місяців тому

      Why not use parallax occlusion maps that are compiled into the surface? Distance from camera = height. Would that not be cheaper, or am I too much of a novice to realize how bad of an idea this is?

  • @karlmehltretter2677
    @karlmehltretter2677 Рік тому +94

    During Quake's development, 3dRealms was working on the original Prey. Prey had portals as its main VSD (visible surface determination) structure instead of Quake's PVS. The abilitry to have these gameplay portals was quite hyped in the media at that time.

    • @sarkies_proxy
      @sarkies_proxy Рік тому

      ua-cam.com/video/dMfen_wicEA/v-deo.html

    • @wreagfe
      @wreagfe Рік тому +3

      @AletheiaBasin Prey was never released though, until Human Head made the 2006 Prey based on idtech4.

    • @meateaw
      @meateaw Рік тому +10

      Narbacular drop was released in 2005.
      It was some of the team that ended up making portal. Gabe Newell liked it, so he hired the whole team, and they subsequently made portal.
      So valve still win :)

    • @SuperAlgae
      @SuperAlgae Рік тому +9

      The original Unreal had portals back in 1998, but the game didn't use them heavily even though they were pretty advanced. Two portals could be at any angle to each other. They didn't have to be vertical, but some angles could result in your view angle jumping when passing through them, and some kinds of weapons didn't work when shot through them.

    • @wallabra
      @wallabra Рік тому +7

      ​@@SuperAlgae yes, UT made some use of them too, eg DM-Fractal. OldUnreal's modern versions fix hitscan weapons through portals if I recall correctly.

  • @ataraxianAscendant
    @ataraxianAscendant Рік тому +16

    babe wake up new matt's ramblings video

  • @SillyOrb
    @SillyOrb Рік тому +74

    Very nice! :D I especially applaud your decision to adhere to the original principles while looking for possible solutions to the issues.

  • @hotmultimedia
    @hotmultimedia Рік тому +22

    Thank you for your contributions in the field of Quakelogy

  • @dantescanline
    @dantescanline Рік тому +27

    you're wild man, doing this in the spirit of the original software implementation is very cool. now you just need a time machine and you can make a mod of Portal for Halflife goldsrc

  • @quakespeedrunsexplained
    @quakespeedrunsexplained Рік тому +22

    🤯🤯 incredible work as always. Mappers would have a blast with this!

    • @MattsRamblings
      @MattsRamblings  Рік тому +11

      Thanks! Good to see you here.

    • @ShadesMan
      @ShadesMan Рік тому +3

      @MattsRamblings heck yeah! It's in GZdoom and now, Quake!

  • @TouchdownTFTD
    @TouchdownTFTD Рік тому +3

    That reminds me of the old days when I've been listening to Carmack's QuakeCon keynotes as in I do not understand 95% of the technical stuff... but I still had a lot of fun listening to it. :)

  • @jimmyhirr5773
    @jimmyhirr5773 Рік тому +32

    Chapter 70 of the Graphics Programming Black Book mentions that the Quake developers tried using portals for rendering instead of PVS. However they ultimately decided against it because it made worst-case performance worse without improving average performance.
    If you haven't checked that out, you should. It might give you some ideas.

    • @MattsRamblings
      @MattsRamblings  Рік тому +18

      Yes, that did spring to mind! It's pretty much the same problem only with portals between each leaf, I think.

    • @SerBallister
      @SerBallister Рік тому +2

      IIRC the original Unreal engine was portal based

  • @electrocatalyst
    @electrocatalyst Рік тому +3

    Man, even this "basic" implementation of portals looks totally awesome! This could be an amazing addition to the Retroquad engine.

  • @Spartanhero613
    @Spartanhero613 Рік тому +13

    Not exactly Quake spirit, but those portals would look sick with some see-through vertical, wavey water with maybe a little translucent animated texture.

  • @Stomj
    @Stomj Рік тому +1

    your profile picture fascinates me the more i downscale it the more it looks like a regular image that is not made of lines

  • @Tenetri
    @Tenetri Рік тому +14

    All your videos are so fascinating! I was 10 when i started playing Quake 1 in the late 90's, and these give a cool sense of nostalgia, and curiosity at the same time. Wish you the best, and thanks for the great vid!

  • @miloheh
    @miloheh Рік тому +7

    I love this channel. Jedi Academy taught me how to program and helped me learn the quake engine. I wonder if you’d explain how bsp inception and subsequent child map entity tracking could be improved compared to the implementation of misc_bsp. one of my favorite game mods from back then let you save and load map entities, but you couldn’t sub tree the map entity logic when placing a bsp. That would’ve been cool

  • @guilhermecampos8313
    @guilhermecampos8313 6 місяців тому +1

    This is one of the coolest things I've seen about Quake. Congratulations on the work!

  • @GegoXaren
    @GegoXaren Рік тому +11

    divVerent made portals in QuakeC code about 13 years ago.
    It is what is used in Xonotic and old Nexuiz.
    In those games they are called Warpzones. (xonotic-data pk3dir- > qcsrc -> lib-> warpzone)
    But that is a hack of the water render implementation (also in QuakeC), iirc, and is not the same approach as your implementation.

  • @SilverstringsMusings
    @SilverstringsMusings Рік тому +3

    Great video, programming, explanations, etc. Really hoping you expand on this concept in the future and turn it into a publicly available mod

  • @delphicdescant
    @delphicdescant Рік тому +2

    We need to start using BSP trees in more stuff again tbh.
    The fact that we *can* kill it with hardware instead does *not* mean we *should.*
    A beautiful program running just as fast as it needs to is ok. But a beautiful program running 10,000x faster than it needs to is *exquisite.*
    Let us not be like the engineers, who build bridges that barely stand. Let us be obsessed with over-engineering, to build bridges that will stand until the sun consumes the Earth.

    • @charlieking7600
      @charlieking7600 Рік тому +2

      BSP is very sensitive to geometry details. So it would be inefficient in modern games. Manually placed sectors, portals, occluders should prevail.
      Modern games lack quality development. Nowadays you can see highpoly meshes with absurd polycount, so it's done with colliders too. And LODs are automatically generated without any manual fixing. You can see smallest hairs on character faces, but not detailed skin textures. You can see highpoly rocks, but not detailed wall corners, which are represented as geometrically perfect. And so on.

    • @ArchSchizo
      @ArchSchizo 2 місяці тому

      @@charlieking7600 Half-Life 2 mixed them, using BSPs for level collision and rendering, with extra mesh-based collision / rendering added afterward. Like sprinkles. Modern games use meshes exclusively, which is responsible for a LOT of glitches regarding physics and out-of-bounds behavior. It's done to make things easier on the level artists, but an invisible BSP functioning as a collision hull / mesh occluder COULD exist. Engineers exist, they are just told "no" by the management.
      I remember when Paladins had test-map gamemode, where the level was still grey-boxed for gameplay feedback. Art pass done way later. We could do it in reverse, where BSPs are added after the map is designed, like tracing an outline. It's just more profitable to brute force polygons and patch edge-cases.

  • @ostratego167
    @ostratego167 Рік тому +2

    Now you're thinking with portals!

  • @william.lubelski
    @william.lubelski Рік тому +3

    I fist pumped when you got to the nested portal queue

  • @jembishop3509
    @jembishop3509 Рік тому +4

    Very cool video, reminds me of the guy doing portal on the n64!

  • @willtheoct
    @willtheoct Рік тому +2

    thank you for doing the thing i've wanted to see and do

  • @Terminatorm101
    @Terminatorm101 Рік тому

    Mindblowing! Looking incredible using old-school software rendering!

  • @evanbooth1441
    @evanbooth1441 Рік тому

    I really like how you laid everything out, and the portals look amazing.

  • @sibvrv
    @sibvrv 11 місяців тому +1

    Awesome! Implementation as in Duke Nukem 3D ))) There where lot of custom levels in use with non-euclidean geometry, the most fun experience for multiplayer setups.

  • @staticjpl
    @staticjpl Рік тому

    Thanks Matt for another wonderful video! Unparalleled video editing and explanations!

  • @Levi_OP
    @Levi_OP Рік тому +2

    Very cool video! keep up the good work

  • @ShadesMan
    @ShadesMan Рік тому +1

    4:17 and 5:54 - aah, like the real life 'infinite mirror' effect when u place two of them facing each other.

  • @bobbycomputers
    @bobbycomputers Рік тому

    What an absolute gift of a video! Thanks, Matt

  • @skillfurofficial
    @skillfurofficial 3 місяці тому +1

    That would be dope to get my hands on that juicy source code so I can ste... "Learn" from what you've done here
    Great job and I wonder how this rendering could be improved

  • @AndyGaskin
    @AndyGaskin Рік тому

    Really exciting work. Thanks for sharing this

  • @brobbeh
    @brobbeh Рік тому +1

    Oh man I really hope we can get fully functional ones allowing grenades and monsters as well. Could really make some trippy lovecraftian stuff and mess with players with infinite corridors and labyrinths.

  • @sergeiohotskiy815
    @sergeiohotskiy815 Рік тому

    Awesome! When I was a kid in 1999 I used to mess with QuakeC and the source files. I wanted to make rockets and grenades to jump the teleports too, which they didn't. It added an extra layer of fun. And I managed to do it without knowing anything about coding! The only problem that I encountered was that the rockets and grenades were choosing seemingly random trajectories when leaving the teleports on the other side. Couldn't beat that bug then due to lack of knowledge. Even played my mod at a lan party:)

  • @dhonex
    @dhonex Рік тому +1

    Simply incredible

  • @lucashoffmannn
    @lucashoffmannn Рік тому +1

    I'd like to see that working on original hardware to some extend. Imagine how mind blowing it would be for people back then if this existed at the time? Pretty good video

    • @martin-vv9lf
      @martin-vv9lf Рік тому

      i think i heard about a portal quake mod back then that was available, but it was so cpu intensive nobody dared use it.

  • @vadimtaranov3041
    @vadimtaranov3041 Рік тому +7

    What an amazing job! I just discovered your camapaign for Quake and after playing it for a couple of minutes it's really something good, thank you! Btw, do you think it could be possible to pre-render portals into a set of images or a compressed video, maybe even a couple of parallax cubemaps to save some performance?

    • @MattsRamblings
      @MattsRamblings  Рік тому +7

      Thanks for the kind words. To be clear, I had nothing to do with the development of the Alkaline mod, I merely used it in this project. It is a fantastic campaign though. To answer your question: I suppose that would be possible, although it'd only ever be an approximation since you'd want it to appear right from all angles. Thanks again.

    • @vadimtaranov3041
      @vadimtaranov3041 Рік тому +2

      @@MattsRamblings ok, yes, this is exactly why I say it should be a series of images, taken from multiple angles.

    • @thegibusguy4969
      @thegibusguy4969 Рік тому

      @@vadimtaranov3041Similar to a cubemap?

  • @Sp00n00n00n00
    @Sp00n00n00n00 Рік тому +12

    I don't think portals like this tend to use stencil buffers in modern games. I think they render the destination scene to a separate off-screen texture backed by another frame buffer and then place that in the portal location.

    • @octopusx9801
      @octopusx9801 Рік тому

      Stencils used to mask portal area

    • @delphicdescant
      @delphicdescant Рік тому +6

      There are lots of ways to do it. Imo the best way to do something is the one that takes the least frame time and memory to do. Idk which one that is, but it's probably one that doesn't use very many extra buffers.

    • @Spikehead777
      @Spikehead777 Рік тому +5

      IMO, I would rather use a stencil and depth buffer to clip the destination geometry to the portal's surface in the source source geometry. That way, I could use a single deferred lighting/shading pipeline to light both sides of the portal with lights/shadows being able to pass through.

    • @randomcatdude
      @randomcatdude 7 місяців тому

      stencils are superior to rendertextures in pretty much every way

  • @eadweard.
    @eadweard. Рік тому

    Amazing. I saw that other fellow (the one writing his own engine) did this recently.

  • @w3sp
    @w3sp Рік тому +4

    Nice, I did something similar in Q3 many years ago, basically modifying the standard teleporter and combined that with the portal camera. A few of these videos are still scattered around, e.g. "roomillusion4".
    PS: I like your technical approach.

    • @MattsRamblings
      @MattsRamblings  Рік тому +3

      Yeah, I did think about the Q3 see-through portals when I was doing this (eg. the one near the lava in q3dm7). I seem to remember there were some technical limitations, so the renderer couldn't handle portals looking at portals?

    • @Eraesr
      @Eraesr Рік тому

      ​@@MattsRamblingscorrect. Portals couldn't look at other portals and if I remember correctly, things also broke down if the player could see two portals simultaneously as well.

  • @ChristianIce
    @ChristianIce 5 місяців тому +1

    Outstanding job!
    Any news?

  • @Harekiet
    @Harekiet Рік тому +1

    That's pretty damn cool and indeed really wonder at the performance of running this and the original level on an old pentium

  • @PierreDurand87
    @PierreDurand87 Рік тому +2

    awesome

  • @sbritorodr
    @sbritorodr Рік тому +1

    this is very impressive. I wish I could play it in some ironwail port using hardware features.

  • @JMPDev
    @JMPDev Рік тому

    Would love to see further work on this as you optimize this further in a future video :)

  • @hobbified
    @hobbified Рік тому +6

    Would you be able to apply any effects (even very cheap ones like desaturation / palette changing) to stuff that's rendered through a portal, to make them a bit less transparent? Maybe just needs a stack of renderer parameters.
    A bit of geometry wobble would be cooler, but probably not doable :)

  • @Artman009
    @Artman009 Рік тому

    Awesome work!

  • @Davesoft
    @Davesoft Рік тому +1

    That's pretty unreal bruh

  • @lunaranxiety4589
    @lunaranxiety4589 4 місяці тому +1

    We can finally recreate "Tier Drops" from Duke Nukem 3d now

  • @brucetungsten5714
    @brucetungsten5714 Рік тому

    Impressive work!

  • @painelemental333
    @painelemental333 Рік тому

    fascinating stuff!

  • @jane5886
    @jane5886 Рік тому

    God damn my man is a legend

  • @-Kerstin
    @-Kerstin Рік тому

    Hope you keep trying to improve it. Would be really cool to have maps with these portals that run on oldish hardware.

  • @tomeofkeep7842
    @tomeofkeep7842 Рік тому +4

    I wonder how this differs from the warpzone implementation in Darkplaces. I hope you look into how this might be done with a GPU OpenGL render path.

  • @mfaizsyahmi
    @mfaizsyahmi Рік тому +3

    I get a feeling this is being developed to get a Quake version of myhouse.bsp.

  • @barrupa
    @barrupa Рік тому +3

    Opening the doors (or dare I say, portals) for someone to remake MyHouse.wad in Quake running on period accurate hardware.

  • @Edgebotv4
    @Edgebotv4 Рік тому +1

    Id like to see this in a mod.

  • @PanzerschrekCN
    @PanzerschrekCN Рік тому

    It's possible to clip triangle models by clearing depth buffer outside portal area. Yes, it is not cheap. But some optimizations are possible, like clearing it only around models that needs to be clipped.

  • @oaooaoipip2238
    @oaooaoipip2238 5 місяців тому +1

    Mazing

  • @r.g.thesecond
    @r.g.thesecond Рік тому +3

    Wow I keep forgetting how fast software rendererers can get messy. Another youtuber, jdh, just gave up debugging his renderer for his game. (it makes for a good content I suppose...)
    Though, I'm more interested how physics might interact with portals. The original Portal (2007) is a mess trying to deal with player AABB going through non-AA portals, collision etc (It makes for amazing speedruns though). I wonder if there are cleaner, more elegant solutions.

    • @user-sl6gn1ss8p
      @user-sl6gn1ss8p Рік тому

      there's a guy porting portal to the N64, he discusses some techniques (which run well on a N64)

  • @fryziu
    @fryziu Рік тому

    Love your work 😀😃😄😁🤩😍

  • @just__khang
    @just__khang Рік тому

    very nice

  • @skope2055
    @skope2055 Рік тому

    awesome

  • @vvviiimmm
    @vvviiimmm Рік тому

    love it

  • @MillywiggZ
    @MillywiggZ Рік тому +6

    Not clever enough to keep up with this. So to look clever I’ll quote someone:
    “Huh?”
    Quake Guy (or Ranger)

  • @Nikku4211
    @Nikku4211 Рік тому

    Reminds me of when they got portals in vanilla Doom by exploiting the BSP.

  • @kuklama0706
    @kuklama0706 Рік тому

    XashXT for Half-Life has this, it lets pushables through and I've managed to make env_shooter projectiles to pass as well.

  • @Foxtrop13
    @Foxtrop13 Рік тому

    cool now we need someone to make Prey

  • @Buhroocykins
    @Buhroocykins Рік тому +2

    👌

  • @tacokoneko
    @tacokoneko Рік тому

    technically CPU can render everything that a GPU can because there is a fully complete and well-defined software implementation of OpenGL 4.5 called freedesktop mesa llvmpipe that enables any OpenGL code to run on any CPU even when there is no hardware OpenGL accelerator present. Slower result than most hardware GPU of course, but this GPU emulator is optimized to the greatest extent it is possible to optimize a CPU to render 3D, so its performance on very large modern CPUs like AMD Ryzen 9 5950X should not be underestimated

  • @boryatema
    @boryatema 2 місяці тому +1

    where can download it? for try play

  • @UdderlyEvelyn
    @UdderlyEvelyn Рік тому +1

    I have a feeling my 20MB Pentium Overdrive @73MHz would be too just-barely-runs-Quake to handle this, eh? Heheh.

  • @linguini1517
    @linguini1517 Рік тому +3

    narbacular drop

  • @Kppot
    @Kppot Рік тому

    Whoa!

  • @JohnDobak
    @JohnDobak Рік тому +6

    can... can you fire rockets through them?
    🤠

    • @MattsRamblings
      @MattsRamblings  Рік тому +1

      It can't even render rockets correctly at the moment! That would be amazing though. 😅

  • @gdclemo
    @gdclemo 8 місяців тому +1

    How do you avoid the portal clipping the near plane as you pass through it? Also doesn't Quake use PVS, so are you doing PVS lookup for the viewpoint transformed into the portal destination space (which might be behind a wall) or from the portal itself somehow?

  • @RoideJaneiro
    @RoideJaneiro Рік тому +2

    What about mirrors? Aren't they similar?

    • @MattsRamblings
      @MattsRamblings  Рік тому +2

      Yes, you could implement mirrors like this, you just need to reflect the far side of the "portal" too.

    • @RoideJaneiro
      @RoideJaneiro Рік тому +1

      @@MattsRamblings And probably also the player. But nice! Mirrors in games are way too seldom.

  • @Bacontsu
    @Bacontsu Рік тому

    I've stumbled onto same issues when implementing the same thing onto Goldsource engine, thought its mostly hardware accelerated

  • @AmaroqStarwind
    @AmaroqStarwind 7 місяців тому

    This video gives me DmRadicus (DmRadikus?) vibes.
    It was a non-euclidean map from the first Unreal. (Not Unreal Tournament, regular Unreal.)

  • @antivanti
    @antivanti Рік тому

    I seem to remember that the original Unreal engine had support for portals like this?

  • @AdamChristensen
    @AdamChristensen Рік тому

    My 486 and PII are ready. 😁

  • @Biel7318
    @Biel7318 Рік тому

    how do you organize the tree of portal spaces if one leaf node of the three connects back to a trunk node?

  • @_general_error
    @_general_error Рік тому

    95's Portal. Let make this.

  • @JohnSmith-wolandworld
    @JohnSmith-wolandworld Рік тому

    would this be possible in the goldsrc engine or would that be difficult due to the engine overhauls that goldsrc has had?

  • @appalling22
    @appalling22 Рік тому

    Did you try using this technique to make reflective surfaces? I think this is how duke nukem and Unreal did mirrors, IIRC

  • @TheSoulmarine
    @TheSoulmarine Рік тому

    Finally!!

  • @Wobbothe3rd
    @Wobbothe3rd Рік тому

    Next step: raytraced lighting through portals ;~)

  • @1_1bman
    @1_1bman Рік тому

    has anyone ever tried an implementation of portals that _doesn't_ just consist of rendering another scene?

  • @SirYodaJedi
    @SirYodaJedi Рік тому

    finally

  • @CsendesMark
    @CsendesMark Рік тому

    I used to play a mod for Q3 which had portals like this, and it was long before Valve's Portal
    Does anyone know that? maybe?
    I wondering what it would like to play that again!!!

    • @charlieking7600
      @charlieking7600 Рік тому

      You probably played Xonotic (previously Nexuiz), which is basically Unreal Tournament with bunnyhopping.
      It's built upon Darkplaces and uses gameplay feature known as warp zones. These are seamless portals.

  • @hanssondaniel
    @hanssondaniel Рік тому

    Awesome! Now add a portal gun 😅

  • @Jkauppa
    @Jkauppa Рік тому

    why dont you just render from the portal plane forward, in the new location

    • @Jkauppa
      @Jkauppa Рік тому

      yep the portal is a screen surface

    • @Jkauppa
      @Jkauppa Рік тому

      so that the portal is the camera surface and the origin is the player, any number of new cameras, portals, and the portal is the forward clipping plane

  • @PanzerschrekCN
    @PanzerschrekCN Рік тому

    Recently i implemented portals myself in my experimental softwarte rendering engine. But my portals works differently - this is just a render into texture. And result portal looks not so smooth as yours (is blocky).

  • @TheGreatSpiff
    @TheGreatSpiff Рік тому

    How different is this from how Build engine games handled portals? It seems similar, but my knowledge is very limited.

    • @Ehal256
      @Ehal256 Рік тому +1

      Somewhat, but build is still "2.5D", which simplifies the occlusion tracking, it only needs two integers per raster column to achieve zero overdraw.
      However, build has its own sophistication to handle concave sectors (as opposed to doom's convex sectors and quake's convex leaves)

  • @karpai5427
    @karpai5427 Рік тому

    Aren't portals already a thing in Quake? Is it something that was created this month?
    They are in original Duke Nukem 3d and gzdoom.

    • @charlieking7600
      @charlieking7600 Рік тому

      But not seamless ones, only these using black textures, imitating some kind of cursed sky with stars.

    • @karpai5427
      @karpai5427 Рік тому

      @@charlieking7600 Well, as a mod obviously. I would be surprised if it was not done before.
      Makes me think if there are other Quake engine games that have portals. I can't remember any.

  • @MenkoDany
    @MenkoDany Рік тому

    Bro made Quake 1.5

  • @fredriksandebert7450
    @fredriksandebert7450 Рік тому +2

    Am I the only one who thinks this video was quite dark and sometimes difficult to see what was going on?

    • @charlieking7600
      @charlieking7600 Рік тому

      Depends on your screen brightness.

    • @Spartanhero613
      @Spartanhero613 Рік тому

      I agree, I think his gamma must be lower than the game's default

  • @ch4mba
    @ch4mba Рік тому

    something for Netflix

  • @tuff_lover
    @tuff_lover Рік тому

    If only we had real portals back then...

  • @teiman
    @teiman Рік тому +3

    :-O

  • @Kengur8
    @Kengur8 Рік тому +1

    This is like ray casting, but for 1996... genious