I’m running into a problem while trying to create some specific filters. I’d like to determine exactly where a particular geometry is occluded, so I can do special effects on either the occluded or un-occluded sections. However, if I create a special technique for a particular material that supports the effect, other materials don’t necessarily have this technique, so they don’t get rendered at all, and therefore don’t occlude anything.
BloomFilter also suffers from this. If a user creates a material without a glow technique, glow is visible through that material.
The only solution I could come up with (besides requiring every matdef to have a truckload of techniques) is modifying the render manager to support a stack of forced techniques, instead of only one. If a material does not have the first forced technique, it will try the next one in the stack.
Now, if each material definition were given a “black” technique (rendering completely black, with vertex effects), filters like BloomFilter could set the forced technique stack to {glow, black}. Then materials that do not have a glow technique will fall back on the black technique and still occlude whatever glow is behind them.
What do you all think?