Mirrors!

Post » Sat Feb 19, 2011 10:48 am

A few years back I posted here, wondering if ingame reflective mirrors was possible, which it wasn't back then.

So how about now; would it be possible to somehow get an ingame reflective mirror, fully working and reflecting pretty much everything? Have things (OBSE/OBGE/etc) evolved/matured enough or is it a hopeless dream? ;_;
User avatar
Laura Hicks
 
Posts: 3395
Joined: Wed Jun 06, 2007 9:21 am

Post » Sat Feb 19, 2011 8:29 am

A few years back I posted here, wondering if ingame reflective mirrors was possible, which it wasn't back then.

So how about now; would it be possible to somehow get an ingame reflective mirror, fully working and reflecting pretty much everything? Have things (OBSE/OBGE/etc) evolved/matured enough or is it a hopeless dream? ;_;

Hopeless dream
User avatar
Anna S
 
Posts: 3408
Joined: Thu Apr 19, 2007 2:13 am

Post » Sat Feb 19, 2011 11:21 am

Not hopeless, just pointless. While it's not unimaginable that at some point we could get the ability to make mirrors, the computing cost that they have makes them unfeasible really.
User avatar
Jessica Lloyd
 
Posts: 3481
Joined: Fri Aug 25, 2006 2:11 pm

Post » Sat Feb 19, 2011 10:32 am

Not hopeless, just pointless. While it's not unimaginable that at some point we could get the ability to make mirrors, the computing cost that they have makes them unfeasible really.


Well... I don't know about this. Im not sure how it was done but I remember a few years back playing doom 3 and laughing when i saw my characters reflection in the mirror. Not sure how ID soft did it but im sure it could be done somehow.
User avatar
Emerald Dreams
 
Posts: 3376
Joined: Sun Jan 07, 2007 2:52 pm

Post » Sat Feb 19, 2011 5:31 am

There were mirrors in Prey, as far as I remember.
User avatar
Amy Smith
 
Posts: 3339
Joined: Mon Feb 05, 2007 10:04 pm

Post » Sat Feb 19, 2011 4:07 am

I don't see why their implementation would be heavy on the performance - We already see decent looking water in recent games that perform fairly well.
User avatar
Rachie Stout
 
Posts: 3480
Joined: Sun Jun 25, 2006 2:19 pm

Post » Sat Feb 19, 2011 5:48 am

