Custom Pass Filter other than layer

Hi everyone,

I wanted to add an outline effect to my game and by searching through tutorials and documentation that custom pass volumes are the way to go to achieve this.
However I use gameobject layers rather heavily for physics in my game and I can’t really change layers on interactive objects easily.

Is there a way to supply a different filter to a custom pass instead of layers? An array / list of gameobjects maybe or sth similar?

kind regards

Okay i have not tested it but I wanted to answer my own question. Inside the TIPS example you can find how to draw a single mesh through the commandbuffer of the rendercontext.

protected override void Execute(CustomPassContext ctx)
    {
        if (mesh != null && tipsMeshMaterial != null)
        {
            Transform cameraTransform = ctx.hdCamera.camera.transform;
            Matrix4x4 trs = Matrix4x4.TRS(cameraTransform.position, Quaternion.Euler(0f, Time.realtimeSinceStartup * rotationSpeed, Time.realtimeSinceStartup * rotationSpeed * 0.5f), Vector3.one * size);
            tipsMeshMaterial.SetFloat("_Intensity", 10);
            tipsMeshMaterial.SetColor("_Color", glowColor);
            ctx.cmd.DrawMesh(mesh, trs, tipsMeshMaterial, 0, tipsMeshMaterial.FindPass("ForwardOnly"));
        }

using the default camera matrix and just iterating through a list of meshes / renderers you can render pretty much anything in a custom pass I believe. Although in this case you will probably need to cull the objects yourself (see here? How can I know if a gameObject is 'seen' by a particular camera? - Questions & Answers - Unity Discussions)