Can I do multiple passes on one mesh?

I know that we can do multiple passes on post process on a camera ( Render Target Texture With Multiple Passes | Babylon.js Documentation (babylonjs.com))
But what if I want to do two passes in a single object? As an example, if I want to draw a bigger version of an object on the back (like a outline or highlighter, with flame or halo effect), then draw the original version of it on the top - Am I able to do it without duplicate the mesh?

1 Like

I did that effect in this.

2 Likes

@Sunny you will need to duplicate the mesh mainly to assign a separate material as lots of runtime infos are stored on the mesh/submesh for boosting up rendering. You could easily parent one to the other to keep them in sync and the geometry will be shared (which is good considering it is the memory intensive part.)

4 Likes

Depending on the effect, you wouldn’t even need two passes for it! As an example, we can get a simple outline effect going on using a single shader, without the need of a second mesh. :smiley:
https://cyos.babylonjs.com/#0FY9WJ

3 Likes

I realized that there’s a native support on edge enhancement!
Rendering Edges | Babylon.js Documentation

3 Likes