cakeslice / Outline-Effect

Outline Image Effect for Unity
MIT License
1.48k stars 201 forks source link

unnecessary draw call and mistakes when submeshes use different texture #44

Closed karsuszhang closed 3 years ago

karsuszhang commented 4 years ago

I found it has many unnecessary draw calls when outline camera render. And if submeshes use different material with different texture, it causes some mistakes, especially when you use mesh to render atlas, like spine object.

It's wierd to render SharedMaterials.Length * (sharedMesh.subMeshCount - 1) times in OutlineEffect's OnPreRender(). I can't get why. So I change the render times to correspond to outline.SharedMaterials.Length 捕获 Everything works fine. Is this a bug or there's some consideration in it ?