I had a quick question about local vs external variables. To me it seems like external variables will slow down evaluation due to the map.find(var) as used in the example* ( though maybe there's a more efficient way of handling that ). Have other's who have implemented SeExpr in their apps limited the number of external variables or does the flexibility overshadow the optimization?
The docs also say these are standard variables
Image Variables
• $u, $v -texture coords (scalars)
• $Cs, Source image color (vector)
• $As, Source image alpha (scalar)
Surface Shading or Texturing Activities
• $Cs, Source image color (vector)
• $u, $v -texture coords (scalars)
• $P - surface point (vector). Note: $P is sampled from the Pref geometry (if available)
• $N - surface normal
• $objectId - per-surface unique object Id, typically a small integer
• $frame - current frame number
Would it be safe to assume that these should generally be local variables?
*I'm also assuming that map.find(var) is as slow as map[string] & map.count() but maybe I'm mistaken?
Cheers,
Colin
I think I've misunderstood the intention of local vs. external and probably need to update how I've integrated SeExpr with user variables. In the example setX() and x are defined as local variables and used to pass that value to the expression but I guess using the renderman example might be a better reference?
Cheers
-Andy