Create an outline on a model with Stencils

I was currently looking around panda3d’s manual and haven’t found a good example of how to use stencils with shaders. I’m trying to make a colored outline on a single model using stencils and shaders but am having a hard time understanding how to do it. Does anyone have a good example or some shader code I could replicate?

(Looks like this) (Comes from a tutorial of how to do this using OpenGl)

So far I have found another way to apply this affect using Cartoon Painter, code from 13 years ago, but still works with a few modifications. I would still like to know a better way with the use of stencils.

It’s called cel-shading and yes it’s only way i found too

I’m not sure how to achieve it using stencils. It seems that there is a scaled-up version of the model involved somehow. Do you have the original tutorial? I might be able to tell you how to map the OpenGL calls to the Panda3D equivalent.

Here’s the link to the tutorial:
https://learnopengl.com/Advanced-OpenGL/Stencil-testing