Advertisement
illwieckz

material glsl error, radeonsi, d0c04f713

Apr 28th, 2024
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.31 KB | None | 0 0
  1. Warn: Source for shader program generic2D:
  2. 0: #version 460 core
  3. 1: #define HAVE_ARB_texture_gather 1
  4. 2: #define HAVE_EXT_gpu_shader4 1
  5. 3: #define HAVE_ARB_gpu_shader5 1
  6. 4: #define HAVE_ARB_uniform_buffer_object 1
  7. 5: #extension GL_ARB_bindless_texture : require
  8. 6: #define HAVE_ARB_bindless_texture 1
  9. 7: #define HAVE_ARB_shader_draw_parameters 1
  10. 8: #define HAVE_ARB_shader_storage_buffer_object 1
  11. 9: #extension GL_ARB_gpu_shader_int64 : require
  12. 10: #define HAVE_ARB_gpu_shader_int64 1
  13. 11: #define IN in
  14. 12: #define OUT(mode) mode out
  15. 13: #define textureCube texture
  16. 14: #define texture2D texture
  17. 15: #define texture2DProj textureProj
  18. 16: #define texture3D texture
  19. 17: OUT(flat) int in_drawID;
  20. 18: OUT(flat) int in_baseInstance;
  21. 19: #ifndef r_precomputedLighting
  22. 20: #define r_precomputedLighting 1
  23. 21: #endif
  24. 22: #ifndef r_vertexSkinning
  25. 23: #define r_vertexSkinning 1
  26. 24: #endif
  27. 25: const int MAX_GLSL_BONES = 256;
  28. 26: #ifndef r_halfLambertLighting
  29. 27: #define r_halfLambertLighting 1
  30. 28: #endif
  31. 29: #ifndef r_rimLighting
  32. 30: #define r_rimLighting 1
  33. 31: #endif
  34. 32: const float r_RimExponent = 3.00000000e+00;
  35. 33: #ifndef r_normalMapping
  36. 34: #define r_normalMapping 1
  37. 35: #endif
  38. 36: #ifndef r_liquidMapping
  39. 37: #define r_liquidMapping 1
  40. 38: #endif
  41. 39: #ifndef r_specularMapping
  42. 40: #define r_specularMapping 1
  43. 41: #endif
  44. 42: #ifndef r_physicalMapping
  45. 43: #define r_physicalMapping 1
  46. 44: #endif
  47. 45: #ifndef r_glowMapping
  48. 46: #define r_glowMapping 1
  49. 47: #endif
  50. 48: #ifndef GENERIC_2D
  51. 49: #define GENERIC_2D 1
  52. 50: #endif
  53. 51: #define drawID gl_DrawIDARB
  54. 52: #define baseInstance gl_BaseInstanceARB
  55. 53:
  56. 54: #ifndef TEXTURE_RG
  57. 55: #define TEXTURE_RG 1
  58. 56: #endif
  59. 57: #ifndef UNIFORM_BUFFER_OBJECT
  60. 58: #define UNIFORM_BUFFER_OBJECT 1
  61. 59: #endif
  62. 60: #ifndef TEXTURE_INTEGER
  63. 61: #define TEXTURE_INTEGER 1
  64. 62: #endif
  65. 63: #ifndef r_AmbientScale
  66. 64: #define r_AmbientScale 1.00000000e+00
  67. 65: #endif
  68. 66: #ifndef r_SpecularScale
  69. 67: #define r_SpecularScale 1.00000000e+00
  70. 68: #endif
  71. 69: #ifndef r_zNear
  72. 70: #define r_zNear 3.00000000e+00
  73. 71: #endif
  74. 72: #ifndef M_PI
  75. 73: #define M_PI 3.14159274e+00
  76. 74: #endif
  77. 75: #ifndef MAX_SHADOWMAPS
  78. 76: #define MAX_SHADOWMAPS 5
  79. 77: #endif
  80. 78: #ifndef MAX_REF_LIGHTS
  81. 79: #define MAX_REF_LIGHTS 1024
  82. 80: #endif
  83. 81: #ifndef TILE_SIZE
  84. 82: #define TILE_SIZE 16
  85. 83: #endif
  86. 84: #ifndef r_FBufSize
  87. 85: #define r_FBufSize vec2(3.84000000e+03, 2.16000000e+03)
  88. 86: #endif
  89. 87: #ifndef r_tileStep
  90. 88: #define r_tileStep vec2(4.16666688e-03, 7.40740728e-03)
  91. 89: #endif
  92. 90: #ifdef HAVE_ARB_shader_draw_parameters
  93. 91: #define SETUP_SHADER_PARMS SetShaderParameters();
  94. 92: void SetShaderParameters() {
  95. 93: in_drawID = drawID;
  96. 94: in_baseInstance = baseInstance;
  97. 95: }
  98. 96: #else
  99. 97: #define SETUP_SHADER_PARMS //Unavailable
  100. 98: #endif
  101. 99: /*
  102. 100: ===========================================================================
  103. 101: Copyright (C) 2010 Robert Beckebans <trebor_7@users.sourceforge.net>
  104. 102:
  105. 103: This file is part of XreaL source code.
  106. 104:
  107. 105: XreaL source code is free software; you can redistribute it
  108. 106: and/or modify it under the terms of the GNU General Public License as
  109. 107: published by the Free Software Foundation; either version 2 of the License,
  110. 108: or (at your option) any later version.
  111. 109:
  112. 110: XreaL source code is distributed in the hope that it will be
  113. 111: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  114. 112: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  115. 113: GNU General Public License for more details.
  116. 114:
  117. 115: You should have received a copy of the GNU General Public License
  118. 116: along with XreaL source code; if not, write to the Free Software
  119. 117: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  120. 118: ===========================================================================
  121. 119: */
  122. 120: // vertexSimple_vp.glsl - simple vertex fetch
  123. 121:
  124. 122: struct localBasis {
  125. 123: vec3 normal;
  126. 124: vec3 tangent, binormal;
  127. 125: };
  128. 126:
  129. 127: vec3 QuatTransVec(in vec4 quat, in vec3 vec) {
  130. 128: vec3 tmp = 2.0 * cross( quat.xyz, vec );
  131. 129: return vec + quat.w * tmp + cross( quat.xyz, tmp );
  132. 130: }
  133. 131:
  134. 132: void QTangentToLocalBasis( in vec4 qtangent, out localBasis LB ) {
  135. 133: LB.normal = QuatTransVec( qtangent, vec3( 0.0, 0.0, 1.0 ) );
  136. 134: LB.tangent = QuatTransVec( qtangent, vec3( 1.0, 0.0, 0.0 ) );
  137. 135: LB.tangent *= sign( qtangent.w );
  138. 136: LB.binormal = QuatTransVec( qtangent, vec3( 0.0, 1.0, 0.0 ) );
  139. 137: }
  140. 138:
  141. 139: #if !defined(USE_VERTEX_ANIMATION) && !defined(USE_VERTEX_SKINNING) && !defined(USE_VERTEX_SPRITE)
  142. 140:
  143. 141: IN vec3 attr_Position;
  144. 142: IN vec4 attr_Color;
  145. 143: IN vec4 attr_QTangent;
  146. 144: IN vec4 attr_TexCoord0;
  147. 145:
  148. 146: void VertexFetch(out vec4 position,
  149. 147: out localBasis normalBasis,
  150. 148: out vec4 color,
  151. 149: out vec2 texCoord,
  152. 150: out vec2 lmCoord)
  153. 151: {
  154. 152: position = vec4( attr_Position, 1.0 );
  155. 153: QTangentToLocalBasis( attr_QTangent, normalBasis );
  156. 154: color = attr_Color;
  157. 155: texCoord = attr_TexCoord0.xy;
  158. 156: lmCoord = attr_TexCoord0.zw;
  159. 157: }
  160. 158: #endif
  161. 159: /*
  162. 160: ===========================================================================
  163. 161: Copyright (C) 2010 Robert Beckebans <trebor_7@users.sourceforge.net>
  164. 162:
  165. 163: This file is part of XreaL source code.
  166. 164:
  167. 165: XreaL source code is free software; you can redistribute it
  168. 166: and/or modify it under the terms of the GNU General Public License as
  169. 167: published by the Free Software Foundation; either version 2 of the License,
  170. 168: or (at your option) any later version.
  171. 169:
  172. 170: XreaL source code is distributed in the hope that it will be
  173. 171: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  174. 172: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  175. 173: GNU General Public License for more details.
  176. 174:
  177. 175: You should have received a copy of the GNU General Public License
  178. 176: along with XreaL source code; if not, write to the Free Software
  179. 177: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  180. 178: ===========================================================================
  181. 179: */
  182. 180: // vertexSprite_vp.glsl - sprite vertex fetch
  183. 181:
  184. 182: #if defined(USE_VERTEX_SPRITE)
  185. 183:
  186. 184: IN vec3 attr_Position;
  187. 185: IN vec4 attr_Color;
  188. 186: IN vec4 attr_TexCoord0;
  189. 187: IN vec4 attr_Orientation;
  190. 188:
  191. 189: uniform vec3 u_ViewOrigin;
  192. 190: uniform vec3 u_ViewUp;
  193. 191:
  194. 192: float depthScale;
  195. 193:
  196. 194: void VertexFetch(out vec4 position,
  197. 195: out localBasis normalBasis,
  198. 196: out vec4 color,
  199. 197: out vec2 texCoord,
  200. 198: out vec2 lmCoord)
  201. 199: {
  202. 200: vec2 corner;
  203. 201: float radius = attr_Orientation.w;
  204. 202: vec3 normal = normalize( u_ViewOrigin - attr_Position ), up, left;
  205. 203: float s, c; // sin & cos of rotation factor
  206. 204:
  207. 205: corner = sign( attr_TexCoord0.zw );
  208. 206:
  209. 207: if( radius <= 0.0 ) {
  210. 208: // autosprite2 mode, attr_Orientation.xyz contains the up-vector
  211. 209: up = attr_Orientation.xyz;
  212. 210: left = radius * normalize( cross( up, normal ) );
  213. 211: position = vec4( attr_Position + corner.y * left, 1.0 );
  214. 212: } else {
  215. 213: // autosprite mode, attr_Orientation.x contains the rotation angle
  216. 214: left = normalize( cross( u_ViewUp, normal ) );
  217. 215: up = cross( left, normal );
  218. 216:
  219. 217: s = radius * sin( radians( attr_Orientation.x ) );
  220. 218: c = radius * cos( radians( attr_Orientation.x ) );
  221. 219:
  222. 220: // rotate left and up vectors
  223. 221: vec3 leftOrig = left;
  224. 222: left = c * left + s * up;
  225. 223: up = c * up - s * leftOrig;
  226. 224:
  227. 225: left *= corner.x;
  228. 226: up *= corner.y;
  229. 227:
  230. 228: position = vec4( attr_Position + left + up, 1.0 );
  231. 229: }
  232. 230: normalBasis.normal = normal;
  233. 231: normalBasis.tangent = normalize( up );
  234. 232: normalBasis.binormal = normalize( left );
  235. 233:
  236. 234: texCoord = 0.5 * corner + 0.5; //attr_TexCoord0.xy;
  237. 235: lmCoord = abs( attr_TexCoord0.zw );
  238. 236: color = attr_Color;
  239. 237:
  240. 238: depthScale = 2.0 * radius;
  241. 239: }
  242. 240: #endif
  243. 241: /*
  244. 242: ===========================================================================
  245. 243: Copyright (C) 2006-2011 Robert Beckebans <trebor_7@users.sourceforge.net>
  246. 244:
  247. 245: This file is part of XreaL source code.
  248. 246:
  249. 247: XreaL source code is free software; you can redistribute it
  250. 248: and/or modify it under the terms of the GNU General Public License as
  251. 249: published by the Free Software Foundation; either version 2 of the License,
  252. 250: or (at your option) any later version.
  253. 251:
  254. 252: XreaL source code is distributed in the hope that it will be
  255. 253: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  256. 254: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  257. 255: GNU General Public License for more details.
  258. 256:
  259. 257: You should have received a copy of the GNU General Public License
  260. 258: along with XreaL source code; if not, write to the Free Software
  261. 259: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  262. 260: ===========================================================================
  263. 261: */
  264. 262:
  265. 263: /* generic_vp.glsl */
  266. 264:
  267. 265: uniform mat4 u_TextureMatrix;
  268. 266: #if !defined(USE_VERTEX_SPRITE)
  269. 267: uniform vec3 u_ViewOrigin;
  270. 268: #endif
  271. 269:
  272. 270: uniform float u_Time;
  273. 271:
  274. 272: uniform vec4 u_ColorModulate;
  275. 273: uniform vec4 u_Color;
  276. 274: #if defined(USE_TCGEN_ENVIRONMENT)
  277. 275: uniform mat4 u_ModelMatrix;
  278. 276: #endif
  279. 277: uniform mat4 u_ModelViewProjectionMatrix;
  280. 278:
  281. 279: #if defined(USE_VERTEX_SPRITE)
  282. 280: OUT(smooth) vec2 var_FadeDepth;
  283. 281: uniform mat4 u_ProjectionMatrixTranspose;
  284. 282: #elif defined(USE_DEPTH_FADE)
  285. 283: uniform float u_DepthScale;
  286. 284: OUT(smooth) vec2 var_FadeDepth;
  287. 285: #endif
  288. 286:
  289. 287: OUT(smooth) vec2 var_TexCoords;
  290. 288: OUT(smooth) vec4 var_Color;
  291. 289:
  292. 290: void DeformVertex( inout vec4 pos,
  293. 291: inout vec3 normal,
  294. 292: inout vec2 st,
  295. 293: inout vec4 color,
  296. 294: in float time);
  297. 295:
  298. 296: void main()
  299. 297: {
  300. 298: vec4 position;
  301. 299: localBasis LB;
  302. 300: vec4 color;
  303. 301: vec2 texCoord, lmCoord;
  304. 302:
  305. 303: VertexFetch( position, LB, color, texCoord, lmCoord );
  306. 304: color = color * u_ColorModulate + u_Color;
  307. 305:
  308. 306: DeformVertex( position,
  309. 307: LB.normal,
  310. 308: texCoord,
  311. 309: color,
  312. 310: u_Time);
  313. 311:
  314. 312: // transform vertex position into homogenous clip-space
  315. 313: gl_Position = u_ModelViewProjectionMatrix * position;
  316. 314:
  317. 315: // transform texcoords
  318. 316: #if defined(USE_TCGEN_ENVIRONMENT)
  319. 317: {
  320. 318: // TODO: Explain why only the rotational part of u_ModelMatrix is relevant
  321. 319: position.xyz = mat3(u_ModelMatrix) * position.xyz;
  322. 320:
  323. 321: vec3 viewer = normalize(u_ViewOrigin - position.xyz);
  324. 322:
  325. 323: float d = dot(LB.normal, viewer);
  326. 324:
  327. 325: vec3 reflected = LB.normal * 2.0 * d - viewer;
  328. 326:
  329. 327: var_TexCoords = 0.5 + vec2(0.5, -0.5) * reflected.yz;
  330. 328: }
  331. 329: #elif defined(USE_TCGEN_LIGHTMAP)
  332. 330: var_TexCoords = (u_TextureMatrix * vec4(lmCoord, 0.0, 1.0)).xy;
  333. 331: #else
  334. 332: var_TexCoords = (u_TextureMatrix * vec4(texCoord, 0.0, 1.0)).xy;
  335. 333: #endif
  336. 334:
  337. 335: #if defined(USE_DEPTH_FADE)
  338. 336: // compute z of end of fading effect
  339. 337: vec4 fadeDepth = u_ModelViewProjectionMatrix * (position - u_DepthScale * vec4(LB.normal, 0.0));
  340. 338: var_FadeDepth = fadeDepth.zw;
  341. 339: #elif defined(USE_VERTEX_SPRITE)
  342. 340: vec4 fadeDepth = u_ModelViewProjectionMatrix * (position - depthScale * vec4(LB.normal, 0.0));
  343. 341: var_FadeDepth = fadeDepth.zw;
  344. 342: #endif
  345. 343:
  346. 344: var_Color = color;
  347. 345:
  348. 346: SETUP_SHADER_PARMS
  349. 347: }
  350.  
  351. Warn: Compile log:
  352. 0:94(14): error: `gl_DrawIDARB' undeclared
  353. 0:95(20): error: `gl_BaseInstanceARB' undeclared
  354.  
  355. Warn: Unhandled exception (15ShaderException): Couldn't compile vertex shader: generic2D
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement