Parts rendered inside-out if camera is flipped horizontally

  1. What do you want to achieve?

I am making a mirror. Changing the camera’s rotation matrix to flip its output horizontally reverses the orientation of triangles, making roblox cull the surfaces that should be visible, and display the surfaces that should be invisible.

  1. What is the issue?

This screenshot shows the issue (please ignore the fact that the part I am standing on should be appearing to touch in the mirror; I have not scaled up the output of the camera correctly yet)
image

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I haven’t come up with anything to implement yet. I need some way to flip the camera’s output horizontally without reversing triangle orientations.

The only working mirror I have seen is by EgoMoose (Mirror - Roblox)
(Note: I am not sure this is working at the moment)
EgoMoose’s mirror works by using super thin wedges to mirror parts (I think; I know he uses thin wedges at least) and manually recreate/reflect surfaces. This does not work for me because I need to render the character, too. I don’t think you could mirror the clothing of the character with this method.

The method I am using is mostly identical to Re-Creating a Portal Effect, - #78 by EmilyBendsSpace, except it is a mirror.

This happens because backwards faces are normally ignored based on their handedness, the order of their points. When you flip the camera matrix, the handedness of any shape on the screen is reversed. All you can do is set the faces to render both sides, which I think is only available for mesh parts, or flip the camera an extra time.

Is it possible to convert parts and (especially) character parts with clothes to meshes on the fly? I can’t flip the camera an extra time, that would remove the mirror effect.

The character is already made of MeshPart so you can turn on DoubleSided for those. MeshParts are almost identical to Part so you can just copy their size and and most properties, but they do not have the Shape property, you will have to manually set their mesh if you want wedges etc.

I’ll try this, and report back.

Any idea how to put a stud texture on a meshpart? I’ve never used meshes before. I pulled a stud texture from the toolbox, and entered it into the TextureId property of the MeshPart, but it doesn’t seem to do anything. I am not sure if this is because the texture is not loaded, or because the viewportframe can’t display textures, or something else.

Here is a screenshot of what I currently have:
image

Another issue I’ve encountered is that setting DoubleSided is limited to plugins and command line. This is fine for the time being though.

After doing some more research, I don’t think it is possible to mirror the character using MeshParts like this, and I don’t think I can easily put studs on MeshParts without manually texturing every part in the mirror. I am considering mirroring parts in 3D space and rotating the character with hopes the player won’t notice that their character is not mirrored.

It’d be great if anyone else could provide input.