Tag Channels 2005-06-01 - By Andy Jones
Back If you're smart about it, you can use each puzzle matte pass to get 3 times as many mattes for your objects. First divide the scene into three partitions with different colors, red, blue and green. Then, for your next puzzle matte, divide the objects in each of the earlier three partitions into three colors, and so on for each additional pass.
Then, to extract the mattes, you extract channels and use minimum operators to narrow down what the matte cuts out with each node. I.e., first you have a third of the scene, then a ninth, and so on for each minimum operation. So, you get 3^N mattes from N matte passes. With four matte passes, you can get 81 mattes. Or if you use the raw and alpha trick, you can get 256.
I think for the Tag channels pass, there's supposed to be a way to get coverage information. I always thought it was supposed to be in the alpha channel, but I seem to get all white alpha channels. Anyway, if it worked, the coverage information would give you the percentage of the pixel that was covered by the most prominent object and you can use that to generate an "more" anti-aliased matte. I think you could also dilate the matte you get from selecting the color and invert the coverage wherever the selected color wasn't the most prominent tag in the pixel to get nice alphas for objects on pixels where they aren't the dominent object. In theory, something along those lines would give you a perfect matte, except where three or more objects were sampled in the same pixel.
I'm pretty sure coverage is one of the frame buffers in Mental Ray, so maybe it would be possible to write out that data in an output shader if there's not another way to get it working.
-Andy
Bernard Lebel wrote:
>I said 3 partitions, not 3 passes :-) > >Pretty much anything involving large scenes is not so simple.... What >I'd do then is to create pass that has as many partitions we need >mattes, basically one third of the partitions being red, another third >being green, and the last third being blue. >Then I would duplicate this pass as many times as required to have >only one partition of the 3 colors visible, hiding the other >partitions. With multi-selection it can be done not so complicatedly. >A strong naming convention for partitions will definitely help. > > >Cheers >Bernard > > >On 6/1/05, kim aldis <kim@(protected)> wrote: > > >>I'd imagine you'd want more than 3 passes. In which case the task of setting >>up might not be so simple. >> >> > > > > >>>>>Why having a script for such a simple task? All you need is 3 >>>>>partitions, each one with either a constant material or >>>>> >>>>> >>>an override >>> >>> >>>>>on the surface input to drive the color you need. >>>>>One partition is red, one is green, one is blue. Very >>>>>straighfforward to setup! >>>>> >>>>> > >--- >Unsubscribe? Mail Majordomo@(protected) with the following text in body: >unsubscribe xsi > > >
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|