rsl.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. Language: RenderMan RSL
  3. Author: Konstantin Evdokimenko <qewerty@gmail.com>
  4. Contributors: Shuen-Huei Guan <drake.guan@gmail.com>
  5. Website: https://renderman.pixar.com/resources/RenderMan_20/shadingLanguage.html
  6. Category: graphics
  7. */
  8. function rsl(hljs) {
  9. return {
  10. name: 'RenderMan RSL',
  11. keywords: {
  12. keyword:
  13. 'float color point normal vector matrix while for if do return else break extern continue',
  14. built_in:
  15. 'abs acos ambient area asin atan atmosphere attribute calculatenormal ceil cellnoise ' +
  16. 'clamp comp concat cos degrees depth Deriv diffuse distance Du Dv environment exp ' +
  17. 'faceforward filterstep floor format fresnel incident length lightsource log match ' +
  18. 'max min mod noise normalize ntransform opposite option phong pnoise pow printf ' +
  19. 'ptlined radians random reflect refract renderinfo round setcomp setxcomp setycomp ' +
  20. 'setzcomp shadow sign sin smoothstep specular specularbrdf spline sqrt step tan ' +
  21. 'texture textureinfo trace transform vtransform xcomp ycomp zcomp'
  22. },
  23. illegal: '</',
  24. contains: [
  25. hljs.C_LINE_COMMENT_MODE,
  26. hljs.C_BLOCK_COMMENT_MODE,
  27. hljs.QUOTE_STRING_MODE,
  28. hljs.APOS_STRING_MODE,
  29. hljs.C_NUMBER_MODE,
  30. {
  31. className: 'meta',
  32. begin: '#',
  33. end: '$'
  34. },
  35. {
  36. className: 'class',
  37. beginKeywords: 'surface displacement light volume imager',
  38. end: '\\('
  39. },
  40. {
  41. beginKeywords: 'illuminate illuminance gather',
  42. end: '\\('
  43. }
  44. ]
  45. };
  46. }
  47. module.exports = rsl;