Advertisement
snake5

shader compiler?

Aug 28th, 2015
481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.33 KB | None | 0 0
  1. /// CODE
  2.  
  3. STRUCT someStruct
  4. {
  5. float3 a;
  6. float b;
  7. }; // <-- optional
  8.  
  9. BUFFER 0; // set current constant buffer
  10.  
  11. MACRO light N, L = dot(N,L) * someVal * someColor;
  12.  
  13. FUNC light
  14. IN float3 N, float3 L, // the comma should be optional
  15. OUT float factor
  16. {
  17. factor = dot( N, L );
  18. // return factor = dot( N, L ); // -- also accepted
  19. }
  20.  
  21. /// OUTPUT
  22. [USL] Universal Shading Language compiler v0.1
  23. STRUCT ident(someStruct) { ident(float3) ident(a) ; ident(float) ident(b)
  24. ; } ; BUFFER number(0) ; MACRO ident(light) ident(N) , ident(L)
  25. = ident(dot) ( ident(N) , ident(L) ) * ident(someVal) * ident(so
  26. meColor) ; FUNC ident(light) IN ident(float3) ident(N) , ident(float3) ident(L)
  27. , OUT ident(float) ident(factor) { ident(factor) = ident(dot) ( ident(N)
  28. , ident(L) ) ; }
  29. <memory>(3:1): error USL1006: unexpected token
  30. <memory>(4:2): error USL1006: unexpected token
  31. <memory>(4:9): error USL1006: unexpected token
  32. <memory>(4:10): error USL1006: unexpected token
  33. <memory>(5:2): error USL1006: unexpected token
  34. <memory>(5:8): error USL1006: unexpected token
  35. <memory>(5:9): error USL1006: unexpected token
  36. <memory>(6:1): error USL1006: unexpected token
  37. <memory>(6:2): error USL1006: unexpected token
  38. <memory>(8:9): error USL1006: unexpected token
  39. <memory>(10:13): error USL1006: unexpected token
  40. <memory>(10:14): error USL1006: unexpected token
  41. <memory>(10:16): error USL1006: unexpected token
  42. <memory>(10:18): error USL1006: unexpected token
  43. <memory>(10:20): error USL1006: unexpected token
  44. <memory>(10:23): error USL1006: unexpected token
  45. <memory>(10:24): error USL1006: unexpected token
  46. <memory>(10:25): error USL1006: unexpected token
  47. <memory>(10:26): error USL1006: unexpected token
  48. <memory>(10:27): error USL1006: unexpected token
  49. <memory>(10:29): error USL1006: unexpected token
  50. <memory>(10:31): error USL1006: unexpected token
  51. <memory>(10:39): error USL1006: unexpected token
  52. <memory>(10:41): error USL1006: unexpected token
  53. <memory>(10:50): error USL1006: unexpected token
  54. <memory>(13:2): error USL1006: unexpected token
  55. <memory>(13:5): error USL1006: unexpected token
  56. <memory>(13:12): error USL1006: unexpected token
  57. <memory>(13:13): error USL1006: unexpected token
  58. <memory>(13:15): error USL1006: unexpected token
  59. <memory>(13:22): error USL1006: unexpected token
  60. <memory>(13:23): error USL1006: unexpected token
  61. <memory>(14:2): error USL1006: unexpected token
  62. <memory>(14:6): error USL1006: unexpected token
  63. <memory>(14:12): error USL1006: unexpected token
  64. <memory>(15:1): error USL1006: unexpected token
  65. <memory>(16:2): error USL1006: unexpected token
  66. <memory>(16:9): error USL1006: unexpected token
  67. <memory>(16:11): error USL1006: unexpected token
  68. <memory>(16:14): error USL1006: unexpected token
  69. <memory>(16:16): error USL1006: unexpected token
  70. <memory>(16:17): error USL1006: unexpected token
  71. <memory>(16:19): error USL1006: unexpected token
  72. <memory>(16:21): error USL1006: unexpected token
  73. <memory>(16:22): error USL1006: unexpected token
  74. <memory>(18:1): error USL1006: unexpected token
  75. - structs -
  76. <<< someStruct >>>
  77. - macros -
  78. - functions -
  79. <<< light >>>
  80. > IN
  81. > OUT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement