Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • In XPU, the first argument to the OSL getbuiltin() shadeop is ignored. You may continue to specify a first argument in order for your shader to remain compatible with RIS, but the distinction between "primvar", "builtin", and "attribute" that exists in RIS does not exist in XPU.
  • getattribute() calls asking for geometry primvars (in RIS, getattribute("primvar")) are fully supported.
  • getattribute() calls targeting "builtins" (renderer computed quantities that are not directly geometry primvars) are partially supported. Some builtins known to RIS are not currently available in XPU. The most important changes are summarized in the table below. If an alternative is suggested, it means that OSL patterns should be rewritten to use the alternative to be as forward looking as possible.

    BuiltinSupported in XPUAlternative (if possible)
    Puse global P may be preferred
    PRadius
    Po
    Nnuse global N
    Nonsupported, but only if displacement took place
    Ngn

    use global Ng

    Naon

    point Po;
    getattribute("primvar", "P", Po);
    normalize(cross(Dx(Po), Dy(Po)));

    Tn
    Vn, VLen
    curvature
    dPdu, dPdvuse globals dPdu and dPdv
    u, vglobals u and v may be preferred
    st
    du, dvuse 0.5 * Dx(u), 0.5 * Dy(v)
    dPdtime
    time
    id, id2
  • The only getattribute("attribute", ...) lookups that are supported in XPU are "user" and "identifier" attributes (e.g. getattribute("attribute", "user:foo", foo))
  • trace() is not currently supported. Support for a single level of recursion will be added in a future release.
  • Dynamic string construction is not supported.
  • It is possible in some cases that strings within OSL patterns are not properly constant folded, resulting in errors at runtime.
  • Dynamic path construction in your own patterns is not supported, but please note that we do support the following path tokens <UDIM>, <u>, <v>, <U>, <V> and <primstr:varname> that will result in a "dynamic" path to your textures.  <primstr:varname> can be used to reference the value in a constant primvar or user attribute to build a dynamic path.  Also note that <primstr:varname> is not in beta1 for XPU, but will be in a later beta.

...