# 4.22 Mesh drawing pipline breaks imposter materials

**URL:** <https://forums.unrealengine.com/t/4-22-mesh-drawing-pipline-breaks-imposter-materials/220266>\
**Category:** Rendering\
**Tags:** unreal-engine\
**Created:** [April 12, 2019, 3:18pm UTC](https://forums.unrealengine.com/t/4-22-mesh-drawing-pipline-breaks-imposter-materials/220266 "2019-04-12T15:18:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Klass](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Klass](https://forums.unrealengine.com/u/Klass)\
**Post date:** [April 12, 2019, 3:18pm UTC](https://forums.unrealengine.com/t/4-22-mesh-drawing-pipline-breaks-imposter-materials/220266/1 "2019-04-12T15:18:24Z")

</div>

Hello,

I’ve been using the imposter baker from Ryan Brucks and it used to work in the versions of unreal priory to 4.22.  
I saw that the mesh drawing pipeline has been updated and I’m guessing some code needs to also be re adapted to the new pipeline.

Currently I run into the following error in the material editor:

[SM5] Shader attempted to bind the Primitive uniform buffer even though Vertex Factory FLocalVertexFactory computes a PrimitiveId per-instance. This will break auto-instancing. Shaders should use GetPrimitiveData(Parameters.PrimitiveId).Member instead of Primitive.Member.

Ryan is using some custom code in the material in the WorldtoLoc nodes :

#if USE\_INSTANCING || IS\_MESHPARTICLE\_FACTORY  
return mul(InWorldVector, transpose(Parameters.InstanceLocalToWorld));  
#else  
return mul(InWorldVector, (MaterialFloat3x3)Primitive.WorldToLocal);  
#endif

And also :

#if USE\_INSTANCING || IS\_MESHPARTICLE\_FACTORY  
float3 temp;  
temp.x = length(TransformLocalVectorToWorld(Parameters, float3(1,0,0)));  
temp.y = length(TransformLocalVectorToWorld(Parameters, float3(0,1,0)));  
temp.z = length(TransformLocalVectorToWorld(Parameters, float3(0,0,1)));  
return mul(InWorldVector, (MaterialFloat3x3)transpose(Parameters.InstanceLocalToWorld)) / (temp\*temp);  
#else  
return mul(InWorldVector, (MaterialFloat3x3)Primitive.WorldToLocal);  
#endif

Also the material seems to break at the vertexInterpolator node.

 ![3e491f074e55952b0bc40aa22c5e2263.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/8/e86b91999361a234f8d4dabafb6dd0f32a64f216.jpeg)

As an environment artist, my programming knowledge is abysmal, any help or direction how to solve this issue would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![gabbafoo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gabbafoo](https://forums.unrealengine.com/u/gabbafoo)\
**Post date:** [April 15, 2020, 11:27pm UTC](https://forums.unrealengine.com/t/4-22-mesh-drawing-pipline-breaks-imposter-materials/220266/2 "2020-04-15T23:27:16Z")

</div>

I found a fix for a scaling issue I wanted to share. Test it out if this works for you.  
The screenshot/fix is applied in the function “Impostor\_ThreeFrameBlend” and fixed the scaling issues I had.

Hope this might still help someone.

---

<div class="post-metadata">

**Author:** ![zzzzzzzzz](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zzzzzzzzz/32/88719_2.png) [@zzzzzzzzz](https://forums.unrealengine.com/u/zzzzzzzzz)\
**Post date:** [July 9, 2021, 4:03am UTC](https://forums.unrealengine.com/t/4-22-mesh-drawing-pipline-breaks-imposter-materials/220266/3 "2021-07-09T04:03:58Z")

</div>

That #else statement part that says (MaterialFloat3x3)Primitive.WorldToLocal → you need to replace that parameter with (MaterialFloat3x3)GetPrimitiveData(Parameters.PrimitiveId).WorldToLocal

In all instances of WorldToLoc node. There are 5 of them in total.  
You could use Window-\>Find Results inside the Blueprint and type in “WorldToLoc” into the search bar to locate all of them easily

---

<div class="post-metadata">

**Author:** ![theGreatDW](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thegreatdw/32/961286_2.png) [@theGreatDW](https://forums.unrealengine.com/u/theGreatDW)\
**Post date:** [May 6, 2024, 8:22am UTC](https://forums.unrealengine.com/t/4-22-mesh-drawing-pipline-breaks-imposter-materials/220266/4 "2024-05-06T08:22:32Z")

</div>

As new engine like 5.3 using some old engine Material Functions, there are old nodes call [Local Bounds Max] and [Local Bounds Min], which have been replace by the node [Object Local Bounds], and that’s what causing this same error.  
the solution of my project is replacing all the [Local Bounds Max] and [Local Bounds Min] with [Object Local Bounds] node’s output {Max} and {Min} in material functions fixed the error .

cheers!!!

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/5/e/05eb81c12f8e53eef645944a0a905b5f13ba54d3.png)
