CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
rsl.js150 linesDownload Raw Back to languages
1/*2Language: RenderMan RSL3Author: Konstantin Evdokimenko <qewerty@gmail.com>4Contributors: Shuen-Huei Guan <drake.guan@gmail.com>5Website: https://renderman.pixar.com/resources/RenderMan_20/shadingLanguage.html6Category: graphics7*/8 9function rsl(hljs) {10  const BUILT_INS = [11    "abs",12    "acos",13    "ambient",14    "area",15    "asin",16    "atan",17    "atmosphere",18    "attribute",19    "calculatenormal",20    "ceil",21    "cellnoise",22    "clamp",23    "comp",24    "concat",25    "cos",26    "degrees",27    "depth",28    "Deriv",29    "diffuse",30    "distance",31    "Du",32    "Dv",33    "environment",34    "exp",35    "faceforward",36    "filterstep",37    "floor",38    "format",39    "fresnel",40    "incident",41    "length",42    "lightsource",43    "log",44    "match",45    "max",46    "min",47    "mod",48    "noise",49    "normalize",50    "ntransform",51    "opposite",52    "option",53    "phong",54    "pnoise",55    "pow",56    "printf",57    "ptlined",58    "radians",59    "random",60    "reflect",61    "refract",62    "renderinfo",63    "round",64    "setcomp",65    "setxcomp",66    "setycomp",67    "setzcomp",68    "shadow",69    "sign",70    "sin",71    "smoothstep",72    "specular",73    "specularbrdf",74    "spline",75    "sqrt",76    "step",77    "tan",78    "texture",79    "textureinfo",80    "trace",81    "transform",82    "vtransform",83    "xcomp",84    "ycomp",85    "zcomp"86  ];87 88  const TYPES = [89    "matrix",90    "float",91    "color",92    "point",93    "normal",94    "vector"95  ];96 97  const KEYWORDS = [98    "while",99    "for",100    "if",101    "do",102    "return",103    "else",104    "break",105    "extern",106    "continue"107  ];108 109  const CLASS_DEFINITION = {110    match: [111      /(surface|displacement|light|volume|imager)/,112      /\s+/,113      hljs.IDENT_RE,114    ],115    scope: {116      1: "keyword",117      3: "title.class",118    }119  };120 121  return {122    name: 'RenderMan RSL',123    keywords: {124      keyword: KEYWORDS,125      built_in: BUILT_INS,126      type: TYPES127    },128    illegal: '</',129    contains: [130      hljs.C_LINE_COMMENT_MODE,131      hljs.C_BLOCK_COMMENT_MODE,132      hljs.QUOTE_STRING_MODE,133      hljs.APOS_STRING_MODE,134      hljs.C_NUMBER_MODE,135      {136        className: 'meta',137        begin: '#',138        end: '$'139      },140      CLASS_DEFINITION,141      {142        beginKeywords: 'illuminate illuminance gather',143        end: '\\('144      }145    ]146  };147}148 149export { rsl as default };150 
basant307/AI_Governance_Project · CoolFace