Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

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:
    11,588
    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.
unityunity