New pass which renders the same meshes before hand and that should have front face culling turned on

the outline shader renders the character before hand with front face culling turned on, and inside the shader it will expand the character slightly in screenspace so that it’s larger by the size of the outline we want, then we render the character over the top.

So I need to implement something like this , how can we do it. We are using custom shaders

Hey @Mayank_Budhiraja , welcome to the Babylon community.

Babylon has mesh outline built in. You have set the mesh.renderOutline = true in the mesh object (see the following playground: renderOutline - order | Babylon.js Playground)

If you are interested in a more custom solution there a plenty of posts here in the forum from people that already implemented their own solution.

See for example this thread: Custom outline shader - Questions - Babylon.js

And this demo: Outline Post-Process - Demos and projects - Babylon.js

1 Like

Thanks @srzerbetto this really helps

1 Like