public override unsafe void Render(GPUContext context, ref RenderContext renderContext, GPUTexture input, GPUTexture output)
{
// Second pass: draw the model with the outline material
// Get the transform of the actor
Actor.GetLocalToWorldMatrix(out var world);
// Submit the draw call to the render list, which will be handled later in the forward pass
_model.Draw(ref renderContext, _material, ref world, StaticFlags.None, false);
}
This tutorial introduces how to render outline for a model, but how to process animated model?
We don’t have that exposed to C#. I can add a new API that would allow to do it (new task for 1.13 roadmap).
thanks, I can’t wait to see it.
Added new API to 1.13 branch for the next engine update. This will need some code changes to properly collect draw calls so I updated tutorial too:
# HOWTO: Write additional render pass
In this tutorial you will learn how to inject a custom render pass into the pipeline. This technique is widely adopted in a lot of custom effects. This tutorial will implement a Toon-style outline by the method of back face fattening, which requires an additional outline pass after the opaque object is rendered.
## 1. Create the outline material
Firstly, create a new material as the toon outline material. You can do it manually or use Editor and *right-click* in Content window content folder **New -> Material -> Material**.
To implement back face fattening, You have to expand the model by a little through moving the vertex a bit in the direction of the normal. Only back faces of the enlarged model is rendered so that the original model won't be occluded. Open the material and set the Blend Mode to **Transparent** and set the Cull Mode to **Inverted**, **turn off Depth Write**. Then setup the graph as the image below:

## 2. Write rendering code
Next step is to inject a custom render pass by the `PostProcessEffect` class and render it.
Create C# script and add it to the any actor on the scene. You can use [this tutorial](../../scripting/new-script.md) to learn how to do it. Then, write the following code:
```cs
using System.Runtime.InteropServices;
using FlaxEngine;
This file has been truncated. show original
2 Likes