shader test ( output color Cout = 0 )
{
vector x = (1, 2, 3);
}
See where this goes wrong? This code will make x be (3,3,3). If you
don't know why, think about how the comma operator works in C, C++, and
related languages.
The user almost certainly meant
vector x = vector (1, 2, 3);
With this change, the original (buggy) code will get the following
warning output:
test.osl:3: warning: Comma operator is very confusing here. Did you mean to use a constructor: x = vector(...)?
4 lines
251 B
Plaintext
4 lines
251 B
Plaintext
test.osl:3: warning: Comma operator is very confusing here. Did you mean to use a constructor: x = vector(...)?
|
|
test.osl:4: warning: Comma operator is very confusing here. Did you mean to use a constructor: = color(...)?
|
|
Compiled test.osl -> test.oso
|