I am working to create a postprocess material that only processes objects with a specific custom stencil. I then want to create instances of that postprocess for as many custom stencils as I have in my scene.
I’ve created a simple material which checks for a custom stencil value, and applies a color to objects with that custom stencil as a test:
I then create two instances of that material with different colors and stencil values:
The issue appears when I have both material instances in my scene at one time.
When both are added to my Post Process Volume, the later instance always “overrides” the previous – meaning when I only have the Pink instance, the sphere is pink. When I add the Blue instance, the Sphere
returns to normal, and the Cube is blue.
When I set the Blend Weight of the Blue postprocess to zero, the sphere goes back to pink. (It doesn’t change at any other blend weight value, only 0 or 1).
I’d like to have the effects of both postprocess materials visible at the same time.
Additional info: If I just duplicate the original material, and put the Original and Duplicate non-instance materials in my postprocess, I get the desired result! But I don’t want to create a new material for each custom stencil.
Any advice appreciated.