- Home /
Is there a way to render a SkinnedMesh a second time with another material in a frame?
High Level: Is there any way to render a skinned mesh a second time in a frame with an alternate material? Details: Hoping someone can help me, but I'm worried what I want isn't possible, at least not in an efficient way.
I am trying to make an overlay system, meaning a way of rendering an object a second time with another material to get layered effects to play on the object.
I have been able to get this to work fine using Graphics.DrawMesh() on regular MeshFilters, but I am hitting a wall with SkinnedMeshRenderers.
My solution so far was to use BakeMesh() every frame to generate a mesh that could then go through the DrawMesh() path. While this works, the profiler shows me (unsurprisingly) that it is very slow, not a good solution.
So, does anyone have any ideas? Pulling my hair out.
Well, for anyone else who wants to do this, ThermalFusion offered the following solution in the forums:
Basically you duplicated the skinned mesh object, make it a child of the original skinned mesh, and replace its materials with the one desired for the new layer.
Apparently the child Skinned$$anonymous$$eshRenderer is animated the same as the parent, so the overlay will match.
There's also this guy, which may be of some use http://docs.unity3d.com/ScriptReference/Graphics.Draw$$anonymous$$esh.html
Your answer

Follow this Question
Related Questions
Why is the CPU usage so high? 1 Answer
Graphics.DrawTexture vs GUI.DrawTexture vs Graphics.Blit 0 Answers
Problems with rendering Particles 0 Answers
Smoothing Directionally between three materials 1 Answer
How do I make a boat that doesn't let water enter?,How do I make a boat that water cant get in to 2 Answers