Question about creating function mirror in-game

Post » Tue May 17, 2011 6:36 am

I'm trying to create a semi-functional mirror in-game, so that you can look at it and see your character's reflection. So far I've played around with material and normal maps, but the closest I've been able to come is a really glossy surface that gives a fairly diffuse reflection of light in the room but nothing else.

What I'm aiming for is a flat surface that gives off a detailed reflection, like the armor in the Lost Paladins of the Divines mod (http://www.tesnexus.com/downloads/images/10505-1190663140.jpg). Copying those settings, however, hasn't worked so far. Is this possible? If so, what sort of settings will it take on the mesh?

P.S. - If I get this working I'll release it as a resource, and whoever helps will get credit in the readme. Thanks!
User avatar
Ebony Lawson
 
Posts: 3504
Joined: Fri Feb 16, 2007 11:00 am

Post » Tue May 17, 2011 11:49 am

Ah... the LPotD doesn't actually reflect the environment. There's a reflection map in the Textures.bsa that the game uses for such surfaces (only windows in vanilla, I think). So, that method is out. I have no idea if it's possible, but you might want to inquire in the OBGE thread :shrug:
User avatar
Katharine Newton
 
Posts: 3318
Joined: Tue Jun 13, 2006 12:33 pm

Post » Tue May 17, 2011 11:41 am



Reflection effect you're speaking of is fake. Its not actually reflecting the world but a shader effect combined with a little texture map of a stand of pine trees. A true mirror requires a cube map and the only place you see that ingame is on water. Appears to be hardcoded in the engine.
User avatar
Russell Davies
 
Posts: 3429
Joined: Wed Nov 07, 2007 5:01 am

Post » Tue May 17, 2011 11:54 am

heres the only way I know of to create a mirror effect

Place an NPC programmed to look like the player in a small room with 3 walls and a "glass pane" aka invisible barrier infront of it to act as the mirror. Make the NPC a static, with a script to wear whatever gear you have on. would'nt be right 100% but in theory it could work.
User avatar
Leticia Hernandez
 
Posts: 3426
Joined: Tue Oct 23, 2007 9:46 am

Post » Tue May 17, 2011 9:52 am

A true mirror requires a cube map and the only place you see that ingame is on water. Appears to be hardcoded in the engine.

A true mirror requires rendering the scene twice: once with the camera "mirrored" over to the other side of the reflecting surface, looking "out" to create the reflected image, then a second time with that reflected image mapped onto the reflecting surface as a texture. There's no need for a cube map when the reflecting surface is flat, but it does require specific support from the engine's rendering code, to render the reflection and use it as a texture source for the final rendering pass. It'd be possible to use the same technique for a flat mirror, but the engine doesn't implement it for meshes, only for water.

A cube map is needed for reflections on non-flat surfaces, where an object reflects its full surroundings. Cube maps aren't tied to "real" reflections, though -- the fake reflection on that LPotD armor is a pre-rendered cube map of generic outdoor surroundings, stored in the textures BSA file as ishmaeltheforsaken said.

It's possible to do true reflections on a convex object like that armor, but it involves rendering the scene seven times every frame, six to build the cube map plus one to render the object with the cube map applied. That's prohibitively expensive in terms of GPU throughput, so game engines don't do it.
User avatar
suniti
 
Posts: 3176
Joined: Mon Sep 25, 2006 4:22 pm

Post » Tue May 17, 2011 11:20 am

become a Vampire. Problem solved!
User avatar
Sheila Reyes
 
Posts: 3386
Joined: Thu Dec 28, 2006 7:40 am

Post » Tue May 17, 2011 1:40 pm

Heh, this is why your character has a mirror in his pocket - just look into your inventory. ;)
User avatar
cassy
 
Posts: 3368
Joined: Mon Mar 05, 2007 12:57 am


Return to IV - Oblivion