If it did, all you’d see was a smudgy stick figure in most cases

  • Thorry84@feddit.nl
    link
    fedilink
    arrow-up
    49
    ·
    4 days ago

    When I saw the mirrors in Duke3D for the first time I wondered how they pulled that off. I had made a couple of Wolfenstein like tech demos at the time, going off the published stuff about the algorithms and techniques used by Carmack and Romero at the time (groundbreaking stuff). So I delved into it at the time and the way they did it was to have an identical but mirrored room behind the mirror. The mirror was just a transparent wall. And they had a sprite spawn in that looked like Duke and was controlled by the player.

    Mirrors in games are hard.

    • oxysis@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      25
      ·
      4 days ago

      Another trick that you can do is to render the scene from the mirror’s perspective. That way everything that needs to be seen in a reflection is there but also not taking up an entire extra room.

      In Valve’s Source engine that is how the water reflections work. They can look absolutely perfect so long as you set props to reflect in the water.

      • Sylvartas@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        18
        ·
        4 days ago

        That is called a render target and basically adds an entire full pass of frame computing (from this pov) which is why mirrors using this tech usually have an abysmal resolution. And generally some blur to hide it a little

        • Fitzsimmons@lemmy.blahaj.zone
          link
          fedilink
          arrow-up
          1
          ·
          4 days ago

          It’s been a while but there was something in the doom 3 engine that made it pretty good at render target efficiency right? I seem to remember they were able to do mirrors well, and it was also a gimick they liked to do a lot with the computer terminals you could interact with.

          They took this tech a step further with Prey (2006), which used the doom 3 engine, to make portals you could see and shoot through. I can’t remember if the portals were dynamic though.