use the following search parameters to narrow your results:
e.g. reddit:aww site:imgur.com dog
reddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, community...
~13 users here now
One place for all the pics and gifs that beg the caption "How I feel when..."
Reposts are welcome, so don't complain. Enjoy the various captions, expect the reposted gifs.
Please tag everything like this "[HIFW] Title..."
Use Imgur
reddit is a source for what's new and popular online. vote on links that you like or dislike and help decide what's popular, or submit your own! learn more ›
As a graphics programmer, HIFW /r/gaming tries to explain why mirrors don't work in FPS games (i.imgur.com)
submitted 12 hours ago by Contero
[–]ramwilliford 31 points32 points33 points 12 hours ago
Why don't they?
[–]Contero[S] 83 points84 points85 points 12 hours ago
They do. Portal is a great example. It's not exactly a mirror, but it represents the exact same problem: You're creating a viewport that looks back into the scene, potentially at other viewports which do the same thing.
One of the biggest problems is: Imagine two mirrors facing each other in a room, or two portals facing each other. It creates one long hallway. Portal manages to handle "mirrors looking at mirrors" problem quite elegantly: They render each mirror viewport over and over again down to a depth of 7, and then they put a "good enough" texture on the last one. This ends up looking quite nice since the 8th mirror/portal will usually take up a small part of your screen and you won't be able to tell the difference.
The real question is, why don't most games do this? The answer is some combination of the lack of: time, budget, developers, experience, and bang for buck. In portal it's extremely important to get the mirror effect to look good because you'll be looking at it the whole game. For other games you might run into one or two mirrors ever, so it's not worth it to spend time and effort to get that part of the game to look good when you're already running behind in other areas.
The smart thing would just be to not have mirrors, or to have them be broken/dirty so that you can't see your reflection. With small shards of glass or dirty glass (that you couldn't see your reflection in) you can "fake it" using a simple, pre-baked cubemap effect.
[–]betaknight94 3 points4 points5 points 6 hours ago
I'm working to become a game designer and you sir made my day.
[–]mr1337 2 points3 points4 points 10 hours ago
What about making an identical room on the other side of the "mirror" (actually more like a window at this point) and render the player in that space as reverse of the "real" room?
[–]iambeard 5 points6 points7 points 8 hours ago
That's a fairly bad idea, and I have no idea why any level designer or programmer would do that. To explain what Contero suggested a little more, with most modern 3d backends (Direct3d and OpenGL), you have two options for rendering - render to the screen (your monitor), or render to a texture (an in-memory 2d surface). There is also the concept of a camera, which has a position, and also a direction that it's looking, and what this camera sees can either be rendered to the screen or texture.
Contero is saying that the game would need at least two "cameras", one for the player (that's how you can see where you are), and one for the mirror. The player camera renders to the screen, using the position and facing-direction of the player. The simple version of the mirror would have it's own camera, and it is always facing the same direction of the player, BUT it would have to have the opposite "up" angle (to match the behaviour of a real mirror). The mirror's camera would then render to a texture, and that texture would then become the image used for the surface of the mirror.
This isn't actually terribly difficult to do, but as stated, there are many factors as to why a mirror is and isn't used. Some of it is processing power, but the bulk of it is whether or not the developers have the time or experience.
I hope that explains things a little better.
[–]coastercrazy10 -2 points-1 points0 points 9 hours ago
If a developer does choose to use a mirror, then I believe they do that. However, understand that hardware is limited, so rendering the same scene twice can be demanding, especially in a complex one. Also, keep in mind that simply rendering something twice doesn't really solve the multi-mirror problem, as it doesn't necessarily take into account both reflections. As OP says, it would be ideal if there were no mirrors, or if a mirror is a necessity, then only use one. But should such an occasion where multiple mirrors in view of each other are necessary, other considerations must be made. Portal is built around that concept so I'm sure it utilizes some sort of optimization so that the same exact scene isn't rendered multiple times/renders are stacked or ordered somehow, but for most games this would be entirely too much work to be worth it.
[–]superthrowaway1120 1 point2 points3 points 7 hours ago
This is called a Stencil Buffer. You rerender the room in reverse, then make a "window" to the reversed room where the mirror is. It works really well for single, large mirrors, and is probably the technique they used in games like the older Silent Hills. The catch is you need to render everything twice, and it doesn't handle reflecting other mirrors well. Certain other effects don't reflect either, such as the light coming from Heather's flashlight in the first video I put up there.
Sources: Took a college class in computer graphics, got an A
[–]jonathanrdt 1 point2 points3 points 12 hours ago*
Because developers are vampires and do not understand their workings.
Edit: For the record, this is a great explanation.
[–]Dead_Rooster 7 points8 points9 points 9 hours ago
I distinctly remember a working mirror in Duke Nukem 3d which came out in 1996. So surely they do work?
[–]withmorten 0 points1 point2 points 7 hours ago
Read this!
[–]BlueThundah 2 points3 points4 points 7 hours ago*
Raycasting dude. Shit wasn't even in actual 3d the whole time. Crazy stuff.
[–]chewp911 0 points1 point2 points 5 hours ago
Sleeping Dogs has well working mirrors as well.
[–]snakepants 0 points1 point2 points 5 hours ago
You and me both man. I've basically stopped commenting on stuff like this. Too frustrating reading the posts where people go full retard.
I think this is like our little version of when doctors see super-inaccurate stuff in TV shows and are all jhkhfsdfskjhsfsjkhfskh. If you wanna rage go read game tweaking forums about how to "optimize" your game.
[–]Dohr 0 points1 point2 points 3 hours ago
Postal 2 had mirrors
[–]bigguss 0 points1 point2 points 6 minutes ago
AvP from the 90s had a mirror. that game is sweet.
[–]on0bi -3 points-2 points-1 points 8 hours ago*
DX11 supports reflective surfacing, why can't they make a decent mirror?
for the haters that don't know anything:
http://www.youtube.com/watch?v=gbjW57zlVfc
[–]snakepants 2 points3 points4 points 4 hours ago
That demo is cool (download here) but it's not real reflection. It's similar to the old rthdribl demo in that it's mostly a HDR cubemap demo. It has some nice DOF and gem refraction-from-cubemap effects for sure, but there aren't any true mirrors here beyond a single XZ-plane mirroring effect, which is kind of trivial being a single plane and all.
[–]iambeard 1 point2 points3 points 5 hours ago
Now, I could be wrong, as I don't really deal with DirectX, but from my understanding, the reflective surfaces only deal with reflecting light sources, and not textures and polygons. I could be wrong, though.
[–]bakerie -1 points0 points1 point 7 hours ago
Is such bullshit. Duke Nukem Forever is fucking full of mirrors.
[–]BlueThundah -3 points-2 points-1 points 7 hours ago
Proving that mirrors do not make a game great. At all.
[–]bakerie 0 points1 point2 points 6 hours ago
Proving that a game that was full of bugs and released unfinished could have fantastic mirrors. Even smashed ones that still worked.
[–]BlueThundah -1 points0 points1 point 4 hours ago
Maybe they should've focused developmental assets on making the game good.
[–]jamaces -3 points-2 points-1 points 7 hours ago
false. duke nukem was already terrible.
[–]alahos -8 points-7 points-6 points 12 hours ago
Like physicists and magnets?
[–]CoriJane -14 points-13 points-12 points 12 hours ago
in b4 magnets: how the fuck do they work?
[–]alkapwnee 1 point2 points3 points 10 hours ago
inb4...
Everyone keeps using that phrase. I do not think that phrase means what you think it means.
[–]CoriJane -1 points0 points1 point 9 hours ago*
What does it mean then?
EDIT: It wasn't a rhetorical question jackass, as far as I can tell I've used it correctly. I don't give a fuck if you downvote me everytime I use it incorrectly but you could share with us the brilliant knowledge you hold with regards to internet memes and semantics.
[–]InTheSoupTogether 0 points1 point2 points 8 hours ago
In before.... magnets.
all it takes is a username and password
create account
is it really that easy? only one way to find out...
already have an account and just want to login?
login
[–]ramwilliford 31 points32 points33 points ago
[–]Contero[S] 83 points84 points85 points ago
[–]betaknight94 3 points4 points5 points ago
[–]mr1337 2 points3 points4 points ago
[–]iambeard 5 points6 points7 points ago
[–]coastercrazy10 -2 points-1 points0 points ago
[–]superthrowaway1120 1 point2 points3 points ago
[–]jonathanrdt 1 point2 points3 points ago
[–]Dead_Rooster 7 points8 points9 points ago
[–]withmorten 0 points1 point2 points ago
[–]BlueThundah 2 points3 points4 points ago
[–]chewp911 0 points1 point2 points ago
[–]snakepants 0 points1 point2 points ago
[–]Dohr 0 points1 point2 points ago
[–]bigguss 0 points1 point2 points ago
[–]on0bi -3 points-2 points-1 points ago
[–]snakepants 2 points3 points4 points ago
[–]iambeard 1 point2 points3 points ago
[–]bakerie -1 points0 points1 point ago
[–]BlueThundah -3 points-2 points-1 points ago
[–]bakerie 0 points1 point2 points ago
[–]BlueThundah -1 points0 points1 point ago
[–]jamaces -3 points-2 points-1 points ago