Creating an outline shader in NME. Curious about which technique to employ with the current available nodes

Regarding #1, @Deltakosh gave a solution but I’m not sure it will work with instances.

You can’t composite two (or more) instances in the same shader. Instances exist to minimize the number of draw calls: with a single draw call you can draw the same mesh multiple times, but each instance has its own execution of the shader.

You can’t interact with the stencil buffer from the shader. The stencil buffer is a global state of the engine, you have to interact with it through the suitable engine functions. You have an example of stencil buffer usage here: Mesh intersection by using stencil buffer

3 Likes