Please or Register to create posts and topics.

Mirrors and Mirroring

Page 1 of 2Next

Alright, so I had a new idea for a map that involves mirrors and mirroring object movement. This led me to two questions:

1. Are there any textures that act like a mirror? Like 1:1 reflective glass? I looked in the texture browser and didn't find anything that worked, but I may have missed something.

2. Has anyone ever used logic_mirror_movement? I know you could just parent one object to another, but I saw this entity and was curious if anyone had used it or another method of mirroring object movement.

I remember a small test map where you picked up a cube and put it on a button which was in the back side of the mirror only. However, that map was not here on this site but on myaperturelabs, if I remember correctly. I can't remember its name, though. So I would say yes, some interesting things are possible.

Test Chamber 74:
(percentage calculation sphere self-test failed!)
108.1% done, -8.1% remaining...
Released here!

All maps for Portal (1/2) worth playing are mirrored here.
jwien001 wrote:
Alright, so I had a new idea for a map that involves mirrors and mirroring object movement. This led me to two questions:

1. Are there any textures that act like a mirror? Like 1:1 reflective glass? I looked in the texture browser and didn't find anything that worked, but I may have missed something.

2. Has anyone ever used logic_mirror_movement? I know you could just parent one object to another, but I saw this entity and was curious if anyone had used it or another method of mirroring object movement.

Search for "reflect" in the material browser--there are materials with 10%, 20%, 30%, 40%...etc. reflectivity. They seem to be a bit buggy, though. I made a post somewhere (not sure if it was on this forum) about fully reflective textures a while ago. Didn't get much response, so I did a little digging... I ended up making a straight white texture with the cubemap VMT property. I put it in a map and built cubemaps. The only problem was that it seemed to reflect a much larger version of the map--appearing to extend far beyond the actual map. Best of luck to you, though; the VDC will probably be a big help on this one.

Image
Now with 100% more inline comments!

All 'normal' reflective materials use a pre-calculated cube map for simulating reflections, creating the effect WinstonSmith describes. The cube map is a static 'screenshot' from the position of the nearest env_cubemap entity in the map. Since it doesn't move with the player, on flat surfaces the reflection looks like it's an infinitely big copy of the room.

The only materials that actually render a true reflection are various kinds of water and a few dedicated reflective glass textures. (glass/reflectiveglass001 ~ 003)

The reflective glass textures must be used with a func_reflective_glass entity. Unfortunately, this method of creating a mirror has a few serious drawbacks: the mirror image doesn't show the player, only one mirror surface can be visible at any time and portals are not rendered correctly in the mirror image.

However, there is a way to copy the movement of an object to another object: logic_measure_movement. This can be used, for example, to synchronise the movement of two boxes in two identical chambers (which I would recommend you actually build instead of trying the mirror technique above.) Using a prop_dynamic_override for the second cube seems to work best.

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic

I did not know about logic_measure_movement, but I'll definitely try that out. Thank you!

I did create a mirror using the func_reflective_glass, and I can deal with the drawbacks you listed, but there is one other problem: the image in the mirror is fuzzy/pixelated. Is that due to the texture/entity, or is it some other visual effect?

EDIT: After playing around with the logic_measure_movement, I cannot create the "mirror" effect. The 2 boxes either both get closer to the glass but move along the glass in different directions, or move along the glass in the same direction but when one gets close to the glass the other gets farther away.

jwien001 wrote:
I did not know about logic_measure_movement, but I'll definitely try that out. Thank you!

Neither did I, I just stumbled upon it while looking for movement related stuff :)

jwien001 wrote:
I did create a mirror using the func_reflective_glass, and I can deal with the drawbacks you listed, but there is one other problem: the image in the mirror is fuzzy/pixelated. Is that due to the texture/entity, or is it some other visual effect?

You're right, one other drawback that I forgot to mention is that it looks crappy. The mirror image first gets rendered into a texture, which is then drawn on the surface of the entity. It looks fuzzy because the pixels in the texture don't match up with the pixels on your monitor.

jwien001 wrote:
EDIT: After playing around with the logic_measure_movement, I cannot create the "mirror" effect. The 2 boxes either both get closer to the glass but move along the glass in different directions, or move along the glass in the same direction but when one gets close to the glass the other gets farther away.

I set it up like this:

  1. Create two info_target entities and place them in the mirror plane. Make sure that they are both in the same position and rotated so that the yellow angle indicator line is perpendicular to the mirror.
  2. Edit the "Pitch Yaw Roll" property of one of the targets and change the last number to 180.
  3. In the logic_measure_movement properties, set one target as the measure reference and the other as the movement reference.
  4. Set the movement scale to -1.
Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic

Beautiful! I was trying so much more complicated setups, but that is so simple. Thank you.

Now if only it were possible to get the mirrored object to collide with other objects instead of passing through them, or interact with buttons, but that may be asking too much.

You may be able to fake it by having the 'driver' object collide with something invisible on the player's side of the room, to mimic collision on the mirrored side. (func_clip_vphysics comes to mind.)
As for the buttons, I've no idea...

Oh and by the way: if you have made something cool, publish it in the W.I.P. thread :)

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic
jwien001 wrote:
Beautiful! I was trying so much more complicated setups, but that is so simple. Thank you.

Now if only it were possible to get the mirrored object to collide with other objects instead of passing through them, or interact with buttons, but that may be asking too much.

Parent func_physboxes textured with nodraw/invisible to the mirror objects and shape them so that they're more or less the same (rough) shape. That way, the physboxes will trigger buttons, collisions, etc...

Image
Now with 100% more inline comments!

[quote="HMW"]You may be able to fake it by having the 'driver' object collide with something invisible on the player's side of the room, to mimic collision on the mirrored side. (func_clip_vphysics comes to mind.)[/quote]

I had thought about that, as well as putting a trigger on the player's side to activate the button, but the player would also collide with the invisible object and the box still falls through the button, so the illusion isn't as convincing.

[quote="WinstonSmith"]Parent func_physboxes textured with nodraw/invisible to the mirror objects and shape them so that they're more or less the same (rough) shape. That way, the physboxes will trigger buttons, collisions, etc...[/quote]

I tried that, but the func_physbox still passes through walls and fails to activate the button. I did it both ways, with a prop_dynamic parented to the func_physbox, and the func_physbox parented to the prop_physics, and neither worked.

Page 1 of 2Next