Jump to content

Shading Layers inside vex


stevegh

Recommended Posts

Fun thought to leave you gents with on this lovely Friday:

How can I specify which shading layer to use inside a material written in VEX? I know we can grab the shading layer VEX node and pop that in to the texture s/t we want, but viewing the code that this generates leads me to believe that there have to be pragmas for each uv layer:


#pragma label uv "UV Coordinates"
#pragma hint uv hidden
#pragma hint uv vector
#pragma label uv4 "UV Coordinates"
#pragma hint uv4 hidden
#pragma hint uv4 vector
#pragma label uv3 "UV Coordinates"
#pragma hint uv3 hidden
#pragma hint uv3 vector
#pragma label uv2 "UV Coordinates"
#pragma hint uv2 hidden
#pragma hint uv2 vector
[/CODE]

followed by some lame if cases:

[CODE]
string layer;
if(DSL>1)
{layer = itoa(DSL);}else{layer = "";}
bound_uv = isbound("uv" + layer);
if( bound_uv ) {
if(layer == "") {uv1 = uv;}
if(layer == "2") {uv1 = uv2;}
if(layer == "3") {uv1 = uv3;}
if(layer == "4") {uv1 = uv4;}
} else {
uv1 = set(s, t, .5);
}
[/CODE]

and even this doesn't seem to work.

Am I incorrect?

Have a good weekend ya'll!

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