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, particularly if a OSL global exists.

    BuiltinSupported in XPUAlternative (if possible)
    Pglobal P may be preferred
    PRadiususe filterwidth() (scaled to radius if needed)
    Po
    Nnuse global N
    Nonsupported, but only if displacement took place
    Ngn

    use global Ng

    Naon

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

    Tn
    Vn, VLenderive from global I:
    Vn = -normalize(I);
    VLen = length(I);
    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)
    dPdtimeuse global dPdtime, but currently hardcoded to (0, 0, 0)
    timeuse global 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)).
  • getattribute("context") and getattribute("rendererInfo") queries are not supported in XPU.
  • 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 (this feature will be available in 24.1)

...