Hello again,
Does mantra have a pixel filter or default AOV to generate a coverage pass or does that have to be done in a shader?
Cheers
John
coverage pass
4046 3 1- protean
- Member
- 72 posts
- Joined: 7月 2006
- Offline
- br1
- Member
- 41 posts
- Joined: 3月 2008
- Offline
- symek
- Member
- 1390 posts
- Joined: 7月 2005
- Offline
br1
Rbg mattes would be an option if there was a way to automate the process for a scene with 200+ objects.
Any tips ?
Python IFD filtering with custom shader:
import sys, mantra
type = sys.argv
def filterInstance():
print ‘Filtering:’, mantra.property('object:name')
mantra.setproperty('object:surface', ‘opdefShop/rgbPass type %s’) % type
Say you save it as ifd_filter.py and call render with -P, like:
mantra -f myframe.ifd -P “/path/ifd_filter.py 1”
You need a shader called rgbPass installed in Houdini. It might look like this:
surface
makeRgbPass(int type=0)
{
int id;
if (!renderstate(“object:id”, id)) id = -1;
if (!type) Cf = id;
else Cf = hsvtorgb(set(random(id), 1, 1));
}
When run with type == 1, it generates a random color based on object's id, otherwise unnormalized id. Some work has to be done to stratify values to avoid overlapping colors. Perhaps hard coded values indexed with ids would be better option.
hth,
skk.
ps code untested…
- sanostol
- Member
- 575 posts
- Joined: 11月 2005
- Offline
-
- Quick Links