# Is there any way for material to know if it is on a mesh that has been mirrored?

**URL:** <https://forums.unrealengine.com/t/is-there-any-way-for-material-to-know-if-it-is-on-a-mesh-that-has-been-mirrored/124267>\
**Category:** UDK Content Creation and Design\
**Tags:** unreal-engine\
**Created:** [March 31, 2019, 12:45pm UTC](https://forums.unrealengine.com/t/is-there-any-way-for-material-to-know-if-it-is-on-a-mesh-that-has-been-mirrored/124267 "2019-03-31T12:45:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathaniel3W](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nathaniel3W](https://forums.unrealengine.com/u/Nathaniel3W)\
**Post date:** [March 31, 2019, 12:45pm UTC](https://forums.unrealengine.com/t/is-there-any-way-for-material-to-know-if-it-is-on-a-mesh-that-has-been-mirrored/124267/1 "2019-03-31T12:45:09Z")

</div>

I have a bunch of materials that tile in world space so the textures stay at a uniform scale when you change the mesh’s scale. Everything was working fine, but I just discovered that if I mirror the mesh, the normals all get reversed. It would be a huge pain for me to try to find every mirrored mesh and unmirror it now. Do you know of a way for a material to know if its mesh has been mirrored? If that’s possible, I’ll just flip the normals in the material.

---

<div class="post-metadata">

**Author:** ![Nathaniel3W](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nathaniel3W](https://forums.unrealengine.com/u/Nathaniel3W)\
**Post date:** [March 31, 2019, 1:51pm UTC](https://forums.unrealengine.com/t/is-there-any-way-for-material-to-know-if-it-is-on-a-mesh-that-has-been-mirrored/124267/2 "2019-03-31T13:51:46Z")

</div>

Turns out it wasn’t that bad finding all of the mirrored meshes. I set a material instance so that the flipped normal would be more obvious, and I went and replaced all of those meshes’ materials with a flipped-normal version of the offending material.

Still, if any of you know how to make a material aware if its mesh has been flipped, I’d be interested in knowing.

---

<div class="post-metadata">

**Author:** ![Avatarus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Avatarus](https://forums.unrealengine.com/u/Avatarus)\
**Post date:** [April 1, 2019, 4:44pm UTC](https://forums.unrealengine.com/t/is-there-any-way-for-material-to-know-if-it-is-on-a-mesh-that-has-been-mirrored/124267/3 "2019-04-01T16:44:04Z")

</div>

Try this. Vector transform will get you DrawSize of your mesh. Then you just need to check if it’s positive in all directions, I guess.

[![](https://i.gyazo.com/fba84c5014ddbe428bceb330d55cf812.png) ](https://i.gyazo.com/fba84c5014ddbe428bceb330d55cf812.png)

---

<div class="post-metadata">

**Author:** ![Nathaniel3W](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nathaniel3W](https://forums.unrealengine.com/u/Nathaniel3W)\
**Post date:** [April 2, 2019, 1:31pm UTC](https://forums.unrealengine.com/t/is-there-any-way-for-material-to-know-if-it-is-on-a-mesh-that-has-been-mirrored/124267/4 "2019-04-02T13:31:38Z")

</div>

Wow. I actually didn’t think this was possible. Thanks!
