# Material on Instanced Static Mesh Component turns black when mesh is scaled.

**URL:** <https://forums.unrealengine.com/t/material-on-instanced-static-mesh-component-turns-black-when-mesh-is-scaled/387762>\
**Category:** Rendering\
**Tags:** tiling, artifacts, Instanced-Mesh, unreal-engine, question\
**Created:** [March 13, 2017, 6:19am UTC](https://forums.unrealengine.com/t/material-on-instanced-static-mesh-component-turns-black-when-mesh-is-scaled/387762 "2017-03-13T06:19:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Braffe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Braffe](https://forums.unrealengine.com/u/Braffe)\
**Post date:** [March 13, 2017, 6:19am UTC](https://forums.unrealengine.com/t/material-on-instanced-static-mesh-component-turns-black-when-mesh-is-scaled/387762/1 "2017-03-13T06:19:17Z")

</div>

I made material that subdivides texture coordinates based on object scale. When material is applied on scaled StaticMeshActor, then it works as expected without an issue.

 ![129803-good(staticmeshactor).jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/7/5/f759e32eab5e8e0339437123e63fb805e3552b8a.jpeg)

However, when I put it on the scaled InstancedStaticMeshComponent it breaks and makes material dark and full of artifacts.

 ![129804-bad(instancedstaticmeshcomponent).png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/d/3/0d34ebd769d77866bd318071c5240f0edaf8cbf6.png)

I don’t understand why is that.

Here is the material:

 ![129805-material.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/d/f/6df0b9bc4a084f8e09f312b3b03e9418ff0b5cdb.png)

TileByScale function:

 ![129806-tilebyscale_parta.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/0/e/70e09959466786850314312e49f3c26f6c6555ce.png)

 ![129807-tilebyscale_partb.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/9/429756a977e7dcc13a15aff182ec4eb215c0533a.png)

It gives me warnings inside instance material (image is in the comments due to number of image limitation). It might be the issue, but I don’t know how to fix it. If I change Sampler Type to Grayscale it won’t compile at all and gives me errors.

I would be very grateful for any ideas on how to fix it.  
Thank you.

---

<div class="post-metadata">

**Author:** ![Braffe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Braffe](https://forums.unrealengine.com/u/Braffe)\
**Post date:** [March 13, 2017, 6:20am UTC](https://forums.unrealengine.com/t/material-on-instanced-static-mesh-component-turns-black-when-mesh-is-scaled/387762/2 "2017-03-13T06:20:59Z")

</div>

Material Instance warnings:

 ![129808-instance.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/a/27a04dd9083c8821c6e5f6902beb15a50916e3eb.jpeg)

---

<div class="post-metadata">

**Author:** ![Braffe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Braffe](https://forums.unrealengine.com/u/Braffe)\
**Post date:** [March 13, 2017, 5:37pm UTC](https://forums.unrealengine.com/t/material-on-instanced-static-mesh-component-turns-black-when-mesh-is-scaled/387762/3 "2017-03-13T17:37:16Z")

</div>

Ok, I figured the solution.  
For anyone else having this problem:  
In object viewer under the Build Settings check the “Use High Precision Tangent Basis”.

---

<div class="post-metadata">

**Author:** ![Lesuge](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lesuge](https://forums.unrealengine.com/u/Lesuge)\
**Post date:** [January 9, 2024, 12:21pm UTC](https://forums.unrealengine.com/t/material-on-instanced-static-mesh-component-turns-black-when-mesh-is-scaled/387762/4 "2024-01-09T12:21:02Z")

</div>

Deactivate TwoSided checkbox in the Material  
otherwise the renderer produces black artifacts
