Advertisement
illwieckz

material glsl error, generic 2D

Jul 14th, 2024
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.32 KB | None | 0 0
  1. Warn: Source for shader program generic2D:
  2. 0: #version 460 core
  3. 1: #define HAVE_EXT_gpu_shader4 1
  4. 2: #define HAVE_ARB_gpu_shader5 1
  5. 3: #define HAVE_ARB_texture_gather 1
  6. 4: #define HAVE_EXT_texture_integer 1
  7. 5: #define HAVE_ARB_texture_rg 1
  8. 6: #define HAVE_ARB_uniform_buffer_object 1
  9. 7: #extension GL_ARB_bindless_texture : require
  10. 8: #define HAVE_ARB_bindless_texture 1
  11. 9: #extension GL_ARB_shader_draw_parameters : require
  12. 10: #define HAVE_ARB_shader_draw_parameters 1
  13. 11: #define HAVE_ARB_shader_storage_buffer_object 1
  14. 12: #define IN in
  15. 13: #define OUT(mode) mode out
  16. 14: #define textureCube texture
  17. 15: #define texture2D texture
  18. 16: #define texture2DProj textureProj
  19. 17: #define texture3D texture
  20. 18: OUT(flat) int in_drawID;
  21. 19: OUT(flat) int in_baseInstance;
  22. 20: #define drawID gl_DrawIDARB
  23. 21: #define baseInstance gl_BaseInstanceARB
  24. 22:
  25. 23: #ifndef r_highPrecisionRendering
  26. 24: #define r_highPrecisionRendering 1
  27. 25: #endif
  28. 26: #ifndef r_dynamicLight
  29. 27: #define r_dynamicLight 1
  30. 28: #endif
  31. 29: #ifndef r_dynamicLightRenderer
  32. 30: #define r_dynamicLightRenderer 1
  33. 31: #endif
  34. 32: #ifndef r_precomputedLighting
  35. 33: #define r_precomputedLighting 1
  36. 34: #endif
  37. 35: #ifndef r_vertexSkinning
  38. 36: #define r_vertexSkinning 1
  39. 37: #endif
  40. 38: const int MAX_GLSL_BONES = 256;
  41. 39: #ifndef r_halfLambertLighting
  42. 40: #define r_halfLambertLighting 1
  43. 41: #endif
  44. 42: #ifndef r_rimLighting
  45. 43: #define r_rimLighting 1
  46. 44: #endif
  47. 45: const float r_RimExponent = 3.00000000e+00;
  48. 46: #ifndef r_normalMapping
  49. 47: #define r_normalMapping 1
  50. 48: #endif
  51. 49: #ifndef r_specularMapping
  52. 50: #define r_specularMapping 1
  53. 51: #endif
  54. 52: #ifndef r_physicalMapping
  55. 53: #define r_physicalMapping 1
  56. 54: #endif
  57. 55: #ifndef r_glowMapping
  58. 56: #define r_glowMapping 1
  59. 57: #endif
  60. 58: #ifndef GENERIC_2D
  61. 59: #define GENERIC_2D 1
  62. 60: #endif
  63. 61: #ifndef r_AmbientScale
  64. 62: #define r_AmbientScale 1.00000000e+00
  65. 63: #endif
  66. 64: #ifndef r_SpecularScale
  67. 65: #define r_SpecularScale 1.00000000e+00
  68. 66: #endif
  69. 67: #ifndef r_zNear
  70. 68: #define r_zNear 3.00000000e+00
  71. 69: #endif
  72. 70: #ifndef M_PI
  73. 71: #define M_PI 3.14159274e+00
  74. 72: #endif
  75. 73: #ifndef MAX_SHADOWMAPS
  76. 74: #define MAX_SHADOWMAPS 5
  77. 75: #endif
  78. 76: #ifndef MAX_REF_LIGHTS
  79. 77: #define MAX_REF_LIGHTS 1024
  80. 78: #endif
  81. 79: #ifndef TILE_SIZE
  82. 80: #define TILE_SIZE 16
  83. 81: #endif
  84. 82: #ifndef r_FBufSize
  85. 83: #define r_FBufSize vec2(2.56000000e+03, 1.44000000e+03)
  86. 84: #endif
  87. 85: #ifndef r_tileStep
  88. 86: #define r_tileStep vec2(6.24999963e-03, 1.11111114e-02)
  89. 87: #endif
  90. 0: #line 0
  91. 1: /*
  92. 2: ===========================================================================
  93. 3: Copyright (C) 2010 Robert Beckebans <trebor_7@users.sourceforge.net>
  94. 4:
  95. 5: This file is part of XreaL source code.
  96. 6:
  97. 7: XreaL source code is free software; you can redistribute it
  98. 8: and/or modify it under the terms of the GNU General Public License as
  99. 9: published by the Free Software Foundation; either version 2 of the License,
  100. 10: or (at your option) any later version.
  101. 11:
  102. 12: XreaL source code is distributed in the hope that it will be
  103. 13: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  104. 14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  105. 15: GNU General Public License for more details.
  106. 16:
  107. 17: You should have received a copy of the GNU General Public License
  108. 18: along with XreaL source code; if not, write to the Free Software
  109. 19: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  110. 20: ===========================================================================
  111. 21: */
  112. 22: // vertexSimple_vp.glsl - simple vertex fetch
  113. 23:
  114. 24: struct localBasis {
  115. 25: vec3 normal;
  116. 26: vec3 tangent, binormal;
  117. 27: };
  118. 28:
  119. 29: vec3 QuatTransVec(in vec4 quat, in vec3 vec) {
  120. 30: vec3 tmp = 2.0 * cross( quat.xyz, vec );
  121. 31: return vec + quat.w * tmp + cross( quat.xyz, tmp );
  122. 32: }
  123. 33:
  124. 34: void QTangentToLocalBasis( in vec4 qtangent, out localBasis LB ) {
  125. 35: LB.normal = QuatTransVec( qtangent, vec3( 0.0, 0.0, 1.0 ) );
  126. 36: LB.tangent = QuatTransVec( qtangent, vec3( 1.0, 0.0, 0.0 ) );
  127. 37: LB.tangent *= sign( qtangent.w );
  128. 38: LB.binormal = QuatTransVec( qtangent, vec3( 0.0, 1.0, 0.0 ) );
  129. 39: }
  130. 40:
  131. 41: #if !defined(USE_VERTEX_ANIMATION) && !defined(USE_VERTEX_SKINNING) && !defined(USE_VERTEX_SPRITE)
  132. 42:
  133. 43: IN vec3 attr_Position;
  134. 44: IN vec4 attr_Color;
  135. 45: IN vec4 attr_QTangent;
  136. 46: IN vec4 attr_TexCoord0;
  137. 47:
  138. 48: void VertexFetch(out vec4 position,
  139. 49: out localBasis normalBasis,
  140. 50: out vec4 color,
  141. 51: out vec2 texCoord,
  142. 52: out vec2 lmCoord)
  143. 53: {
  144. 54: position = vec4( attr_Position, 1.0 );
  145. 55: QTangentToLocalBasis( attr_QTangent, normalBasis );
  146. 56: color = attr_Color;
  147. 57: texCoord = attr_TexCoord0.xy;
  148. 58: lmCoord = attr_TexCoord0.zw;
  149. 59: }
  150. 60: #endif
  151. 0: #line 0
  152. 1: /*
  153. 2: ===========================================================================
  154. 3: Copyright (C) 2010 Robert Beckebans <trebor_7@users.sourceforge.net>
  155. 4:
  156. 5: This file is part of XreaL source code.
  157. 6:
  158. 7: XreaL source code is free software; you can redistribute it
  159. 8: and/or modify it under the terms of the GNU General Public License as
  160. 9: published by the Free Software Foundation; either version 2 of the License,
  161. 10: or (at your option) any later version.
  162. 11:
  163. 12: XreaL source code is distributed in the hope that it will be
  164. 13: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  165. 14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  166. 15: GNU General Public License for more details.
  167. 16:
  168. 17: You should have received a copy of the GNU General Public License
  169. 18: along with XreaL source code; if not, write to the Free Software
  170. 19: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  171. 20: ===========================================================================
  172. 21: */
  173. 22: // vertexSprite_vp.glsl - sprite vertex fetch
  174. 23:
  175. 24: #if defined(USE_VERTEX_SPRITE)
  176. 25:
  177. 26: IN vec3 attr_Position;
  178. 27: IN vec4 attr_Color;
  179. 28: IN vec4 attr_TexCoord0;
  180. 29: IN vec4 attr_Orientation;
  181. 30:
  182. 31: uniform vec3 u_ViewOrigin;
  183. 32: uniform vec3 u_ViewUp;
  184. 33:
  185. 34: float depthScale;
  186. 35:
  187. 36: void VertexFetch(out vec4 position,
  188. 37: out localBasis normalBasis,
  189. 38: out vec4 color,
  190. 39: out vec2 texCoord,
  191. 40: out vec2 lmCoord)
  192. 41: {
  193. 42: vec2 corner;
  194. 43: float radius = attr_Orientation.w;
  195. 44: vec3 normal = normalize( u_ViewOrigin - attr_Position ), up, left;
  196. 45: float s, c; // sin & cos of rotation factor
  197. 46:
  198. 47: corner = sign( attr_TexCoord0.zw );
  199. 48:
  200. 49: if( radius <= 0.0 ) {
  201. 50: // autosprite2 mode, attr_Orientation.xyz contains the up-vector
  202. 51: up = attr_Orientation.xyz;
  203. 52: left = radius * normalize( cross( up, normal ) );
  204. 53: position = vec4( attr_Position + corner.y * left, 1.0 );
  205. 54: } else {
  206. 55: // autosprite mode, attr_Orientation.x contains the rotation angle
  207. 56: left = normalize( cross( u_ViewUp, normal ) );
  208. 57: up = cross( left, normal );
  209. 58:
  210. 59: s = radius * sin( radians( attr_Orientation.x ) );
  211. 60: c = radius * cos( radians( attr_Orientation.x ) );
  212. 61:
  213. 62: // rotate left and up vectors
  214. 63: vec3 leftOrig = left;
  215. 64: left = c * left + s * up;
  216. 65: up = c * up - s * leftOrig;
  217. 66:
  218. 67: left *= corner.x;
  219. 68: up *= corner.y;
  220. 69:
  221. 70: position = vec4( attr_Position + left + up, 1.0 );
  222. 71: }
  223. 72: normalBasis.normal = normal;
  224. 73: normalBasis.tangent = normalize( up );
  225. 74: normalBasis.binormal = normalize( left );
  226. 75:
  227. 76: texCoord = 0.5 * corner + 0.5; //attr_TexCoord0.xy;
  228. 77: lmCoord = abs( attr_TexCoord0.zw );
  229. 78: color = attr_Color;
  230. 79:
  231. 80: depthScale = 2.0 * radius;
  232. 81: }
  233. 82: #endif
  234. 0: #line 0
  235. 1: /*
  236. 2: ===========================================================================
  237. 3: Copyright (C) 2006-2011 Robert Beckebans <trebor_7@users.sourceforge.net>
  238. 4:
  239. 5: This file is part of XreaL source code.
  240. 6:
  241. 7: XreaL source code is free software; you can redistribute it
  242. 8: and/or modify it under the terms of the GNU General Public License as
  243. 9: published by the Free Software Foundation; either version 2 of the License,
  244. 10: or (at your option) any later version.
  245. 11:
  246. 12: XreaL source code is distributed in the hope that it will be
  247. 13: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  248. 14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  249. 15: GNU General Public License for more details.
  250. 16:
  251. 17: You should have received a copy of the GNU General Public License
  252. 18: along with XreaL source code; if not, write to the Free Software
  253. 19: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  254. 20: ===========================================================================
  255. 21: */
  256. 22:
  257. 23: /* generic_vp.glsl */
  258. 24:
  259. 25: uniform mat4 u_TextureMatrix;
  260. 26: #if !defined(USE_VERTEX_SPRITE)
  261. 27: uniform vec3 u_ViewOrigin;
  262. 28: #endif
  263. 29:
  264. 30: uniform float u_Time;
  265. 31:
  266. 32: uniform vec4 u_ColorModulate;
  267. 33: uniform vec4 u_Color;
  268. 34: #if defined(USE_TCGEN_ENVIRONMENT)
  269. 35: uniform mat4 u_ModelMatrix;
  270. 36: #endif
  271. 37: uniform mat4 u_ModelViewProjectionMatrix;
  272. 38:
  273. 39: #if defined(USE_VERTEX_SPRITE)
  274. 40: OUT(smooth) vec2 var_FadeDepth;
  275. 41: uniform mat4 u_ProjectionMatrixTranspose;
  276. 42: #elif defined(USE_DEPTH_FADE)
  277. 43: uniform float u_DepthScale;
  278. 44: OUT(smooth) vec2 var_FadeDepth;
  279. 45: #endif
  280. 46:
  281. 47: OUT(smooth) vec2 var_TexCoords;
  282. 48: OUT(smooth) vec4 var_Color;
  283. 49:
  284. 50: void DeformVertex( inout vec4 pos,
  285. 51: inout vec3 normal,
  286. 52: inout vec2 st,
  287. 53: inout vec4 color,
  288. 54: in float time);
  289. 55:
  290. 56: void main()
  291. 57: {
  292. 58: /* Shader file: glsl/material_vp.glsl: */
  293. 10000: #line 10000
  294. 10001: /*
  295. 10002: ===========================================================================
  296. 10003:
  297. 10004: Daemon BSD Source Code
  298. 10005: Copyright (c) 2024 Daemon Developers
  299. 10006: All rights reserved.
  300. 10007:
  301. 10008: This file is part of the Daemon BSD Source Code (Daemon Source Code).
  302. 10009:
  303. 10010: Redistribution and use in source and binary forms, with or without
  304. 10011: modification, are permitted provided that the following conditions are met:
  305. 10012: * Redistributions of source code must retain the above copyright
  306. 10013: notice, this list of conditions and the following disclaimer.
  307. 10014: * Redistributions in binary form must reproduce the above copyright
  308. 10015: notice, this list of conditions and the following disclaimer in the
  309. 10016: documentation and/or other materials provided with the distribution.
  310. 10017: * Neither the name of the Daemon developers nor the
  311. 10018: names of its contributors may be used to endorse or promote products
  312. 10019: derived from this software without specific prior written permission.
  313. 10020:
  314. 10021: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  315. 10022: ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  316. 10023: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  317. 10024: DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY
  318. 10025: DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  319. 10026: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  320. 10027: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  321. 10028: ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  322. 10029: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  323. 10030: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  324. 10031:
  325. 10032: ===========================================================================
  326. 10033: */
  327. 10034:
  328. 10035: /* material_vp.glsl */
  329. 10036:
  330. 10037: #if defined(USE_MATERIAL_SYSTEM)
  331. 10038:
  332. 10039: #ifdef HAVE_ARB_shader_draw_parameters
  333. 10040: in_drawID = drawID;
  334. 10041: in_baseInstance = baseInstance;
  335. 10042: #endif // !HAVE_ARB_shader_draw_parameters
  336. 10043:
  337. 10044: #endif // !USE_MATERIAL_SYSTEM
  338. 59:
  339. 60: vec4 position;
  340. 61: localBasis LB;
  341. 62: vec4 color;
  342. 63: vec2 texCoord, lmCoord;
  343. 64:
  344. 65: VertexFetch( position, LB, color, texCoord, lmCoord );
  345. 66: color = color * u_ColorModulate + u_Color;
  346. 67:
  347. 68: DeformVertex( position,
  348. 69: LB.normal,
  349. 70: texCoord,
  350. 71: color,
  351. 72: u_Time);
  352. 73:
  353. 74: // transform vertex position into homogenous clip-space
  354. 75: gl_Position = u_ModelViewProjectionMatrix * position;
  355. 76:
  356. 77: // transform texcoords
  357. 78: #if defined(USE_TCGEN_ENVIRONMENT)
  358. 79: {
  359. 80: // TODO: Explain why only the rotational part of u_ModelMatrix is relevant
  360. 81: position.xyz = mat3(u_ModelMatrix) * position.xyz;
  361. 82:
  362. 83: vec3 viewer = normalize(u_ViewOrigin - position.xyz);
  363. 84:
  364. 85: float d = dot(LB.normal, viewer);
  365. 86:
  366. 87: vec3 reflected = LB.normal * 2.0 * d - viewer;
  367. 88:
  368. 89: var_TexCoords = 0.5 + vec2(0.5, -0.5) * reflected.yz;
  369. 90: }
  370. 91: #elif defined(USE_TCGEN_LIGHTMAP)
  371. 92: var_TexCoords = (u_TextureMatrix * vec4(lmCoord, 0.0, 1.0)).xy;
  372. 93: #else
  373. 94: var_TexCoords = (u_TextureMatrix * vec4(texCoord, 0.0, 1.0)).xy;
  374. 95: #endif
  375. 96:
  376. 97: #if defined(USE_DEPTH_FADE)
  377. 98: // compute z of end of fading effect
  378. 99: vec4 fadeDepth = u_ModelViewProjectionMatrix * (position - u_DepthScale * vec4(LB.normal, 0.0));
  379. 100: var_FadeDepth = fadeDepth.zw;
  380. 101: #elif defined(USE_VERTEX_SPRITE)
  381. 102: vec4 fadeDepth = u_ModelViewProjectionMatrix * (position - depthScale * vec4(LB.normal, 0.0));
  382. 103: var_FadeDepth = fadeDepth.zw;
  383. 104: #endif
  384. 105:
  385. 106: var_Color = color;
  386. 107: }
  387.  
  388. Warn: Compile log:
  389. 0:58(9): preprocessor error: syntax error, unexpected '-', expecting INTEGER or INTEGER_STRING
  390.  
  391. Warn: Unhandled exception (15ShaderException): Couldn't compile vertex shader: generic2D
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement