Jump to content
OdForest

Rendering different groups as passes?

Recommended Posts

Posted (edited)

Hi!

 

I have in the past done rendering with object ID's in 3DS Max with which i could simply isolate these objects in AE, but the stuff i find about this with Houdini is quite confusing to me. I would like some basic instructions.

How do i have different passes in which only (the visible of) an object is visible? I would like these objects to be certain groups that are extant in my SOP level.

 

Help would really be appreciated!

Edited by that Abstract guy

Share this post


Link to post
Share on other sites
Posted (edited)

Hi
You might need to convert your groups into regular attributes. Check out the attached file to see how attributes on an object travel through a bind and bind export in the shader and is picked up in the aov section on the mantra node.
I tried with groups but i couldnt figure out how to bind it through the shader.

-b

aov.hiplc

 

Edited by bonsak
  • Thanks 1

Share this post


Link to post
Share on other sites

you can work with groups in shader via inGroup VOP - boolean output indicates membership (which basically is a mask for that group)

  • Thanks 1

Share this post


Link to post
Share on other sites
10 hours ago, bonsak said:

You might need to convert your groups into regular attributes. Check out the attached file to see how attributes on an object travel through a bind and bind export in the shader and is picked up in the aov section on the mantra node.

I tried to recreate that file and as far as i know i have the same settings, but it doesn't work. Do you maybe know what i do wrong?

AOV namaken.hipnc

3 hours ago, davpe said:

you can work with groups in shader via inGroup VOP - boolean output indicates membership (which basically is a mask for that group)

How would you do that? I can't specify a path to my /obj/grid_object1 in the geometry file parameter. And: do you also need to bind export that?

 

Thanks u both! And sorry for my noobness, haha.

Share this post


Link to post
Share on other sites

You need to give the attribute a value. In your file its is set to zero.

FfPml7u.png

  • Thanks 1

Share this post


Link to post
Share on other sites

actually, you can't read groups directly as i thought, but you can easily convert them to a string attribute and read that:

 

groups.gif

groups.hiplc

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

5c9b5224b529b_Screenshot2019-03-27at11_36_12.png.cc1331ed55a43337ba946ae1a54bf128.png Allright, got it.

But how would you do this when you have something like a Principled shader? Or multple different shaders?

I think that Material Builder in these files just needs to applied to the geometry, right?

Also: Can you only output an alpha?

In the past i think i got an colored output of the object ID's just as it was in the normal render. But i might be wrong about this. (Got no access to that exr right now)

Edited by that Abstract guy

Share this post


Link to post
Share on other sites
Posted (edited)
On 27/03/2019 at 3:12 PM, anim said:

You can use cryptomatte to output custom ID's 

http://www.sidefx.com/docs/houdini/render/cryptomatte.html

Ah I see. And is all the stuff discussed in this thread also applicable to CryptoMatte? How would you get a group cryptomatte layer? It doesn't work with VEX Variable it seems?

Edited by that Abstract guy

Share this post


Link to post
Share on other sites
3 hours ago, that Abstract guy said:

How would you get a group cryptomatte layer? It doesn't work with VEX Variable it seems?

You would use Material Stylesheets similar to the instancing example, as Stylesheets can Target groups, but obviously it'll be more flexible to use string attribute instead of groups and directly base your cryptomatte property on its values

  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)
On 09/04/2019 at 1:15 AM, anim said:

but obviously it'll be more flexible to use string attribute instead of groups and directly base your cryptomatte property on its values

I'm now going deeply into investigation on what Stylesheets are and how they work: Does this second method you've mentioned also involve Stylesheets or is it something different?

Which example do you mean with string attribute? The first example (aov.hiplc) does it with float attributes.

And with the first (Stylesheet) method, would the group mattes just appear in the CryptoMaterial layer? Or do you need to make a material for every group? I would like the object to have one material but more group mattes. Doesn't the matte styles override the material?

Edited by that Abstract guy

Share this post


Link to post
Share on other sites
Posted (edited)

Oh do you mean the instancing example of the SideFX Documentation? Do I need to understand the 'Render property' and 'Inline Script' stuff for this Group/Cryptomatte/Stylesheet method?

Edited by that Abstract guy

Share this post


Link to post
Share on other sites
Posted (edited)

Please someone help. I am just confused here. How do I get these 'string attributes' that I apparently should be able to use as user properties in a Cryptomatte layer?

When I use the 'name's generated for the groups by the name SOP in the CryptoMatte, it doesn't work. And it seems the Attribute Create SOP to create a string attribute for my groups doesn't work either. When I put these attribute names in the Property parameter of a Cryptomatte layer, the layer shows up but it doesn't seem to have any white mattes in it.

 

 

Edit:

I've made a new post for this now:

 

Edited by that Abstract guy

Share this post


Link to post
Share on other sites

hey, I can't help you getting the result with stylesheets+cryptomatte. you can, however, inspect the attached scene that's doing more-less the same thing in more simplistic way.

steps I have done in the scene:

1 - build your groups

2 - convert them to primitive string attribute with Name SOP

3 - loop over the named primitives with For-Each loop (which is basically looping over your groups as the attribute is based on those)

4 - inside loop, generate random colors based on current iteration number, so you end up with random colors per group

5 - bind the color attribute into a shader that's applied to your geometry (or convert the color to some arbitrary attribute) and render that instead of cryptomatte

it only have one caveat which may, or may not matter, depending on what you doing - if you've got two objects with the same group names, it may not result in the same colors (as the resulting color is not based on group name, but rather on loop iteration number)

if you want to retain certain colors for certain group names over more objects, just use the solution i shared before, only you have to assign a color to each particular result. obvious disadvantage here is that with many groups it would be a lot of manual work to do. but if you only have a few groups, this is the most straightforward way i can think of.

in the attached scene there are both approaches, you can swap the result of random and manual in the shader. if you need to do this across more shaders, you will have to copy that over to the other shaders as well - but that shouldn't be a big deal.

stylesheets + cryptomatte probably provide more comprehensive solution but also the most technical, with cvex scripting involved

 

groups_id.hiplc

groups_id.PNG

Share this post


Link to post
Share on other sites

stylesheets example:

 

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×