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?
vcc changes
3588 3 0- haggikrey
- Member
- 45 posts
- Joined: 7月 2005
- Offline
- edward
- Member
- 7743 posts
- Joined: 7月 2005
- Offline
- haggikrey
- 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.
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.
- andrewc
- 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)
{
}
light myLight(export int __nondiffuse = 1;
export int __nonspecular = 1)
{
}
-
- Quick Links