Jump to content

parameterVop export


MENOZ

Recommended Posts

hello

i see in many of the default shaders there are some ParameterVOP nodes with the export flag. names like diffuseExport, paintExport... ecc

in the help i read that the export flag "Specifies whether the new parameter can be exported to other contexts". but i don't undestand how and where they are used.

can you help me?

Link to comment
Share on other sites

Parameters flagged for Export can be picked up by other shaders plus they can be used to generate extra image layers/AOV's/Image Channels at render time.

Export variables between shaders has a somewhat fixed path.

Surfaces can import export parameters from displacement shaders (dimport()), light shaders (limport()).

Lights can import the export parameters from displacement shaders (dimport()), surface shaders (simport()).

Fog Shaders can import the export parameters from displacement shaders (dimport()), light shaders (limport()), surface shaders (simport()).

As for rendering these export parameters as extra channels (AOV's) all you need to do is add an extra image plane in the Mantra ROP and provide the same name as the attribute and make sure the type matches. As well you need to manage the bit depth of the plane and the filtering. 16bit float with gaussian 2x2 is the default for the default render.

This is what these export parameters are for in the shaders. See the attached hip file for an example of this. Render from Mantra1 and you will see all the export parameters available for basic surface and reflect displace materials.

basic_all_light_exports_v01.hip

Link to comment
Share on other sites

From a technical standpoint it is real easy to add these yourself. Just go to the parameter gear menu and choose "Edit Parameter Interface". Find the vm_variable_plane# parameter and in the Menu folder on the right add your own default names and labels.

From a general standpoint, this would mean nailing down a naming convention, something that is not to be taken lightly. If there is a general consensus among the users of Houdini that the names currently used as global light export parameters are good, then it would be a safe bet to add these to the default Mantra Output Driver:

paintExport

diffuseExport

specularExport

reflExport

opacityExport

For per light Exports (currently not implemented in the default materials), you could do:

diffuseExportPerlight

colorExportPerlight

specularExportPerlight

speccolorExportPerlight

Link to comment
Share on other sites

oh thank you!

is there a way to import a parameter in a dispacement shader?

say i want to use a noise pattern as a color and use it as a displacement too. i should import the noise pattern into the displacement shader, right? how can i do this?

Link to comment
Share on other sites

Unfortunately you can't with Mantra.

Displacements are run on the geometry before any lighting and shading is done.

To get around this limitation, you need to have a tight coupling between your displacement shader and your surface shader. Your displacement shader will contain the pattern generation (noise in your case) and use a Parameter VOP to export your noise amplitude. The surface shader will then use the Import Displacement Variable VOP to pick up the Displacement Shader's export variable.

Take a look at the Noise Displacement material. Inside the material, in the displacement shader SHOP you will find a Parameter VOP called pattern_Export (the node with the deep green color). It creates an export parameter variable called "pattern" of type "float". Now look inside the surface SHOP. You will find an Import Displacment Variable VOP called "dimport_pattern". This is used to import the variable name "pattern" of type "float" being exported by the displacement shader.

Materials makes it convenient to create and manage displacement and surface shader export-import relationships.

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...