Advertisement
Guest User

Untitled

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