Jump to content

Vex Export parameter Code


rob

Recommended Posts

Has anyone got any advice for adding export parms to shaders using vex code ? The help has not really helped ! .

The code from an example Vop network gives me 3 main areas

// labels

#pragma label paintExport paintExport

#pragma hint paintExport color

#pragma hint paintExport invisible

// declared as part of the shader

export vector paintExport = { 0, 0, 0 };

export vector diffuseExport = { 0, 0, 0 };

export vector specularExport = { 0, 0, 0 };

export vector opacityExport = { 0, 0, 0 };

// bound value

bound_paintExport = isbound("paintExport");

paintExport = product;

I presume the bound value is the most important. I just dont know where to deploy this and in what context . Is there any chance I could have a simple example to look at.

Rob

Link to comment
Share on other sites

Hi Steven,

I know its used for exporting a parameter , but I dont see how I can add "export vector paintExport = { 0, 0, 0 };" then successfully use

bound_paintExport = isbound("paintExport");

paintExport = product;

when I have no value called product in my shader. I presume I could define any value to bound for export but so far with not much success in my code.

rob

Link to comment
Share on other sites

Hey Rob,

You'll have to paste the entire shader code here so we can determine where product is defined. isbound() is used to check whether the geometry has the attribute. If the geometry has the attribute, use the attribute "bound"-ed and override the shader's parameter.

From the VEX help docs:

isbound vex function
Parameters in VEX can be overridden by geometry attributes (if the attributes exist on the surface being rendered).

Hope the above helps!

Cheers!

steven

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