Mirrors involve rendering the entire scene twice: once for the reflected view, and then again for the normal view using the refleced view as a texture on the mirror surface. That cuts your framerate in half as long as the mirror is in view, though you can reduce the impact of rendering the reflected view by leaving some things out of it. (The game's water acts as mirror, but it omits things like rocks and trees in the reflection unless you turn them on in the INI file.)

Things get tricky if there's a possibility of multiple mirrors. If there are two mirrors in the scene and you're not concerned about the possibility of one of them being reflected in the other, you have to render the scene three times, once for each of the two mirrors plus once for the final view. If you need to account for double reflections, you have to render the scene five times, cutting your framerate to 20%: once for mirror A's reflection as seen reflected in mirror B, once for mirror B's reflection as seen reflected in mirror A, then once each for the two mirrors' single reflections, then the final finished image. Adding more mirrors makes the number of necessary rending passes grow exponentially.

Most games that use mirrors use them only sparingly, in places where there isn't lots of geometry in view so the cost of rendering the scene twice isn't too high, and only one mirror is visible at a time so that it's never necessary to render the scene more than twice. Since Oblivion already renders the water's surface as a mirror, any additional mirrors in cells with water would need to be placed carefully to avoid any possibility of multiple reflections, and the additional rendering needed (three passes instead of two) might have a noticeable impact.
User avatar
Erika Ellsworth
 
Posts: 3333
Joined: Sat Jan 06, 2007 5:52 am

Post » Sat Feb 19, 2011 1:44 am

That's interesting to hear Wyzard.

So, theoretically there's no reason why an uncluttered interior such as a modded room in a house couldn't have at least one mirror, so my character can admire himself. I always play in first person, and it'd be quite cool to see the character in-game!

And RichardRocket I'm surprised at your lack of optimism! You're usually one of the most enthusiastic and optimistic members of the forum! Over the years I've seen so many people being told that things were impossible in Oblivion only to have them proved wrong time and time again. Only yesterday Kyoma came up with MenuQue, which could make possible a mod that I was told was impossible only a couple of years ago!

Of course there are limitations, but the imagination, invention and technical skills of this community are quite staggering sometimes - and a huge thank you to those who try and push the envelope!
User avatar
Honey Suckle
 
Posts: 3425
Joined: Wed Sep 27, 2006 4:22 pm

Post » Sat Feb 19, 2011 8:03 am

So, theoretically there's no reason why an uncluttered interior such as a modded room in a house couldn't have at least one mirror, so my character can admire himself. I always play in first person, and it'd be quite cool to see the character in-game!

This is what I had in mind too. It would be awesome not having to go into 3rd person or my inventory to see how my character looks, even if it cuts framerates in half. Personally I get quite high framerates in interiors.

So, if we put performance issues aside (excluding unplayable performance issues of course, < 10 fps and so on); does the engine allow mirrors without resorting to ugly hacks such as modding the water or something like that? Would it be possible? Anyone with more modding/Gamebryo knowledge than me that could have a guess?
User avatar
Jonathan Braz
 
Posts: 3459
Joined: Wed Aug 22, 2007 10:29 pm

Post » Fri Feb 18, 2011 11:13 pm

And one might not feel the need to have the background reflected, just the PC and NPC maybe, keep the background a blur.

I will survive without mirrors though.... :P
User avatar
Czar Kahchi
 
Posts: 3306
Joined: Mon Jul 30, 2007 11:56 am

Post » Sat Feb 19, 2011 8:05 am

So, if we put performance issues aside (excluding unplayable performance issues of course, < 10 fps and so on); does the engine allow mirrors without resorting to ugly hacks such as modding the water or something like that? Would it be possible? Anyone with more modding/Gamebryo knowledge than me that could have a guess?

The engine does not have built-in support for mirrors. It would be technically possible to render the scene using a reflected camera position/direction to a texture and then use that rendered texture in the scene, but it would take a very large amount of work. Quick guesstimates as to the difficulty of everything needed:

- move the camera (probably implemented by creating a new NiCamera to work with so the game code doesn't try to do anything with it rather than actually moving the main render cam): easy
- create new render targets: pretty easy
- render the scenegraph via the new camera: medium, given the possibility of Weird Things happening
- only render objects in front of the mirror plane: hard - imagine that you have two neighboring rooms, with a mirror on the wall separating the two. If you drop a camera at the reflection point, it will end up inside the other room, giving totally incorrect results
- make sure the player is rendered in "3rd-person" mode so most of the model isn't hidden: hard, not sure how the gameplay code handles this switch; easier if it doesn't require running a full resync of the scene graph vs. gameplay code state
- handing multiple mirrors: ahahaha no, if you have more than one, pretend it doesn't exist and use a placeholder texture for its reflection result
- handling mirrors with water: if you put a mirror in an exterior cell then the world will collapse in on itself
- using the rendered texture in the scene when drawn from the main camera later: unknown, there is an NiRenderedTexture class, but I'm not sure how to hook it up

So, a lot of work, but stuff like this is one of the reasons I am going through and documenting netimmerse in the OBSE source code. (ignoring the past of being busy with work)

(also no, I am not volunteering to do this, just giving my thoughts on what would be needed to actually get it running)
User avatar
hannah sillery
 
Posts: 3354
Joined: Sun Nov 26, 2006 3:13 pm

Post » Sat Feb 19, 2011 9:05 am

crysis apparently has a material that does real reflections. apparently you can set reflection distance and detail level, so it doesn't completely kill fps. Ideally we'd want something like that. But without native support it is a bit of a beast...
User avatar
Hayley Bristow
 
Posts: 3467
Joined: Tue Oct 31, 2006 12:24 am

Post » Sat Feb 19, 2011 1:43 am

Mirrors involve rendering the entire scene twice: once for the reflected view, and then again for the normal view using the refleced view as a texture on the mirror surface. That cuts your framerate in half as long as the mirror is in view, though you can reduce the impact of rendering the reflected view by leaving some things out of it. (The game's water acts as mirror, but it omits things like rocks and trees in the reflection unless you turn them on in the INI file.)
...
Gah :facepalm: I must have been high - Can't believe I didn't think it through.
User avatar
Dustin Brown
 
Posts: 3307
Joined: Sun Sep 30, 2007 6:55 am


Return to IV - Oblivion