vcc changes

   3588   3   0
User Avatar
Member
45 posts
Joined: 7月 2005
Offline
For my shader translator tool I used this in pre-Houdini12 vex function:

void myLight( int illuminateDiffuse; int illuminateSpecular)
{
export int __nondiffuse = illuminateDiffuse == 0;
export int __nonspecular = illuminateSpecular == 0;
}


This code worked fine with Houdini 11 vcc compiler. Now I get a syntax error. It seems that the “export” statement is wrong here now. Is that correct?
renderwiki.com openmaya.net
User Avatar
Member
7743 posts
Joined: 7月 2005
Offline
What is that supposed to do? I thought export was only valid for function parameters? But then I again, I've got no VEX skills.
User Avatar
Member
45 posts
Joined: 7月 2005
Offline
It makes the variable available for other functions and can be used in the lightloop to check if a light should affect specular color or not.

I thought the parameters have to be function parameters, but I simply tried it this way and it worked. So I suppose it was more a unexpected behaviour that it worked at all. And now it works as it has to … and my code does not work any more.
renderwiki.com openmaya.net
User Avatar
Member
1002 posts
Joined: 7月 2005
Offline
This code would have made the __nondiffuse and __nonspecular values local variables in H11, which is likely not what you would expect. To avoid this confusion, the new compiler will only accept the export keyword in the shader formal parameters. This shader should be written as:


light myLight(export int __nondiffuse = 1;
export int __nonspecular = 1)
{
}
  • Quick Links