Guest User

Untitled

a guest
Feb 17th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. // vmath = float, vector, matrix
  2. // matrix = float3x3 or float4x4
  3. // scalar = float, vector
  4. // vector = float2, float3, float4
  5. // any = int, float, float2, float3, float4, matrix, bool, object
  6.  
  7. //======================================================
  8. // basic math
  9. //======================================================
  10. vmath radians(vmath value);
  11. vmath degrees(vmath value);
  12.  
  13. //======================================================
  14. // Trig
  15. //======================================================
  16. @Cosine
  17. vmath cos(vmath value);
  18. @ArcCosine
  19. vmath acos(vmath value);
  20. @Sine
  21. vmath sin(vmath value);
  22. @ArcSine
  23. vmath asin(vmath value);
  24. @Tang
  25. vmath tan(vmath value);
  26. @ArcTan
  27. vmath atan(vmath value);
  28. @ArcTan2
  29. vmath atan2(vmath y, vmath x);
  30. @Hyperbolic Cosine
  31. vmath cosh(vmath value);
  32. @Hypberbolic Sine
  33. vmath sinh(vmath value);
  34. @Hypberbolic Tan
  35. vmath tanh(vmath value);
  36.  
  37. vmath pow(vmath x, fmath y);
  38. vmath exp(vmath x);
  39. vmath exp2(vmath x);
  40. vmath log(vmath x);
  41. vmath log2(vmath x);
  42. vmath sqrt(vmath x);
  43. vmath rsqrt(vmath x);
  44.  
  45. vmath abs(vmath x);
  46. vmath sign(vmath x);
  47. vmath floor(vmath x);
  48. vmath ceil(vmath x);
  49. vmath frac(vmath x);
  50. vmath fmod(vmath x, vmath y);
  51.  
  52. vmath round(vmath x);
  53. vmath min(vmath x, vmath y);
  54. vmath max(vmath x, vmath y);
  55. vmath clamp(vmath val, vmath min, vmath max);
  56. vmath lerp(vmath a, vmath b, float t);
  57. vmath step(vmath a, vmath b);
  58. vmath smoothstep(vmath edgeA, vmath edgeB, vmath x);
  59. @Truncate
  60. vector trunc(vector v);
  61.  
  62. float length(vmath x);
  63. float distance(vmath p0, vmath p1);
  64. vector dst(vector a, vector b);
  65. float dot(scalar x, scalar y);
  66. float3 cross(float3 x, float3 y);
  67. vector normalize(vector v);
  68. float determinant(matrix m);
  69. matrix transpose(matrix m);
  70.  
  71. @Face Forward
  72. scalar faceforward(scalar N, scalar, I, scalar nRef);
  73. scalar reflect(scalar I, scalar N);
  74. scalar refract(scalar I, scalar N, float eta);
  75.  
  76. //void clip(scalar below);
  77. float ddx(scalar coord);
  78. float ddy(scalar coord);
  79. @Is Infinite
  80. bool isinfinite(scalar value);
  81. @Is Not a Number
  82. bool isnan(scalar value);
  83. scalar saturate(scalar value);
  84.  
  85. float3 GetSpecularIBL(float3 val, float3 oVal) {
  86. return val * oVal + distance(val, oVal);
  87. }
  88.  
  89. //float4 tex1D(sampler1D, float);
  90. //float4 tex2D(sampler2D, float2);
  91. //float4 tex3D(sampler3D, float3);
  92. //float4 texCUBE(samplerCUBE, float3);
  93. //float4 tex1Dbias(sampler1D, float4);
  94. //float4 tex2Dbias(sampler2D, float4);
  95. //float4 tex3Dbias(sampler3D, float4);
  96. //float4 texCUBEbias(samplerCUBE, float4);
  97. //float4 tex1Dgrad(sampler1D, float, float ddx, float ddy);
  98. //float4 tex2Dgrad(sampler2D, float2, float ddx, float ddy);
  99. //float4 tex3Dgrad(sampler3D, float3, float ddx, float ddy);
  100. //float4 texCUBEgrad(samplerCUBE, float2, float ddx, float ddy);
  101. //float4 tex1Dlod(sampler1D, float4);
  102. //float4 tex2Dlod(sampler2D, float4);
  103. //float4 tex3Dlod(sampler3D, float4);
  104. //float4 texCUBElod(samplerCUBE, float4);
  105. //float4 tex1Dproj(sampler1D, float4);
  106. //float4 tex2Dproj(sampler2D, float4);
  107. //float4 tex3Dproj(sampler3D, float4);
  108. //float4 texCUBEproj(samplerCUBE, float4);
Add Comment
Please, Sign In to add comment