Larry Gritz <l...@...>
Thanks for the email, Simon!
Yes, OSL already has primitive variables. I agree that it would be handy to have a built-in function that tells you if the particular value is the default, from a connection (not an option in RMan), has an instance value, or is from a geometric primitive value. I've thought of this before, but never got around to it. Thanks for the reminder, we'll add this, it's quite easy.
As for the coordinate systems, that's actually a renderer API issue -- in the RMan world, there is a hierarchical coordinate system being maintained by the renderer as the scene is input (TransformBegin, ConcatMatrix, etc.). The rule is that any point/vector/normal or matrix is always expressed relative to the *current* transformation matrix (CTM), and upon going through the RI interface, is automatically transformed to coordinate system that everything will be shaded in.
This doesn't impact the working of RSL itself, nor does it affect OSL. A renderer using OSL is free to impose this rule, or not, on its API. I've long thought that in RMan-like APIs -- and I always planned to do this with the Gelato API some day, but never did -- there ought to be a way to pass a point/vector/normal *already* in current/common units so that no transformation occurs. I'll remember to do that in the next renderer API I set up. (Whew, let me get this language stable, then maybe I'll move on to that.)
On Feb 4, 2010, at 4:45 AM, Simon Bunker wrote:
Just wondering if you have thought about binding shader parameters to--