Search Unity

Using skinned mesh renderer commandbuffer.drawrenderer doesn't work properly

Discussion in 'General Graphics' started by kaimelis, Jul 13, 2018.

  1. kaimelis

    kaimelis

    Joined:
    Apr 28, 2016
    Posts:
    18
    I am trying to do the outline effect with blur by using command buffer. First at the project we used mesh renderers and it was working all fine when i would use commandbuffer.drawrenderer. Now we changed to skinned mesh renderer and it gives my only the body withouth clohtes on top of it. it's all one mesh tho.
    Any advice why this happens??
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,348
    Your skinned renderer is likely using multiple materials. These are individual sub meshes, and DrawRenderer only renders one sub mesh at a time. You need to call DrawRenderer once for each submesh.
     
    Kronnect and kaimelis like this.
  3. kaimelis

    kaimelis

    Joined:
    Apr 28, 2016
    Posts:
    18
    Yes the problem was that it had submeshes. Just had to add a for loop and it fixed everything XD
     
    bgolus likes this.