Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2014
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. #version 150
  2.  
  3.  
  4.  
  5.  
  6. #extension GL_ARB_sample_shading : enable
  7. #define SAMPLER_BINDING(x)
  8.  
  9.  
  10. #define float2 vec2
  11. #define float3 vec3
  12. #define float4 vec4
  13. #define uint2 uvec2
  14. #define uint3 uvec3
  15. #define uint4 uvec4
  16. #define int2 ivec2
  17. #define int3 ivec3
  18. #define int4 ivec4
  19. #define frac fract
  20. #define lerp mix
  21.  
  22.  
  23. struct Light {
  24. int4 color;
  25. float4 cosatt;
  26. float4 distatt;
  27. float4 pos;
  28. float4 dir;
  29. };
  30. layout(std140, binding = 2) uniform VSBlock {
  31. float4 cpnmtx[6];
  32. float4 cproj[4];
  33. int4 cmtrl[4];
  34. Light clights[8];
  35. float4 ctexmtx[24];
  36. float4 ctrmtx[64];
  37. float4 cnmtx[32];
  38. float4 cpostmtx[64];
  39. float4 cDepth;
  40. };
  41. struct VS_OUTPUT {
  42. float4 pos;
  43. float4 colors_0;
  44. float4 colors_1;
  45. float3 tex0;
  46. float4 clipPos;
  47. };
  48. in float4 rawpos; // ATTR0,
  49. in float4 color0; // ATTR5,
  50. in float2 tex0; // ATTR8,
  51. centroid out float3 uv0;
  52. centroid out float4 clipPos;
  53. centroid out float4 colors_02;
  54. centroid out float4 colors_12;
  55. void main()
  56. {
  57. VS_OUTPUT o;
  58. float4 pos = float4(dot(cpnmtx[0], rawpos), dot(cpnmtx[1], rawpos), dot(cpnmtx[2], rawpos), 1.0);
  59. float3 _norm0 = float3(0.0, 0.0, 0.0);
  60. o.pos = float4(dot(cproj[0], pos), dot(cproj[1], pos), dot(cproj[2], pos), dot(cproj[3], pos));
  61. int4 lacc;
  62. float3 ldir, h;
  63. float dist, dist2, attn;
  64. {
  65. int4 mat = int4(round(color0 * 255.0));
  66. lacc = int4(255, 255, 255, 255);
  67. lacc.w = 255;
  68. lacc = clamp(lacc, 0, 255);o.colors_0 = float4((mat * (lacc + (lacc >> 7))) >> 8) / 255.0;
  69. }
  70. o.colors_1 = o.colors_0;
  71. float4 coord = float4(0.0, 0.0, 1.0, 1.0);
  72. {
  73. coord = float4(0.0, 0.0, 1.0, 1.0);
  74. coord = float4(tex0.x, tex0.y, 1.0, 1.0);
  75. o.tex0.xyz = float3(dot(coord, ctexmtx[0]), dot(coord, ctexmtx[1]), 1);
  76. float4 P0 = cpostmtx[61];
  77. float4 P1 = cpostmtx[62];
  78. float4 P2 = cpostmtx[63];
  79. o.tex0.xyz = float3(dot(P0.xyz, o.tex0.xyz) + P0.w, dot(P1.xyz, o.tex0.xyz) + P1.w, dot(P2.xyz, o.tex0.xyz) + P2.w);
  80. }
  81. o.clipPos = float4(pos.x,pos.y,o.pos.z,o.pos.w);
  82. o.pos.z = o.pos.w + o.pos.z * 2.0;
  83. o.pos.xy = o.pos.xy - cDepth.zw;
  84. uv0.xyz = o.tex0;
  85. clipPos = o.clipPos;
  86. colors_02 = o.colors_0;
  87. colors_12 = o.colors_1;
  88. gl_Position = o.pos;
  89. }
  90. 0(40) : error C7532: layout qualifier 'binding' requires "#version 420" or later
  91. 0(40) : error C0000: ... or #extension GL_ARB_shading_language_420pack : enable
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement