title: Graphics.DrawMesh has wired offset while scaling in Unity, why?
body: <p>I'm implementing after image effect currently and I meet a problem with <code>Graphics.DrawMesh</code>. The code shows below</p>
  <pre><code>public class AfterImage3DByCombine : MonoBehaviour
  {
      public class AfterImange
      {
          public Mesh mesh;
          public Material material;
          // public Matrix4x4 matrix;
          public float duration;
          public float time;
      }
  
      protected SkinnedMeshRenderer[] skinRenderers;
      protected MeshFilter[] filters;
      protected int filtersCount = 0;
  
      public bool IncludeMeshFilter = true;
      public Material EffectMaterial;
  
      public float Duration = 5;
      public float Interval = 0.2f;
      public float FadeoutTime = 1;
  
      private float mTime = 5;
      private List&lt;AfterImange&gt; mAfterImageList = new List&lt;AfterImange&gt;();
  
      protected virtual void Awake()
      {
          skinRenderers = GetComponentsInChildren&lt;SkinnedMeshRenderer&gt;();
          if (IncludeMeshFilter)
          {
              filters = GetComponentsInChildren&lt;MeshFilter&gt;();
              filtersCount = filters.Length;
          }
          
      }
  
      //call from another place to have after image effect
      public void Play()
      {
          if (skinRenderers.Length + filtersCount &lt;= 0)
          {
              return;
          }
      
          mTime = Duration;
          StartCoroutine(AddAfterImage());
      }
  
      IEnumerator AddAfterImage()
      {
          while (mTime &gt; 0)
          {
              CreateImage();
              yield return new WaitForSeconds(Interval);
              mTime -= Interval;
          }
          yield return null;
      }
  
      void CreateImage()
      {
          CombineInstance[] combineInstances = new CombineInstance[skinRenderers.Length + filtersCount];
  
          int index = 0;
          for (int i = 0; i &lt; skinRenderers.Length; i++)
          {
              var render = skinRenderers[i];
              var mesh = new Mesh();
              render.BakeMesh(mesh);
              combineInstances[index] = new CombineInstance
              {
                  mesh = mesh,
                  transform = render.gameObject.transform.localToWorldMatrix,
                  subMeshIndex = 0
              };
  
              index++;
          }
  
          for (int i = 0; i &lt; filtersCount; i++)
          {
              var render = filters[i];
              var temp = (render.sharedMesh != null) ? render.sharedMesh : render.mesh;
              var mesh = (Mesh)Instantiate(temp);
              combineInstances[index] = new CombineInstance
              {
                  mesh = mesh,
                  transform = render.gameObject.transform.localToWorldMatrix,
                  subMeshIndex = 0
              };
  
              index++;
          }
  
          Mesh combinedMesh = new Mesh();
          combinedMesh.CombineMeshes(combineInstances, true, true);
  
          mAfterImageList.Add(new AfterImange
          {
              mesh = combinedMesh,
              material = new Material(EffectMaterial),
              time = FadeoutTime,
              duration = FadeoutTime,
          });
      }
  
      void LateUpdate()
      {
          bool needRemove = false;
          foreach (var image in mAfterImageList)
          {
              image.time -= Time.deltaTime;
              if (image.material.HasProperty(&quot;_Color&quot;))
              {
                  Color color = Color.red;
                  color.a = Mathf.Max(0, image.time / image.duration);
                  image.material.SetColor(&quot;_Color&quot;, color);
              }
              
              Matrix4x4 mat = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, Vector3.one * 2f);
              //public static void DrawMesh(Mesh mesh, Matrix4x4 matrix, Material material, int layer, Camera camera, int submeshIndex, MaterialPropertyBlock properties, ShadowCastingMode castShadows);
              Graphics.DrawMesh(image.mesh, Matrix4x4.identity, image.material, gameObject.layer, null, 0, null, false);
              if (image.time &lt;= 0)
              {
                  needRemove = true;
              }
          }
  
          if (needRemove)
          {
              mAfterImageList.RemoveAll(x =&gt; x.time &lt;= 0);
          }
      }
  
  
  }
  </code></pre>
  <p>Since my prefab has 0.5 times scaling while it's running, then I pass a matrix with two times scaling <code>Matrix4x4 mat = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, Vector3.one * 2f);</code> into
  <code>Graphics.DrawMesh</code>.</p>
  <p>Then, the mesh created by <code>Graphics.DrawMesh</code> isn't in its original position, there is an offset between original mesh and created mesh.</p>
  <p>And if I passed <code>Matrix4x4.Identity</code> into <code>Graphics.DrawMesh</code>, the created mesh will have 0.5 times scaling, which looks smaller than original mesh.</p>
  <p>Why there is an offset and how could I eliminate the offset without chaning the prefab's scale?</p>