illwieckz

material glsl error, d35c95f8b

Apr 26th, 2024
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.48 KB | None | 0 0
  1. Invalidating shader binary cache
  2. Debug: building generic shader permutation with macro: GENERIC_2D
  3. Warn: Source for shader program generic2D:
  4. 0: #version 460 core
  5. 1: #define HAVE_ARB_texture_gather 1
  6. 2: #define HAVE_EXT_gpu_shader4 1
  7. 3: #define HAVE_ARB_gpu_shader5 1
  8. 4: #define HAVE_ARB_uniform_buffer_object 1
  9. 5: #extension GL_ARB_bindless_texture : require
  10. 6: #define HAVE_ARB_bindless_texture 1
  11. 7: #define HAVE_ARB_shader_draw_parameters 1
  12. 8: #define HAVE_ARB_shader_storage_buffer_object 1
  13. 9: #extension GL_ARB_gpu_shader_int64 : require
  14. 10: #define HAVE_ARB_gpu_shader_int64 1
  15. 11: #define IN in
  16. 12: #define OUT(mode) mode out
  17. 13: #define textureCube texture
  18. 14: #define texture2D texture
  19. 15: #define texture2DProj textureProj
  20. 16: #define texture3D texture
  21. 17: OUT(flat) int in_drawID;
  22. 18: OUT(flat) int in_baseInstance;
  23. 19: #ifndef r_precomputedLighting
  24. 20: #define r_precomputedLighting 1
  25. 21: #endif
  26. 22: #ifndef r_vertexSkinning
  27. 23: #define r_vertexSkinning 1
  28. 24: #endif
  29. 25: const int MAX_GLSL_BONES = 256;
  30. 26: #ifndef r_halfLambertLighting
  31. 27: #define r_halfLambertLighting 1
  32. 28: #endif
  33. 29: #ifndef r_rimLighting
  34. 30: #define r_rimLighting 1
  35. 31: #endif
  36. 32: const float r_RimExponent = 3.00000000e+00;
  37. 33: #ifndef r_normalMapping
  38. 34: #define r_normalMapping 1
  39. 35: #endif
  40. 36: #ifndef r_liquidMapping
  41. 37: #define r_liquidMapping 1
  42. 38: #endif
  43. 39: #ifndef r_specularMapping
  44. 40: #define r_specularMapping 1
  45. 41: #endif
  46. 42: #ifndef r_physicalMapping
  47. 43: #define r_physicalMapping 1
  48. 44: #endif
  49. 45: #ifndef r_glowMapping
  50. 46: #define r_glowMapping 1
  51. 47: #endif
  52. 48: #ifndef GENERIC_2D
  53. 49: #define GENERIC_2D 1
  54. 50: #endif
  55. 51: #define drawID gl_DrawIDARB
  56. 52: #define baseInstance gl_BaseInstanceARB
  57. 53:
  58. 54: #ifndef TEXTURE_RG
  59. 55: #define TEXTURE_RG 1
  60. 56: #endif
  61. 57: #ifndef UNIFORM_BUFFER_OBJECT
  62. 58: #define UNIFORM_BUFFER_OBJECT 1
  63. 59: #endif
  64. 60: #ifndef TEXTURE_INTEGER
  65. 61: #define TEXTURE_INTEGER 1
  66. 62: #endif
  67. 63: #ifndef r_AmbientScale
  68. 64: #define r_AmbientScale 1.00000000e+00
  69. 65: #endif
  70. 66: #ifndef r_SpecularScale
  71. 67: #define r_SpecularScale 1.00000000e+00
  72. 68: #endif
  73. 69: #ifndef r_zNear
  74. 70: #define r_zNear 3.00000000e+00
  75. 71: #endif
  76. 72: #ifndef M_PI
  77. 73: #define M_PI 3.14159274e+00
  78. 74: #endif
  79. 75: #ifndef MAX_SHADOWMAPS
  80. 76: #define MAX_SHADOWMAPS 5
  81. 77: #endif
  82. 78: #ifndef MAX_REF_LIGHTS
  83. 79: #define MAX_REF_LIGHTS 1024
  84. 80: #endif
  85. 81: #ifndef TILE_SIZE
  86. 82: #define TILE_SIZE 16
  87. 83: #endif
  88. 84: #ifndef r_FBufSize
  89. 85: #define r_FBufSize vec2(2.56000000e+03, 1.44000000e+03)
  90. 86: #endif
  91. 87: #ifndef r_tileStep
  92. 88: #define r_tileStep vec2(6.24999963e-03, 1.11111114e-02)
  93. 89: #endif
  94. 90: #ifdef HAVE_ARB_shader_draw_parameters
  95. 91: #define SETUP_SHADER_PARMS SetShaderParameters();
  96. 92: void SetShaderParameters() {
  97. 93: in_drawID = drawID;
  98. 94: in_baseInstance = baseInstance;
  99. 95: }
  100. 96: #else
  101. 97: #define SETUP_SHADER_PARMS //Unavailable
  102. 98: #endif
  103. 99: /*
  104. 100: ===========================================================================
  105. 101: Copyright (C) 2010 Robert Beckebans <trebor_7@users.sourceforge.net>
  106. 102:
  107. 103: This file is part of XreaL source code.
  108. 104:
  109. 105: XreaL source code is free software; you can redistribute it
  110. 106: and/or modify it under the terms of the GNU General Public License as
  111. 107: published by the Free Software Foundation; either version 2 of the License,
  112. 108: or (at your option) any later version.
  113. 109:
  114. 110: XreaL source code is distributed in the hope that it will be
  115. 111: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  116. 112: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  117. 113: GNU General Public License for more details.
  118. 114:
  119. 115: You should have received a copy of the GNU General Public License
  120. 116: along with XreaL source code; if not, write to the Free Software
  121. 117: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  122. 118: ===========================================================================
  123. 119: */
  124. 120: // vertexSimple_vp.glsl - simple vertex fetch
  125. 121:
  126. 122: struct localBasis {
  127. 123: vec3 normal;
  128. 124: vec3 tangent, binormal;
  129. 125: };
  130. 126:
  131. 127: vec3 QuatTransVec(in vec4 quat, in vec3 vec) {
  132. 128: vec3 tmp = 2.0 * cross( quat.xyz, vec );
  133. 129: return vec + quat.w * tmp + cross( quat.xyz, tmp );
  134. 130: }
  135. 131:
  136. 132: void QTangentToLocalBasis( in vec4 qtangent, out localBasis LB ) {
  137. 133: LB.normal = QuatTransVec( qtangent, vec3( 0.0, 0.0, 1.0 ) );
  138. 134: LB.tangent = QuatTransVec( qtangent, vec3( 1.0, 0.0, 0.0 ) );
  139. 135: LB.tangent *= sign( qtangent.w );
  140. 136: LB.binormal = QuatTransVec( qtangent, vec3( 0.0, 1.0, 0.0 ) );
  141. 137: }
  142. 138:
  143. 139: #if !defined(USE_VERTEX_ANIMATION) && !defined(USE_VERTEX_SKINNING) && !defined(USE_VERTEX_SPRITE)
  144. 140:
  145. 141: IN vec3 attr_Position;
  146. 142: IN vec4 attr_Color;
  147. 143: IN vec4 attr_QTangent;
  148. 144: IN vec4 attr_TexCoord0;
  149. 145:
  150. 146: void VertexFetch(out vec4 position,
  151. 147: out localBasis normalBasis,
  152. 148: out vec4 color,
  153. 149: out vec2 texCoord,
  154. 150: out vec2 lmCoord)
  155. 151: {
  156. 152: position = vec4( attr_Position, 1.0 );
  157. 153: QTangentToLocalBasis( attr_QTangent, normalBasis );
  158. 154: color = attr_Color;
  159. 155: texCoord = attr_TexCoord0.xy;
  160. 156: lmCoord = attr_TexCoord0.zw;
  161. 157: }
  162. 158: #endif
  163. 159: /*
  164. 160: ===========================================================================
  165. 161: Copyright (C) 2009-2011 Robert Beckebans <trebor_7@users.sourceforge.net>
  166. 162:
  167. 163: This file is part of XreaL source code.
  168. 164:
  169. 165: XreaL source code is free software; you can redistribute it
  170. 166: and/or modify it under the terms of the GNU General Public License as
  171. 167: published by the Free Software Foundation; either version 2 of the License,
  172. 168: or (at your option) any later version.
  173. 169:
  174. 170: XreaL source code is distributed in the hope that it will be
  175. 171: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  176. 172: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  177. 173: GNU General Public License for more details.
  178. 174:
  179. 175: You should have received a copy of the GNU General Public License
  180. 176: along with XreaL source code; if not, write to the Free Software
  181. 177: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  182. 178: ===========================================================================
  183. 179: */
  184. 180: // vertexSkinning_vp.glsl - GPU vertex skinning for skeletal meshes
  185. 181:
  186. 182: #if defined(USE_VERTEX_SKINNING)
  187. 183:
  188. 184: IN vec3 attr_Position;
  189. 185: IN vec2 attr_TexCoord0;
  190. 186: IN vec4 attr_Color;
  191. 187: IN vec4 attr_QTangent;
  192. 188: IN vec4 attr_BoneFactors;
  193. 189:
  194. 190: // even elements are rotation quat, odd elements are translation + scale (in .w)
  195. 191: uniform vec4 u_Bones[ 2 * MAX_GLSL_BONES ];
  196. 192:
  197. 193: void VertexFetch(out vec4 position,
  198. 194: out localBasis LB,
  199. 195: out vec4 color,
  200. 196: out vec2 texCoord,
  201. 197: out vec2 lmCoord)
  202. 198: {
  203. 199: const float scale = 1.0 / 256.0;
  204. 200: const float weightScale = 1.0 / 255.0;
  205. 201: localBasis inLB;
  206. 202:
  207. 203: // Unpack data from "bone factors". This used to have the index in the high byte and the weight
  208. 204: // in the low byte, which may seem a bit more logical, but it triggered issues with some
  209. 205: // Nvidia shader compilers (https://github.com/DaemonEngine/Daemon/issues/472).
  210. 206: vec4 ipart = floor( attr_BoneFactors * scale );
  211. 207: vec4 fpart = attr_BoneFactors * scale - ipart;
  212. 208: // idx = 2 times the original bone index (the index input to boneFactor)
  213. 209: ivec4 idx = ivec4( fpart * 512.0 );
  214. 210: vec4 weights = ipart * weightScale;
  215. 211:
  216. 212: vec4 quat = u_Bones[ idx.x ];
  217. 213: vec4 trans = u_Bones[ idx.x + 1 ];
  218. 214:
  219. 215: QTangentToLocalBasis( attr_QTangent, inLB );
  220. 216:
  221. 217: position.xyz = weights.x * (QuatTransVec( quat, attr_Position ) * trans.w + trans.xyz);
  222. 218: LB.normal = weights.x * (QuatTransVec( quat, inLB.normal ));
  223. 219: LB.tangent = weights.x * (QuatTransVec( quat, inLB.tangent ));
  224. 220: LB.binormal = weights.x * (QuatTransVec( quat, inLB.binormal ));
  225. 221:
  226. 222: quat = u_Bones[ idx.y ];
  227. 223: trans = u_Bones[ idx.y + 1 ];
  228. 224:
  229. 225: position.xyz += weights.y * (QuatTransVec( quat, attr_Position ) * trans.w + trans.xyz);
  230. 226: LB.normal += weights.y * (QuatTransVec( quat, inLB.normal ));
  231. 227: LB.tangent += weights.y * (QuatTransVec( quat, inLB.tangent ));
  232. 228: LB.binormal += weights.y * (QuatTransVec( quat, inLB.binormal ));
  233. 229:
  234. 230: quat = u_Bones[ idx.z ];
  235. 231: trans = u_Bones[ idx.z + 1 ];
  236. 232:
  237. 233: position.xyz += weights.z * (QuatTransVec( quat, attr_Position ) * trans.w + trans.xyz);
  238. 234: LB.normal += weights.z * (QuatTransVec( quat, inLB.normal ));
  239. 235: LB.tangent += weights.z * (QuatTransVec( quat, inLB.tangent ));
  240. 236: LB.binormal += weights.z * (QuatTransVec( quat, inLB.binormal ));
  241. 237:
  242. 238: quat = u_Bones[ idx.w ];
  243. 239: trans = u_Bones[ idx.w + 1 ];
  244. 240:
  245. 241: position.xyz += weights.w * (QuatTransVec( quat, attr_Position ) * trans.w + trans.xyz);
  246. 242: LB.normal += weights.w * (QuatTransVec( quat, inLB.normal ));
  247. 243: LB.tangent += weights.w * (QuatTransVec( quat, inLB.tangent ));
  248. 244: LB.binormal += weights.w * (QuatTransVec( quat, inLB.binormal ));
  249. 245:
  250. 246: position.w = 1.0;
  251. 247: LB.normal = normalize(LB.normal);
  252. 248: LB.tangent = normalize(LB.tangent);
  253. 249: LB.binormal = normalize(LB.binormal);
  254. 250:
  255. 251: color = attr_Color;
  256. 252: texCoord = attr_TexCoord0;
  257. 253: lmCoord = attr_TexCoord0;
  258. 254: }
  259. 255: #endif
  260. 256: /*
  261. 257: ===========================================================================
  262. 258: Copyright (C) 2010 Robert Beckebans <trebor_7@users.sourceforge.net>
  263. 259:
  264. 260: This file is part of XreaL source code.
  265. 261:
  266. 262: XreaL source code is free software; you can redistribute it
  267. 263: and/or modify it under the terms of the GNU General Public License as
  268. 264: published by the Free Software Foundation; either version 2 of the License,
  269. 265: or (at your option) any later version.
  270. 266:
  271. 267: XreaL source code is distributed in the hope that it will be
  272. 268: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  273. 269: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  274. 270: GNU General Public License for more details.
  275. 271:
  276. 272: You should have received a copy of the GNU General Public License
  277. 273: along with XreaL source code; if not, write to the Free Software
  278. 274: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  279. 275: ===========================================================================
  280. 276: */
  281. 277: // vertexAnimation_vp.glsl - interpolates .md3/.mdc vertex animations
  282. 278:
  283. 279: #if defined(USE_VERTEX_ANIMATION)
  284. 280:
  285. 281: IN vec3 attr_Position;
  286. 282: IN vec4 attr_Color;
  287. 283: IN vec4 attr_QTangent;
  288. 284: IN vec2 attr_TexCoord0;
  289. 285: IN vec3 attr_Position2;
  290. 286: IN vec4 attr_QTangent2;
  291. 287:
  292. 288: uniform float u_VertexInterpolation;
  293. 289:
  294. 290: void VertexAnimation_P_N( vec3 fromPosition, vec3 toPosition,
  295. 291: vec4 fromQTangent, vec4 toQTangent,
  296. 292: float frac,
  297. 293: inout vec4 position, inout vec3 normal)
  298. 294: {
  299. 295: vec3 fromNormal = QuatTransVec( fromQTangent, vec3( 0.0, 0.0, 1.0 ) );
  300. 296: vec3 toNormal = QuatTransVec( toQTangent, vec3( 0.0, 0.0, 1.0 ) );
  301. 297:
  302. 298: position.xyz = 512.0 * mix(fromPosition, toPosition, frac);
  303. 299: position.w = 1;
  304. 300:
  305. 301: normal = normalize(mix(fromNormal, toNormal, frac));
  306. 302: }
  307. 303:
  308. 304: void VertexFetch(out vec4 position,
  309. 305: out localBasis LB,
  310. 306: out vec4 color,
  311. 307: out vec2 texCoord,
  312. 308: out vec2 lmCoord)
  313. 309: {
  314. 310: localBasis fromLB, toLB;
  315. 311:
  316. 312: QTangentToLocalBasis( attr_QTangent, fromLB );
  317. 313: QTangentToLocalBasis( attr_QTangent2, toLB );
  318. 314:
  319. 315: position.xyz = 512.0 * mix(attr_Position, attr_Position2, u_VertexInterpolation);
  320. 316: position.w = 1;
  321. 317:
  322. 318: LB.normal = normalize(mix(fromLB.normal, toLB.normal, u_VertexInterpolation));
  323. 319: LB.tangent = normalize(mix(fromLB.tangent, toLB.tangent, u_VertexInterpolation));
  324. 320: LB.binormal = normalize(mix(fromLB.binormal, toLB.binormal, u_VertexInterpolation));
  325. 321:
  326. 322: color = attr_Color;
  327. 323: texCoord = attr_TexCoord0;
  328. 324: lmCoord = attr_TexCoord0;
  329. 325: }
  330. 326: #endif
  331. 327: /*
  332. 328: ===========================================================================
  333. 329: Copyright (C) 2010 Robert Beckebans <trebor_7@users.sourceforge.net>
  334. 330:
  335. 331: This file is part of XreaL source code.
  336. 332:
  337. 333: XreaL source code is free software; you can redistribute it
  338. 334: and/or modify it under the terms of the GNU General Public License as
  339. 335: published by the Free Software Foundation; either version 2 of the License,
  340. 336: or (at your option) any later version.
  341. 337:
  342. 338: XreaL source code is distributed in the hope that it will be
  343. 339: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  344. 340: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  345. 341: GNU General Public License for more details.
  346. 342:
  347. 343: You should have received a copy of the GNU General Public License
  348. 344: along with XreaL source code; if not, write to the Free Software
  349. 345: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  350. 346: ===========================================================================
  351. 347: */
  352. 348: // vertexSprite_vp.glsl - sprite vertex fetch
  353. 349:
  354. 350: #if defined(USE_VERTEX_SPRITE)
  355. 351:
  356. 352: IN vec3 attr_Position;
  357. 353: IN vec4 attr_Color;
  358. 354: IN vec4 attr_TexCoord0;
  359. 355: IN vec4 attr_Orientation;
  360. 356:
  361. 357: uniform vec3 u_ViewOrigin;
  362. 358: uniform vec3 u_ViewUp;
  363. 359:
  364. 360: float depthScale;
  365. 361:
  366. 362: void VertexFetch(out vec4 position,
  367. 363: out localBasis normalBasis,
  368. 364: out vec4 color,
  369. 365: out vec2 texCoord,
  370. 366: out vec2 lmCoord)
  371. 367: {
  372. 368: vec2 corner;
  373. 369: float radius = attr_Orientation.w;
  374. 370: vec3 normal = normalize( u_ViewOrigin - attr_Position ), up, left;
  375. 371: float s, c; // sin & cos of rotation factor
  376. 372:
  377. 373: corner = sign( attr_TexCoord0.zw );
  378. 374:
  379. 375: if( radius <= 0.0 ) {
  380. 376: // autosprite2 mode, attr_Orientation.xyz contains the up-vector
  381. 377: up = attr_Orientation.xyz;
  382. 378: left = radius * normalize( cross( up, normal ) );
  383. 379: position = vec4( attr_Position + corner.y * left, 1.0 );
  384. 380: } else {
  385. 381: // autosprite mode, attr_Orientation.x contains the rotation angle
  386. 382: left = normalize( cross( u_ViewUp, normal ) );
  387. 383: up = cross( left, normal );
  388. 384:
  389. 385: s = radius * sin( radians( attr_Orientation.x ) );
  390. 386: c = radius * cos( radians( attr_Orientation.x ) );
  391. 387:
  392. 388: // rotate left and up vectors
  393. 389: vec3 leftOrig = left;
  394. 390: left = c * left + s * up;
  395. 391: up = c * up - s * leftOrig;
  396. 392:
  397. 393: left *= corner.x;
  398. 394: up *= corner.y;
  399. 395:
  400. 396: position = vec4( attr_Position + left + up, 1.0 );
  401. 397: }
  402. 398: normalBasis.normal = normal;
  403. 399: normalBasis.tangent = normalize( up );
  404. 400: normalBasis.binormal = normalize( left );
  405. 401:
  406. 402: texCoord = 0.5 * corner + 0.5; //attr_TexCoord0.xy;
  407. 403: lmCoord = abs( attr_TexCoord0.zw );
  408. 404: color = attr_Color;
  409. 405:
  410. 406: depthScale = 2.0 * radius;
  411. 407: }
  412. 408: #endif
  413. 409: /*
  414. 410: ===========================================================================
  415. 411: Copyright (C) 2006-2011 Robert Beckebans <trebor_7@users.sourceforge.net>
  416. 412:
  417. 413: This file is part of XreaL source code.
  418. 414:
  419. 415: XreaL source code is free software; you can redistribute it
  420. 416: and/or modify it under the terms of the GNU General Public License as
  421. 417: published by the Free Software Foundation; either version 2 of the License,
  422. 418: or (at your option) any later version.
  423. 419:
  424. 420: XreaL source code is distributed in the hope that it will be
  425. 421: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  426. 422: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  427. 423: GNU General Public License for more details.
  428. 424:
  429. 425: You should have received a copy of the GNU General Public License
  430. 426: along with XreaL source code; if not, write to the Free Software
  431. 427: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  432. 428: ===========================================================================
  433. 429: */
  434. 430:
  435. 431: /* generic_vp.glsl */
  436. 432:
  437. 433: uniform mat4 u_TextureMatrix;
  438. 434: #if !defined(USE_VERTEX_SPRITE)
  439. 435: uniform vec3 u_ViewOrigin;
  440. 436: #endif
  441. 437:
  442. 438: uniform float u_Time;
  443. 439:
  444. 440: uniform vec4 u_ColorModulate;
  445. 441: uniform vec4 u_Color;
  446. 442: #if defined(USE_TCGEN_ENVIRONMENT)
  447. 443: uniform mat4 u_ModelMatrix;
  448. 444: #endif
  449. 445: uniform mat4 u_ModelViewProjectionMatrix;
  450. 446:
  451. 447: #if defined(USE_VERTEX_SPRITE)
  452. 448: OUT(smooth) vec2 var_FadeDepth;
  453. 449: uniform mat4 u_ProjectionMatrixTranspose;
  454. 450: #elif defined(USE_DEPTH_FADE)
  455. 451: uniform float u_DepthScale;
  456. 452: OUT(smooth) vec2 var_FadeDepth;
  457. 453: #endif
  458. 454:
  459. 455: OUT(smooth) vec2 var_TexCoords;
  460. 456: OUT(smooth) vec4 var_Color;
  461. 457:
  462. 458: void DeformVertex( inout vec4 pos,
  463. 459: inout vec3 normal,
  464. 460: inout vec2 st,
  465. 461: inout vec4 color,
  466. 462: in float time);
  467. 463:
  468. 464: void main()
  469. 465: {
  470. 466: vec4 position;
  471. 467: localBasis LB;
  472. 468: vec4 color;
  473. 469: vec2 texCoord, lmCoord;
  474. 470:
  475. 471: VertexFetch( position, LB, color, texCoord, lmCoord );
  476. 472: color = color * u_ColorModulate + u_Color;
  477. 473:
  478. 474: DeformVertex( position,
  479. 475: LB.normal,
  480. 476: texCoord,
  481. 477: color,
  482. 478: u_Time);
  483. 479:
  484. 480: // transform vertex position into homogenous clip-space
  485. 481: gl_Position = u_ModelViewProjectionMatrix * position;
  486. 482:
  487. 483: // transform texcoords
  488. 484: #if defined(USE_TCGEN_ENVIRONMENT)
  489. 485: {
  490. 486: // TODO: Explain why only the rotational part of u_ModelMatrix is relevant
  491. 487: position.xyz = mat3(u_ModelMatrix) * position.xyz;
  492. 488:
  493. 489: vec3 viewer = normalize(u_ViewOrigin - position.xyz);
  494. 490:
  495. 491: float d = dot(LB.normal, viewer);
  496. 492:
  497. 493: vec3 reflected = LB.normal * 2.0 * d - viewer;
  498. 494:
  499. 495: var_TexCoords = 0.5 + vec2(0.5, -0.5) * reflected.yz;
  500. 496: }
  501. 497: #elif defined(USE_TCGEN_LIGHTMAP)
  502. 498: var_TexCoords = (u_TextureMatrix * vec4(lmCoord, 0.0, 1.0)).xy;
  503. 499: #else
  504. 500: var_TexCoords = (u_TextureMatrix * vec4(texCoord, 0.0, 1.0)).xy;
  505. 501: #endif
  506. 502:
  507. 503: #if defined(USE_DEPTH_FADE)
  508. 504: // compute z of end of fading effect
  509. 505: vec4 fadeDepth = u_ModelViewProjectionMatrix * (position - u_DepthScale * vec4(LB.normal, 0.0));
  510. 506: var_FadeDepth = fadeDepth.zw;
  511. 507: #elif defined(USE_VERTEX_SPRITE)
  512. 508: vec4 fadeDepth = u_ModelViewProjectionMatrix * (position - depthScale * vec4(LB.normal, 0.0));
  513. 509: var_FadeDepth = fadeDepth.zw;
  514. 510: #endif
  515. 511:
  516. 512: var_Color = color;
  517. 513:
  518. 514: SETUP_SHADER_PARMS
  519. 515: }
  520.  
  521. Warn: Compile log:
  522. 0:94(14): error: `gl_DrawIDARB' undeclared
  523. 0:95(20): error: `gl_BaseInstanceARB' undeclared
  524.  
  525. Warn: Unhandled exception (15ShaderException): Couldn't compile vertex shader: generic2D
Add Comment
Please, Sign In to add comment