Jump to content

AOVs in VEX shaders


j00ey

Recommended Posts

Hi

 

This is probably a dumb question, and makes me realise how little I really know about SHOPs.

 

I have a scene with various shaders that I built myself with material shader builder nodes and I'm exporting a few AOVs inside. I just attached a constant shader to something though and realised I have no idea how to get it to output my additional image planes, and also I don't really know what this type of shader is and why it has a Surface Shader output... The only thing I can attach it to seems to be an Output Shaders node but I can't figure out what else I can plug into that to get my AOVs.

 

Does anyone have a couple of minutes to explain A - what they are [the shaders with the stripy baseball icon - VEX shaders?] and B -how to get them to write extra planes? I know I can go in the type properties and see the code but I'm uncertain whether that's the way to go about it or if I'm missing something obvious...

 

I hope someone can enlighten me...

Link to comment
Share on other sites

Hi

 

Thanks for the reply. Good old Peter Quint!

 

I had a quick scrub through those and I may be missing something but they appear to be about VOP materials, it's the ones that you can't dive inside and edit that I'm a bit confused about, see pic. I know how to edit VOPs and get my AOVs out of there but how would I go about getting say an ID pass out of something with Gingham Checks applied?

post-9168-0-97065100-1426708178_thumb.jp

Link to comment
Share on other sites

Hi

 

Simply define the variable as export in the surface shader and assign a value. For example:

#pragma hint uv hidden
#pragma hint Cd hidden
#pragma hint myAOV hidden

surface mySurfaceVEX(
// IMPORTS
vector  uv = 0;
vector  Cd = 0;

// PARAMETERS
float   ior_i = 1;

// EXPORTS
export vector myAOV = 0;)
{
myAOV = normalize(N);
}

The #pragma's are "cosmetic", this tells Houdini not to show those variables as parameters.

Link to comment
Share on other sites

Thanks Dany. I will look into that.

 

By the way I haven't had chance to try your layered PBR shader on my new machine yet in case that clears up the errors. I'll do that soon as I get chance, after the weekend probably.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...