Guest User

Untitled

a guest
Apr 13th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 123.98 KB | None | 0 0
  1. Using read-write data directory: C:\Users\Joshua\Documents\My Games\Spring\
  2. Using read-only data directory: C:\Users\Joshua\Documents\My Games\Spring\weblobby\engine\96.0\
  3. Scanning: C:\Users\Joshua\Documents\My Games\Spring\weblobby\engine\96.0\base
  4. Scanning: C:\Users\Joshua\Documents\My Games\Spring\maps
  5. Scanning: C:\Users\Joshua\Documents\My Games\Spring\games
  6. Scanning: C:\Users\Joshua\Documents\My Games\Spring\packages
  7. [ThreadPool::SetThreadCount][1] #wanted=3 #current=4
  8. [ThreadPool::SetThreadCount][2] #threads=2
  9. [Threading] Main thread CPU affinity not set
  10. [f=0000000] SDL version: 1.2.10
  11. [f=0000000] GL version: 4.0.9896 Compatibility Profile Context
  12. [f=0000000] GL vendor: ATI Technologies Inc.
  13. [f=0000000] GL renderer: ATI Radeon HD 5450
  14. [f=0000000] GLSL version: 4.00
  15. [f=0000000] GLEW version: 1.5.8
  16. [f=0000000] Video RAM: total 736MB, available 961MB
  17. [f=0000000] GL info:
  18. haveARB: 1, haveGLSL: 1, ATI hacks: 1
  19. FBO support: 1, NPOT-texture support: 1, 24bit Z-buffer support: 0
  20. maximum texture size: 16384, compress MIP-map textures: 0
  21. maximum SmoothPointSize: 63, maximum vec4 varying/attributes: 16/16
  22. maximum drawbuffers: 8, maximum recommended indices/vertices: 16777215/2147483647
  23. number of UniformBufferBindings: 75 (64kB)
  24. [f=0000000] VSync disabled
  25. [f=0000000] Joysticks found: 0
  26. [f=0000000] Warning: Joystick 0 not found
  27. [f=0000000] [Initialize] CPU Clock: win32::TimeGetTime
  28. [f=0000000] [Initialize] CPU Cores: 4
  29. [f=0000000] [Startup] loading startscript from: C:/Users/Joshua/Documents/My Games/Spring/weblobby/script.spring
  30. [f=0000000] Connecting to 108.38.64.193:8251 using name GKAGamer
  31. [f=0000000] [Sound] OpenAL info:
  32. [f=0000000] [Sound] Available Devices:
  33. [f=0000000] [Sound] DirectSound Software
  34. [f=0000000] [Sound] Device: DirectSound Software
  35. [f=0000000] [Sound] Vendor: OpenAL Community
  36. [f=0000000] [Sound] Version: 1.1 ALSOFT 1.11.753
  37. [f=0000000] [Sound] Renderer: OpenAL Soft
  38. [f=0000000] [Sound] AL Extensions: AL_EXTX_buffer_sub_data AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_OFFSET AL_EXTX_sample_buffer_object AL_EXT_source_distance_model AL_LOKI_quadriphonic
  39. [f=0000000] [Sound] ALC Extensions: ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE ALC_EXT_disconnect ALC_EXT_EFX ALC_EXTX_thread_local_context
  40. [f=0000000] [Sound] EFX Enabled: yes
  41. [f=0000000] [Sound] Max Sounds: 128
  42. [f=0000000] Using map: Eye_Of_Horus_v2
  43. [f=0000000] Using game: Evolution RTS - v7.43
  44. [f=0000000] Using game archive: 670243f914656a8c0314b083c9de0244.sdp
  45. [f=0000000] recording demo: demos/20140413_112952_Eye_Of_Horus_v2_96.sdf
  46. [f=0000000] PreGame::GameDataReceived: 39 ms
  47. [f=0000000] [PreGame::UpdateClientNet] user number 3 (team 3, allyteam 0)
  48. [f=0000000] [LuaIntro] Searching for new Widgets
  49. [f=0000000] [LuaIntro] Scanning: LuaIntro/Addons/
  50. [f=0000000] [LuaIntro] Scanning: LuaIntro/Widgets/
  51. [f=0000000] [LuaIntro] Scanning: LuaIntro/SystemAddons/
  52. [f=0000000] [LuaIntro] Scanning: LuaIntro/SystemWidgets/
  53. [f=0000000] [LuaIntro] Scanning: LuaIntro/chili/
  54. [f=0000000] [LuaIntro] Found new widget "SpringLogo"
  55. [f=0000000] [LuaIntro] Found new widget "LoadTexture"
  56. [f=0000000] [LuaIntro] Found new widget "LoadProgress"
  57. [f=0000000] [LuaIntro] Found new widget "LoadScreen"
  58. [f=0000000] [LuaIntro] Found new widget "Music"
  59. [f=0000000] [LuaIntro] Loading widgets <>=vfs **=raw ()=unknown
  60. [f=0000000] [LuaIntro] Loading API widget: Chili Framework <api_chili.lua>
  61. [f=0000000] [LuaIntro] Warning: Headers files aren't supported anymore use "require" instead!
  62. [f=0000000] [LuaIntro] Loading widget: LoadProgress <loadprogress.lua>
  63. [f=0000000] [LuaIntro] Loading widget: LoadScreen <main.lua>
  64. [f=0000000] 1397384960
  65. [f=0000000] 60, currentSelection, 5
  66. [f=0000000] 60, currentSelection, 5
  67. [f=0000000] 60, currentSelection, 7
  68. [f=0000000] 60, currentSelection, 4
  69. [f=0000000] 60, currentSelection, 1
  70. [f=0000000] 60, currentSelection, 5
  71. [f=0000000] 60, currentSelection, 7
  72. [f=0000000] 60, currentSelection, 5
  73. [f=0000000] 60, currentSelection, 2
  74. [f=0000000] 60, currentSelection, 8
  75. [f=0000000] 60, currentSelection, 3
  76. [f=0000000] 60, currentSelection, 1
  77. [f=0000000] 60, currentSelection, 3
  78. [f=0000000] 60, currentSelection, 5
  79. [f=0000000] 60, currentSelection, 8
  80. [f=0000000] 60, currentSelection, 8
  81. [f=0000000] 60, currentSelection, 2
  82. [f=0000000] 60, currentSelection, 8
  83. [f=0000000] 60, currentSelection, 7
  84. [f=0000000] 60, currentSelection, 3
  85. [f=0000000] 60, currentSelection, 6
  86. [f=0000000] 60, currentSelection, 4
  87. [f=0000000] 60, currentSelection, 7
  88. [f=0000000] 60, currentSelection, 5
  89. [f=0000000] 60, currentSelection, 6
  90. [f=0000000] 60, currentSelection, 1
  91. [f=0000000] 60, currentSelection, 5
  92. [f=0000000] 60, currentSelection, 5
  93. [f=0000000] 60, currentSelection, 1
  94. [f=0000000] 60, currentSelection, 5
  95. [f=0000000] 60, currentSelection, 3
  96. [f=0000000] 60, currentSelection, 8
  97. [f=0000000] 60, currentSelection, 6
  98. [f=0000000] 60, currentSelection, 1
  99. [f=0000000] 60, currentSelection, 1
  100. [f=0000000] 60, currentSelection, 5
  101. [f=0000000] 60, currentSelection, 8
  102. [f=0000000] 60, currentSelection, 7
  103. [f=0000000] 60, currentSelection, 4
  104. [f=0000000] 60, currentSelection, 5
  105. [f=0000000] 60, currentSelection, 8
  106. [f=0000000] 60, currentSelection, 5
  107. [f=0000000] 60, currentSelection, 6
  108. [f=0000000] 60, currentSelection, 1
  109. [f=0000000] 60, currentSelection, 4
  110. [f=0000000] 60, currentSelection, 5
  111. [f=0000000] 60, currentSelection, 4
  112. [f=0000000] 60, currentSelection, 3
  113. [f=0000000] 60, currentSelection, 6
  114. [f=0000000] 60, currentSelection, 8
  115. [f=0000000] 60, currentSelection, 1
  116. [f=0000000] 60, currentSelection, 5
  117. [f=0000000] 60, currentSelection, 5
  118. [f=0000000] 60, currentSelection, 7
  119. [f=0000000] 60, currentSelection, 8
  120. [f=0000000] 60, currentSelection, 7
  121. [f=0000000] 60, currentSelection, 8
  122. [f=0000000] 60, currentSelection, 3
  123. [f=0000000] 60, currentSelection, 5
  124. [f=0000000] 60, currentSelection, 3
  125. [f=0000000] 60, currentSelection, 3
  126. [f=0000000] tipTextColor, <table>
  127. [f=0000000] backgroundImage1, bitmaps/ui/loadingscreen/background3.png
  128. [f=0000000] tipImage, bitmaps/ui/loadingscreen/ebombtip.png
  129. [f=0000000] tipText, Hoverbombs are extremely fast and maneuverable kamikaze bombs that deal heavy damage to structures and moderate damage to mobile units. They have a very high top speed but cannot turn well, so it's best to get it pointed in the correct direction before sending them in.
  130. [f=0000000] backgroundColor, <table>
  131. [f=0000000] fontShadow, true
  132. [f=0000000] [LuaIntro] Loading widget: Music <music.lua>
  133. [f=0000000] [LuaIntro] Loading widget: LoadTexture <bg_texture.lua>
  134. [f=0000000] [LuaIntro] Loading widget: Chili Docking <gui_chili_docking.lua>
  135. [f=0000000] [LuaIntro] LuaIntro v1.0 (Lua 5.1)
  136. [f=0000000] Parsing Map Information
  137. [f=0000000] Loading SMF
  138. [f=0000000] Loading Map (68 MB)
  139. [f=0000000] Loading Radar Icons
  140. [f=0000000] Loading GameData Definitions
  141. [f=0000000] Gameplay Speed is set to faster
  142. [f=0000000] Missing explosion def
  143. [f=0000000] Missing self-d def
  144. [f=0000000] Missing explosion def
  145. [f=0000000] Missing self-d def
  146. [f=0000000] Missing explosion def
  147. [f=0000000] Missing self-d def
  148. [f=0000000] Missing explosion def
  149. [f=0000000] Missing self-d def
  150. [f=0000000] Missing explosion def
  151. [f=0000000] Missing self-d def
  152. [f=0000000] Missing explosion def
  153. [f=0000000] Missing self-d def
  154. [f=0000000] Missing explosion def
  155. [f=0000000] Missing self-d def
  156. [f=0000000] Missing explosion def
  157. [f=0000000] Missing self-d def
  158. [f=0000000] Missing explosion def
  159. [f=0000000] Missing self-d def
  160. [f=0000000] Missing explosion def
  161. [f=0000000] Missing self-d def
  162. [f=0000000] Missing explosion def
  163. [f=0000000] Missing self-d def
  164. [f=0000000] Missing explosion def
  165. [f=0000000] Missing self-d def
  166. [f=0000000] Missing explosion def
  167. [f=0000000] Missing self-d def
  168. [f=0000000] Missing explosion def
  169. [f=0000000] Missing self-d def
  170. [f=0000000] Missing explosion def
  171. [f=0000000] Missing self-d def
  172. [f=0000000] Missing explosion def
  173. [f=0000000] Missing self-d def
  174. [f=0000000] Missing explosion def
  175. [f=0000000] Missing self-d def
  176. [f=0000000] Missing explosion def
  177. [f=0000000] Missing self-d def
  178. [f=0000000] Missing explosion def
  179. [f=0000000] Missing self-d def
  180. [f=0000000] Missing explosion def
  181. [f=0000000] Missing self-d def
  182. [f=0000000] Missing explosion def
  183. [f=0000000] Missing self-d def
  184. [f=0000000] Missing explosion def
  185. [f=0000000] Missing self-d def
  186. [f=0000000] Missing explosion def
  187. [f=0000000] Missing self-d def
  188. [f=0000000] Missing explosion def
  189. [f=0000000] Missing self-d def
  190. [f=0000000] Missing explosion def
  191. [f=0000000] Missing self-d def
  192. [f=0000000] Missing explosion def
  193. [f=0000000] Missing self-d def
  194. [f=0000000] Missing explosion def
  195. [f=0000000] Missing self-d def
  196. [f=0000000] Missing explosion def
  197. [f=0000000] Missing self-d def
  198. [f=0000000] Missing explosion def
  199. [f=0000000] Missing self-d def
  200. [f=0000000] Missing explosion def
  201. [f=0000000] Missing self-d def
  202. [f=0000000] Missing explosion def
  203. [f=0000000] Missing self-d def
  204. [f=0000000] Missing explosion def
  205. [f=0000000] Missing self-d def
  206. [f=0000000] Missing explosion def
  207. [f=0000000] Missing self-d def
  208. [f=0000000] Missing explosion def
  209. [f=0000000] Missing self-d def
  210. [f=0000000] Missing explosion def
  211. [f=0000000] Missing self-d def
  212. [f=0000000] Missing self-d def
  213. [f=0000000] Missing explosion def
  214. [f=0000000] Missing self-d def
  215. [f=0000000] Missing explosion def
  216. [f=0000000] Missing self-d def
  217. [f=0000000] Missing explosion def
  218. [f=0000000] Missing self-d def
  219. [f=0000000] Missing explosion def
  220. [f=0000000] Missing self-d def
  221. [f=0000000] Missing explosion def
  222. [f=0000000] Missing self-d def
  223. [f=0000000] Missing explosion def
  224. [f=0000000] Missing self-d def
  225. [f=0000000] Missing explosion def
  226. [f=0000000] Missing self-d def
  227. [f=0000000] Missing explosion def
  228. [f=0000000] Missing self-d def
  229. [f=0000000] Missing explosion def
  230. [f=0000000] Missing self-d def
  231. [f=0000000] Missing explosion def
  232. [f=0000000] Missing self-d def
  233. [f=0000000] Missing explosion def
  234. [f=0000000] Missing self-d def
  235. [f=0000000] Warning! moveDef: HOVERTANK2, assigning default value for missing tag heatproduced(60)
  236. [f=0000000] Warning! moveDef: HOVERTANK2, assigning default value for missing tag depthmod(0.10000000149012)
  237. [f=0000000] Warning! moveDef: TANK2, assigning default value for missing tag heatproduced(60)
  238. [f=0000000] Warning! moveDef: TANK2, assigning default value for missing tag depthmod(0.10000000149012)
  239. [f=0000000] Warning! moveDef: NORMALTANK2, assigning default value for missing tag heatproduced(60)
  240. [f=0000000] Warning! moveDef: NORMALTANK2, assigning default value for missing tag depthmod(0.10000000149012)
  241. [f=0000000] Warning! moveDef: TANK4, assigning default value for missing tag heatproduced(60)
  242. [f=0000000] Warning! moveDef: TANK4, assigning default value for missing tag depthmod(0.10000000149012)
  243. [f=0000000] Warning! moveDef: HOVERTANKEXPERIMENTAL9, assigning default value for missing tag heatproduced(60)
  244. [f=0000000] Warning! moveDef: HOVERTANKEXPERIMENTAL9, assigning default value for missing tag depthmod(0.10000000149012)
  245. [f=0000000] Warning! moveDef: EXPERIMENTALTANK12, assigning default value for missing tag heatproduced(60)
  246. [f=0000000] Warning! moveDef: EXPERIMENTALTANK12, assigning default value for missing tag depthmod(0.10000000149012)
  247. [f=0000000] Warning! moveDef: UBOAT4, assigning default value for missing tag heatproduced(60)
  248. [f=0000000] Warning! moveDef: UBOAT4, assigning default value for missing tag depthmod(0.10000000149012)
  249. [f=0000000] Warning! moveDef: TANK3, assigning default value for missing tag heatproduced(60)
  250. [f=0000000] Warning! moveDef: TANK3, assigning default value for missing tag depthmod(0.10000000149012)
  251. [f=0000000] Warning! moveDef: TANK1, assigning default value for missing tag heatproduced(60)
  252. [f=0000000] Warning! moveDef: TANK1, assigning default value for missing tag depthmod(0.10000000149012)
  253. [f=0000000] Warning! moveDef: EXPERIMENTALTANK10, assigning default value for missing tag heatproduced(60)
  254. [f=0000000] Warning! moveDef: EXPERIMENTALTANK10, assigning default value for missing tag depthmod(0.10000000149012)
  255. [f=0000000] Warning! moveDef: HOVERTANK4, assigning default value for missing tag heatproduced(60)
  256. [f=0000000] Warning! moveDef: HOVERTANK4, assigning default value for missing tag depthmod(0.10000000149012)
  257. [f=0000000] Warning! moveDef: HOVERTANK5, assigning default value for missing tag heatproduced(60)
  258. [f=0000000] Warning! moveDef: HOVERTANK5, assigning default value for missing tag depthmod(0.10000000149012)
  259. [f=0000000] Warning! moveDef: ALLTERRTANK4, assigning default value for missing tag heatproduced(60)
  260. [f=0000000] Warning! moveDef: ALLTERRTANK4, assigning default value for missing tag depthmod(0.10000000149012)
  261. [f=0000000] Warning! moveDef: HOVERTANK6, assigning default value for missing tag heatproduced(60)
  262. [f=0000000] Warning! moveDef: HOVERTANK6, assigning default value for missing tag depthmod(0.10000000149012)
  263. [f=0000000] Warning! moveDef: ALLTERRTANK3, assigning default value for missing tag heatproduced(60)
  264. [f=0000000] Warning! moveDef: ALLTERRTANK3, assigning default value for missing tag depthmod(0.10000000149012)
  265. [f=0000000] Warning! moveDef: ALLTERRTANK5, assigning default value for missing tag heatproduced(60)
  266. [f=0000000] Warning! moveDef: ALLTERRTANK5, assigning default value for missing tag depthmod(0.10000000149012)
  267. [f=0000000] Warning! moveDef: ALLTERRTANK6, assigning default value for missing tag heatproduced(60)
  268. [f=0000000] Warning! moveDef: ALLTERRTANK6, assigning default value for missing tag depthmod(0.10000000149012)
  269. [f=0000000] Warning! moveDef: HOVERTANK3, assigning default value for missing tag heatproduced(60)
  270. [f=0000000] Warning! moveDef: HOVERTANK3, assigning default value for missing tag depthmod(0.10000000149012)
  271. [f=0000000] Warning! moveDef: COMMANDERTANK4, assigning default value for missing tag heatproduced(60)
  272. [f=0000000] Warning! moveDef: COMMANDERTANK4, assigning default value for missing tag depthmod(0.10000000149012)
  273. [f=0000000] Loading all definitions: 0.317000
  274. [f=0000000] Game::LoadDefs (GameData): 334 ms
  275. [f=0000000] Loading Sound Definitions
  276. [f=0000000] [Sound] parsed 11 sounds from gamedata/sounds.lua
  277. [f=0000000] Game::LoadDefs (Sound): 2 ms
  278. [f=0000000] Creating Smooth Height Mesh
  279. [f=0000000] SmoothHeightMesh::MakeSmoothMesh: 69 ms
  280. [f=0000000] Creating QuadField & CEGs
  281. [f=0000000] [CDamageArrayHandler] number of ArmorDefs: 4
  282. [f=0000000] [RegisterAssimpModelFormats] supported Assimp model formats: *.3ds;*.blend;*.dae;*.lwo;
  283. [f=0000000] Creating Unit Textures
  284. [f=0000000] Creating Sky
  285. [f=0000000] Loading Weapon Definitions
  286. [f=0000000] Warning: WeaponDef (eallterrshield_allterrshield) The "isShield" tag has been removed. Use the weaponType="Shield" tag instead!
  287. [f=0000000] Warning: WeaponDef (ekmar_shield) The "isShield" tag has been removed. Use the weaponType="Shield" tag instead!
  288. [f=0000000] Warning: WeaponDef (eshieldgen_shield) The "isShield" tag has been removed. Use the weaponType="Shield" tag instead!
  289. [f=0000000] Loading Unit Definitions
  290. [f=0000000] Error: Couldn't find WeaponDef NOWEAPON and explodeAs for armflash is missing!
  291. [f=0000000] Warning: eradar2: Given yardmap requires 20 extra char(s)!
  292. [f=0000000] Loading Feature Definitions
  293. [f=0000000] Error: [GetFeatureDef] could not find FeatureDef "rubble"
  294. [f=0000000] Error: [GetFeatureDef] could not find FeatureDef "rubble"
  295. [f=0000000] Error: [GetFeatureDef] could not find FeatureDef "rubble"
  296. [f=0000000] Error: [GetFeatureDef] could not find FeatureDef "rubble"
  297. [f=0000000] Reading Estimate PathCosts [8]
  298. [f=0000000] Reading Estimate PathCosts [32]
  299. [f=0000000] [CPathManager] pathing data checksum: 51844a74
  300. [f=0000000] [IPathManager::GetInstance] using DEFAULT path-manager
  301. [f=0000000] Initializing Map Features
  302. [f=0000000] Error: [LoadFeaturesFromMap] unknown map feature type ""
  303. [f=0000000] Creating ShadowHandler & DecalHandler
  304. [f=0000000] FBO::maxSamples: 4
  305. [f=0000000] Creating GroundDrawer
  306. [f=0000000] Loading Map Tiles
  307. [f=0000000] Loading Square Textures
  308. [f=0000000] CSMFGroundTextures::ConvolveHeightMap: 4 ms
  309. [f=0000000] Switching to ROAM Mesh Rendering
  310. [f=0000000] [Shader] Warning: [GLSL-SO::Compile] shader-object name: GLSL/SMFVertProg.glsl, compile-log:
  311. Vertex shader failed to compile with the following errors:
  312. ERROR: 6:33: error(#71) Syntax error incorrect preprocessor directive
  313. WARNING: 6:33: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  314. ERROR: 6:39: error(#71) Syntax error incorrect preprocessor directive
  315. WARNING: 6:39: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  316. ERROR: error(#273) 2 compilation errors. No code generated
  317.  
  318.  
  319. [f=0000000] [Shader] Warning:
  320. // SHADER VERSION
  321. #version 120
  322. // SHADER FLAGS
  323. #define SMF_TEXSQUARE_SIZE 1024.000000
  324. #define SMF_INTENSITY_MULT 0.823529
  325. // SHADER SOURCE
  326. #line 1
  327. #define SMF_TEXSQR_SIZE 1024.0
  328. #define SMF_DETAILTEX_RES 0.02
  329.  
  330. // uniform vec2 mapSizePO2; // pwr2map{x,z} * SQUARE_SIZE (TODO programmatically #define this)
  331. // uniform vec2 mapSize; // map{x,z} * SQUARE_SIZE (TODO programmatically #define this)
  332. // uniform vec2 mapHeights; // readmap->curr{Min, Max}Height
  333.  
  334. uniform ivec2 texSquare;
  335. uniform vec3 cameraPos;
  336. uniform vec4 lightDir; // mapInfo->light.sunDir
  337.  
  338. varying vec3 halfDir;
  339. varying float fogFactor;
  340. varying vec4 vertexWorldPos;
  341. varying vec2 diffuseTexCoords;
  342.  
  343.  
  344. void main() {
  345. // calc some lighting variables
  346. vec3 viewDir = vec3(gl_ModelViewMatrixInverse * vec4(0.0, 0.0, 0.0, 1.0));
  347. viewDir = normalize(viewDir - gl_Vertex.xyz);
  348. halfDir = normalize(lightDir.xyz + viewDir);
  349. vertexWorldPos = gl_Vertex;
  350.  
  351. // calc texcoords
  352. diffuseTexCoords = (floor(gl_Vertex.xz) / SMF_TEXSQR_SIZE) - vec2(texSquare);
  353.  
  354. // transform vertex pos
  355. gl_Position = gl_ModelViewMatrix * gl_Vertex;
  356. gl_ClipVertex = gl_Position;
  357.  
  358. #if (DEFERRED_MODE == 0)
  359. float fogCoord = length(gl_Position.xyz);
  360. #endif
  361.  
  362. gl_Position = gl_ProjectionMatrix * gl_Position;
  363.  
  364. #if (DEFERRED_MODE == 0)
  365. // emulate linear fog
  366. fogFactor = (gl_Fog.end - fogCoord) * gl_Fog.scale; // gl_Fog.scale == 1.0 / (gl_Fog.end - gl_Fog.start)
  367. fogFactor = clamp(fogFactor, 0.0, 1.0);
  368. #endif
  369. }
  370.  
  371.  
  372. [f=0000000] [Shader] Warning: [GLSL-SO::Compile] shader-object name: GLSL/SMFFragProg.glsl, compile-log:
  373. Fragment shader failed to compile with the following errors:
  374. ERROR: 6:14: error(#71) Syntax error incorrect preprocessor directive
  375. WARNING: 6:14: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  376. ERROR: 6:18: error(#71) Syntax error incorrect preprocessor directive
  377. WARNING: 6:18: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  378. ERROR: 6:29: error(#71) Syntax error incorrect preprocessor directive
  379. WARNING: 6:29: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  380. ERROR: 6:35: error(#71) Syntax error incorrect preprocessor directive
  381. WARNING: 6:35: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  382. ERROR: 6:43: error(#71) Syntax error incorrect preprocessor directive
  383. WARNING: 6:43: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  384. ERROR: 6:48: error(#71) Syntax error incorrect preprocessor directive
  385. WARNING: 6:48: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  386. ERROR: 6:52: error(#71) Syntax error incorrect preprocessor directive
  387. WARNING: 6:52: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  388. ERROR: 6:56: error(#71) Syntax error incorrect preprocessor directive
  389. WARNING: 6:56: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  390. ERROR: 6:60: error(#71) Syntax error incorrect preprocessor directive
  391. WARNING: 6:60: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  392. ERROR: 6:75: error(#71) Syntax error incorrect preprocessor directive
  393. WARNING: 6:75: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  394. ERROR: 6:110: error(#71) Syntax error incorrect preprocessor directive
  395. WARNING: 6:110: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  396. ERROR: 6:137: error(#71) Syntax error incorrect preprocessor directive
  397. WARNING: 6:137: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  398. ERROR: 6:142: error(#71) Syntax error incorrect preprocessor directive
  399. WARNING: 6:142: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  400. ERROR: 6:149: error(#71) Syntax error incorrect preprocessor directive
  401. WARNING: 6:149: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  402. ERROR: 6:196: error(#71) Syntax error incorrect preprocessor directive
  403. WARNING: 6:196: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  404. ERROR: 6:206: error(#71) Syntax error incorrect preprocessor directive
  405. WARNING: 6:206: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  406. ERROR: 6:226: error(#71) Syntax error incorrect preprocessor directive
  407. WARNING: 6:226: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  408. ERROR: 6:236: error(#71) Syntax error incorrect preprocessor directive
  409. WARNING: 6:236: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  410. ERROR: 6:247: error(#71) Syntax error incorrect preprocessor directive
  411. WARNING: 6:247: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  412. ERROR: 6:257: error(#71) Syntax error incorrect preprocessor directive
  413. WARNING: 6:257: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  414. ERROR: 6:269: error(#71) Syntax error incorrect preprocessor directive
  415. WARNING: 6:269: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  416. ERROR: 6:284: error(#71) Syntax error incorrect preprocessor directive
  417. WARNING: 6:284: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  418. ERROR: 6:294: error(#71) Syntax error incorrect preprocessor directive
  419. WARNING: 6:294: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  420. ERROR: 6:299: error(#71) Syntax error incorrect preprocessor directive
  421. WARNING: 6:299: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  422. ERROR: 6:305: error(#71) Syntax error incorrect preprocessor directive
  423. WARNING: 6:305: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  424. ERROR: 6:308: error(#71) Syntax error incorrect preprocessor directive
  425. WARNING: 6:308: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  426. ERROR: 6:321: error(#71) Syntax error incorrect preprocessor directive
  427. WARNING: 6:321: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  428. ERROR: 6:322: error(#143) Undeclared identifier MAX_DYNAMIC_MAP_LIGHTS
  429. ERROR: 6:323: error(#143) Undeclared identifier BASE_DYNAMIC_MAP_LIGHT
  430. ERROR: 6:323: error(#166) Integer expression required []
  431. ERROR: 6:324: error(#166) Integer expression required []
  432. ERROR: 6:326: error(#166) Integer expression required []
  433. ERROR: 6:342: error(#166) Integer expression required []
  434. ERROR: 6:343: error(#166) Integer expression required []
  435. ERROR: 6:345: error(#71) Syntax error incorrect preprocessor directive
  436. WARNING: 6:345: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  437. ERROR: 6:353: error(#166) Integer expression required []
  438. ERROR: 6:354: error(#166) Integer expression required []
  439. ERROR: 6:355: error(#166) Integer expression required []
  440. ERROR: 6:359: error(#71) Syntax error incorrect preprocessor directive
  441. WARNING: 6:359: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  442. ERROR: 6:360: error(#143) Undeclared identifier GBUFFER_NORMTEX_IDX
  443. ERROR: 6:360: error(#166) Integer expression required []
  444. ERROR: 6:361: error(#143) Undeclared identifier GBUFFER_DIFFTEX_IDX
  445. ERROR: 6:361: error(#166) Integer expression required []
  446. ERROR: 6:362: error(#143) Undeclared identifier GBUFFER_SPECTEX_IDX
  447. ERROR: 6:362: error(#166) Integer expression required []
  448. ERROR: 6:363: error(#143) Undeclared identifier GBUFFER_EMITTEX_IDX
  449. ERROR: 6:363: error(#166) Integer expression required []
  450. ERROR: 6:364: error(#143) Undeclared identifier GBUFFER_MISCTEX_IDX
  451. ERROR: 6:364: error(#166) Integer expression required []
  452. ERROR: error(#273) 49 compilation errors. No code generated
  453.  
  454.  
  455. [f=0000000] [Shader] Warning:
  456. // SHADER VERSION
  457. #version 120
  458. // SHADER FLAGS
  459. #define SMF_TEXSQUARE_SIZE 1024.000000
  460. #define SMF_INTENSITY_MULT 0.823529
  461. // SHADER SOURCE
  462. #line 1
  463. #define SSMF_UNCOMPRESSED_NORMALS 0
  464. #define SMF_SHALLOW_WATER_DEPTH (10.0 )
  465. #define SMF_SHALLOW_WATER_DEPTH_INV ( 1.0 / SMF_SHALLOW_WATER_DEPTH)
  466. #define SMF_DETAILTEX_RES 0.02
  467.  
  468. uniform sampler2D diffuseTex;
  469. uniform sampler2D normalsTex;
  470. uniform sampler2D detailTex;
  471. uniform sampler2D infoTex;
  472. uniform vec2 normalTexGen; // either 1.0/mapSize (when NPOT are supported) or 1.0/mapSizePO2
  473. uniform vec2 specularTexGen; // 1.0/mapSize
  474.  
  475. #if (SMF_ARB_LIGHTING == 0)
  476. uniform sampler2D specularTex;
  477. #endif
  478.  
  479. #if (HAVE_SHADOWS == 1)
  480. uniform sampler2DShadow shadowTex;
  481. uniform mat4 shadowMat;
  482. uniform vec4 shadowParams;
  483. #endif
  484.  
  485. uniform vec3 groundAmbientColor;
  486. uniform vec3 groundDiffuseColor;
  487. uniform vec3 groundSpecularColor;
  488. uniform float groundShadowDensity;
  489.  
  490. #if (SMF_WATER_ABSORPTION == 1)
  491. uniform vec3 waterMinColor;
  492. uniform vec3 waterBaseColor;
  493. uniform vec3 waterAbsorbColor;
  494. #endif
  495.  
  496. #if (SMF_DETAIL_TEXTURE_SPLATTING == 1)
  497. uniform sampler2D splatDetailTex;
  498. uniform sampler2D splatDistrTex;
  499. uniform vec4 splatTexMults; // per-channel splat intensity multipliers
  500. uniform vec4 splatTexScales; // defaults to SMF_DETAILTEX_RES per channel
  501. #endif
  502.  
  503.  
  504. #if (SMF_SKY_REFLECTIONS == 1)
  505. uniform samplerCube skyReflectTex;
  506. uniform sampler2D skyReflectModTex;
  507. #endif
  508.  
  509. #if (SMF_DETAIL_NORMALS == 1)
  510. uniform sampler2D detailNormalTex;
  511. #endif
  512.  
  513. #if (SMF_LIGHT_EMISSION == 1)
  514. uniform sampler2D lightEmissionTex;
  515. #endif
  516.  
  517. #if (SMF_PARALLAX_MAPPING == 1)
  518. uniform sampler2D parallaxHeightTex;
  519. #endif
  520.  
  521. #if (HAVE_INFOTEX == 1)
  522. uniform float infoTexIntensityMul;
  523. uniform vec2 infoTexGen; // 1.0/(pwr2map{x,z} * SQUARE_SIZE)
  524. #endif
  525.  
  526. uniform vec4 lightDir;
  527. uniform vec3 cameraPos;
  528. varying vec3 halfDir;
  529.  
  530. varying float fogFactor;
  531. varying vec4 vertexWorldPos;
  532. varying vec2 diffuseTexCoords;
  533.  
  534.  
  535.  
  536. #if (SMF_PARALLAX_MAPPING == 1)
  537. vec2 GetParallaxUVOffset(vec2 uv, vec3 dir) {
  538. vec4 texel = texture2D(parallaxHeightTex, uv);
  539.  
  540. // RG: height in [ 0.0, 1.0] (256^2 strata)
  541. // B: scale in [ 0.0, 1.0] (256 strata), eg. 0.04 (~10.0/256.0)
  542. // A: bias in [-0.5, 0.5] (256 strata), eg. -0.02 (~75.0/256.0)
  543. //
  544. #define RMUL 65280.0 // 255 * 256
  545. #define GMUL 256.0
  546. #define HDIV 65536.0
  547.  
  548. float heightValue = (texel.r * RMUL + texel.g * GMUL) / HDIV;
  549. float heightScale = texel.b;
  550. float heightBias = texel.a - 0.5;
  551. float heightOffset = heightValue * heightScale + heightBias;
  552.  
  553. return ((dir.xy / dir.z) * heightOffset);
  554. }
  555. #endif
  556.  
  557. vec3 GetFragmentNormal(vec2 uv) {
  558. vec3 normal;
  559.  
  560. #if (SSMF_UNCOMPRESSED_NORMALS == 1)
  561. normal = normalize(texture2D(normalsTex, uv).xyz);
  562. #else
  563. normal.xz = texture2D(normalsTex, uv).ra;
  564. normal.y = sqrt(1.0 - dot(normal.xz, normal.xz));
  565. #endif
  566.  
  567. return normal;
  568. }
  569.  
  570. vec4 GetDetailTextureColor(vec2 uv) {
  571. #if (SMF_DETAIL_TEXTURE_SPLATTING == 0)
  572. vec2 detailTexCoord = vertexWorldPos.xz * vec2(SMF_DETAILTEX_RES);
  573. vec4 detailCol = (texture2D(detailTex, detailTexCoord) * 2.0) - 1.0;
  574. #else
  575. vec4 splatTexCoord0 = vertexWorldPos.xzxz * splatTexScales.rrgg;
  576. vec4 splatTexCoord1 = vertexWorldPos.xzxz * splatTexScales.bbaa;
  577. vec4 splatDetails;
  578. splatDetails.r = texture2D(splatDetailTex, splatTexCoord0.st).r;
  579. splatDetails.g = texture2D(splatDetailTex, splatTexCoord0.pq).g;
  580. splatDetails.b = texture2D(splatDetailTex, splatTexCoord1.st).b;
  581. splatDetails.a = texture2D(splatDetailTex, splatTexCoord1.pq).a;
  582. splatDetails = (splatDetails * 2.0) - 1.0;
  583.  
  584. vec4 splatCofac = texture2D(splatDistrTex, uv) * splatTexMults;
  585. vec4 detailCol = vec4(dot(splatDetails, splatCofac));
  586. #endif
  587.  
  588. return detailCol;
  589. }
  590.  
  591. vec4 GetShadeInt(float groundLightInt, float groundShadowCoeff, float groundDiffuseAlpha) {
  592. vec4 groundShadeInt = vec4(0.0, 0.0, 0.0, 1.0);
  593. vec4 waterShadeInt = vec4(0.0, 0.0, 0.0, 1.0);
  594.  
  595. groundShadeInt.rgb = groundAmbientColor + groundDiffuseColor * (groundLightInt * groundShadowCoeff);
  596. groundShadeInt.rgb *= SMF_INTENSITY_MULT;
  597.  
  598. #if (SMF_VOID_WATER == 1)
  599. // cut out all underwater fragments indiscriminately
  600. groundShadeInt.a = float(vertexWorldPos.y >= 0.0);
  601. #endif
  602.  
  603. #if (SMF_VOID_GROUND == 1)
  604. // assume the map(per)'s diffuse texture provides sensible alphas
  605. // note that voidground overrides voidwater if *both* are enabled
  606. // (limiting it to just above-water fragments would be arbitrary)
  607. groundShadeInt.a = groundDiffuseAlpha;
  608. #endif
  609.  
  610. #if (SMF_WATER_ABSORPTION == 1)
  611. {
  612. float waterShadeAlpha = abs(vertexWorldPos.y) * SMF_SHALLOW_WATER_DEPTH_INV;
  613. float waterShadeDecay = 0.2 + (waterShadeAlpha * 0.1);
  614. float vertexStepHeight = min(1023.0, -floor(vertexWorldPos.y));
  615. float waterLightInt = min((groundLightInt + 0.2) * 2.0, 1.0);
  616.  
  617. // vertex below shallow water depth --> alpha=1
  618. // vertex above shallow water depth --> alpha=waterShadeAlpha
  619. //
  620. waterShadeAlpha = min(1.0, waterShadeAlpha + float(vertexWorldPos.y <= -SMF_SHALLOW_WATER_DEPTH));
  621.  
  622. waterShadeInt.rgb = waterBaseColor.rgb - (waterAbsorbColor.rgb * vertexStepHeight);
  623. waterShadeInt.rgb = max(waterMinColor.rgb, waterShadeInt.rgb);
  624. waterShadeInt.rgb *= (SMF_INTENSITY_MULT * waterLightInt);
  625.  
  626. // allow voidground maps to create holes in the seabed
  627. // (SMF_WATER_ABSORPTION == 1 implies voidwater is not
  628. // enabled but says nothing about the voidground state)
  629. waterShadeInt.a = groundShadeInt.a;
  630.  
  631. // make shadowed areas darker over deeper water
  632. waterShadeInt.rgb -= (waterShadeInt.rgb * waterShadeDecay * (1.0 - groundShadowCoeff));
  633.  
  634. // if depth is greater than _SHALLOW_ depth, select waterShadeInt
  635. // otherwise interpolate between groundShadeInt and waterShadeInt
  636. // (both are already cosine-weighted)
  637. waterShadeInt.rgb = mix(groundShadeInt.rgb, waterShadeInt.rgb, waterShadeAlpha);
  638. }
  639.  
  640. return mix(groundShadeInt, waterShadeInt, float(vertexWorldPos.y < 0.0));
  641. #else
  642. return groundShadeInt;
  643. #endif
  644. }
  645.  
  646.  
  647.  
  648. void main() {
  649. vec2 diffTexCoords = diffuseTexCoords;
  650. vec2 specTexCoords = vertexWorldPos.xz * specularTexGen;
  651. vec2 normTexCoords = vertexWorldPos.xz * normalTexGen;
  652.  
  653. // not calculated in the vertex shader to save varying components (OpenGL2.0 allows just 32)
  654. vec3 cameraDir = vertexWorldPos.xyz - cameraPos;
  655. vec3 normal = GetFragmentNormal(normTexCoords);
  656.  
  657. #if (SMF_DETAIL_NORMALS == 1 || SMF_PARALLAX_MAPPING == 1)
  658. // detail-normals are (assumed to be) defined within STN space
  659. // (for a regular vertex normal equal to <0, 1, 0>, the S- and
  660. // T-tangents are aligned with Spring's +x and +z (!) axes)
  661. vec3 tTangent = cross(normal, vec3(-1.0, 0.0, 0.0));
  662. vec3 sTangent = cross(normal, tTangent);
  663. mat3 stnMatrix = mat3(sTangent, tTangent, normal);
  664. #endif
  665.  
  666.  
  667. #if (SMF_PARALLAX_MAPPING == 1)
  668. {
  669. // use specular-texture coordinates to index parallaxHeightTex
  670. // (ie. specularTex and parallaxHeightTex must have equal size)
  671. // cameraDir does not need to be normalized, x/z and y/z ratios
  672. // do not change
  673. vec2 uvOffset = GetParallaxUVOffset(specTexCoords, transpose(stnMatrix) * cameraDir);
  674. vec2 normTexSize = 1.0 / normalTexGen;
  675. vec2 specTexSize = 1.0 / specularTexGen;
  676.  
  677. // scale the parallax offset since it is in spectex-space
  678. diffTexCoords += (uvOffset * (specTexSize / SMF_TEXSQUARE_SIZE));
  679. normTexCoords += (uvOffset * (specTexSize / normTexSize));
  680. specTexCoords += (uvOffset);
  681.  
  682. normal = GetFragmentNormal(normTexCoords);
  683. }
  684. #endif
  685.  
  686.  
  687. #if (SMF_DETAIL_NORMALS == 1)
  688. {
  689. vec4 dtSample = texture2D(detailNormalTex, normTexCoords);
  690. vec3 dtNormal = (dtSample.xyz * 2.0) - 1.0;
  691.  
  692. // convert dtNormal from TS to WS before mixing
  693. normal = normalize(mix(normal, stnMatrix * dtNormal, dtSample.a));
  694. }
  695. #endif
  696.  
  697. #if (DEFERRED_MODE == 0)
  698. float cosAngleDiffuse = clamp(dot(normalize(lightDir.xyz), normal), 0.0, 1.0);
  699. float cosAngleSpecular = clamp(dot(normalize(halfDir), normal), 0.0, 1.0);
  700. #endif
  701.  
  702. vec4 diffuseCol = texture2D(diffuseTex, diffTexCoords);
  703. vec4 detailCol = GetDetailTextureColor(specTexCoords);
  704. // non-zero default specularity on non-SSMF maps (for DL)
  705. vec4 specularCol = vec4(0.5, 0.5, 0.5, 1.0);
  706. vec4 emissionCol = vec4(0.0, 0.0, 0.0, 0.0);
  707.  
  708. #if (DEFERRED_MODE == 0 && SMF_SKY_REFLECTIONS == 1)
  709. {
  710. // cameraDir does not need to be normalized for reflect()
  711. vec3 reflectDir = reflect(cameraDir, normal);
  712. vec3 reflectCol = textureCube(skyReflectTex, gl_NormalMatrix * reflectDir).rgb;
  713. vec3 reflectMod = texture2D(skyReflectModTex, specTexCoords).rgb;
  714.  
  715. diffuseCol.rgb = mix(diffuseCol.rgb, reflectCol, reflectMod);
  716. }
  717. #endif
  718. #if (DEFERRED_MODE == 0 && HAVE_INFOTEX == 1)
  719. // increase contrast and brightness for the overlays
  720. // TODO: make the multiplier configurable by users?
  721. vec2 infoTexCoords = vertexWorldPos.xz * infoTexGen;
  722. diffuseCol.rgb += (texture2D(infoTex, infoTexCoords).rgb * infoTexIntensityMul);
  723. diffuseCol.rgb -= (vec3(0.5, 0.5, 0.5) * float(infoTexIntensityMul == 1.0));
  724. #endif
  725.  
  726.  
  727.  
  728. float shadowCoeff = 1.0;
  729.  
  730. #if (DEFERRED_MODE == 0 && HAVE_SHADOWS == 1)
  731. {
  732. vec2 p17 = vec2(shadowParams.z, shadowParams.z);
  733. vec2 p18 = vec2(shadowParams.w, shadowParams.w);
  734.  
  735. vec4 vertexShadowPos = shadowMat * vertexWorldPos;
  736. vertexShadowPos.st *= (inversesqrt(abs(vertexShadowPos.st) + p17) + p18);
  737. vertexShadowPos.st += shadowParams.xy;
  738.  
  739. // same as ARB shader: shadowCoeff = 1 - (1 - shadowCoeff) * groundShadowDensity
  740. shadowCoeff = shadow2DProj(shadowTex, vertexShadowPos).r;
  741. shadowCoeff = mix(1.0, shadowCoeff, groundShadowDensity);
  742. }
  743. #endif
  744.  
  745. #if (DEFERRED_MODE == 0)
  746. {
  747. // GroundMaterialAmbientDiffuseColor * LightAmbientDiffuseColor
  748. vec4 shadeInt = GetShadeInt(cosAngleDiffuse, shadowCoeff, diffuseCol.a);
  749.  
  750. gl_FragColor.rgb = (diffuseCol.rgb + detailCol.rgb) * shadeInt.rgb;
  751. gl_FragColor.a = shadeInt.a;
  752. }
  753. #endif
  754.  
  755. #if (SMF_LIGHT_EMISSION == 1)
  756. {
  757. // apply self-illumination aka. glow, not masked by shadows
  758. emissionCol = texture2D(lightEmissionTex, specTexCoords);
  759.  
  760. #if (DEFERRED_MODE == 0)
  761. gl_FragColor.rgb = gl_FragColor.rgb * (1.0 - emissionCol.a) + emissionCol.rgb;
  762. #endif
  763. }
  764. #endif
  765.  
  766. #if (SMF_ARB_LIGHTING == 0)
  767. specularCol = texture2D(specularTex, specTexCoords);
  768.  
  769. #if (DEFERRED_MODE == 0)
  770. // sun specular lighting contribution
  771. float specularExp = specularCol.a * 16.0;
  772. float specularPow = pow(cosAngleSpecular, specularExp);
  773.  
  774. vec3 specularInt = specularCol.rgb * specularPow;
  775. specularInt *= shadowCoeff;
  776.  
  777. // no need to multiply by groundSpecularColor anymore
  778. gl_FragColor.rgb += specularInt;
  779. #endif
  780. #endif
  781.  
  782. #if (DEFERRED_MODE == 0 && MAX_DYNAMIC_MAP_LIGHTS > 0)
  783. for (int i = 0; i < MAX_DYNAMIC_MAP_LIGHTS; i++) {
  784. vec3 lightVec = gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].position.xyz - vertexWorldPos.xyz;
  785. vec3 halfVec = gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].halfVector.xyz;
  786.  
  787. float lightRadius = gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].constantAttenuation;
  788. float lightDistance = length(lightVec);
  789. float lightScale = float(lightDistance <= lightRadius);
  790. float lightCosAngDiff = clamp(dot(normal, lightVec / lightDistance), 0.0, 1.0);
  791. float lightCosAngSpec = clamp(dot(normal, normalize(halfVec)), 0.0, 1.0);
  792. #ifdef OGL_SPEC_ATTENUATION
  793. float lightAttenuation =
  794. (gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].constantAttenuation) +
  795. (gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].linearAttenuation * lightDistance) +
  796. (gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].quadraticAttenuation * lightDistance * lightDistance);
  797.  
  798. lightAttenuation = 1.0 / max(lightAttenuation, 1.0);
  799. #else
  800. float lightAttenuation = 1.0 - min(1.0, ((lightDistance * lightDistance) / (lightRadius * lightRadius)));
  801. #endif
  802.  
  803. float vectorDot = dot((-lightVec / lightDistance), gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].spotDirection);
  804. float cutoffDot = gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].spotCosCutoff;
  805.  
  806. #if (SMF_ARB_LIGHTING == 0)
  807. float lightSpecularPow = max(0.0, pow(lightCosAngSpec, specularExp));
  808. #else
  809. float lightSpecularPow = 0.0;
  810. #endif
  811.  
  812. lightScale *= float(vectorDot >= cutoffDot);
  813.  
  814. gl_FragColor.rgb += (lightScale * gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].ambient.rgb);
  815. gl_FragColor.rgb += (lightScale * lightAttenuation * (diffuseCol.rgb * gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].diffuse.rgb * lightCosAngDiff));
  816. gl_FragColor.rgb += (lightScale * lightAttenuation * (specularCol.rgb * gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].specular.rgb * lightSpecularPow));
  817. }
  818. #endif
  819.  
  820. #if (DEFERRED_MODE == 1)
  821. gl_FragData[GBUFFER_NORMTEX_IDX] = vec4((normal + vec3(1.0, 1.0, 1.0)) * 0.5, 1.0);
  822. gl_FragData[GBUFFER_DIFFTEX_IDX] = diffuseCol + detailCol;
  823. gl_FragData[GBUFFER_SPECTEX_IDX] = specularCol;
  824. gl_FragData[GBUFFER_EMITTEX_IDX] = emissionCol;
  825. gl_FragData[GBUFFER_MISCTEX_IDX] = vec4(0.0, 0.0, 0.0, 0.0);
  826.  
  827. // linearly transform the eye-space depths, might be more useful?
  828. // gl_FragDepth = gl_FragCoord.z / gl_FragCoord.w;
  829. #else
  830. gl_FragColor.rgb = mix(gl_Fog.color.rgb, gl_FragColor.rgb, fogFactor);
  831. #endif
  832. }
  833.  
  834.  
  835. [f=0000000] [Shader] Warning: [GLSL-SO::Compile] shader-object name: GLSL/SMFVertProg.glsl, compile-log:
  836. Vertex shader failed to compile with the following errors:
  837. ERROR: 6:33: error(#71) Syntax error incorrect preprocessor directive
  838. WARNING: 6:33: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  839. ERROR: 6:39: error(#71) Syntax error incorrect preprocessor directive
  840. WARNING: 6:39: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  841. ERROR: error(#273) 2 compilation errors. No code generated
  842.  
  843.  
  844. [f=0000000] [Shader] Warning:
  845. // SHADER VERSION
  846. #version 120
  847. // SHADER FLAGS
  848. #define SMF_TEXSQUARE_SIZE 1024.000000
  849. #define SMF_INTENSITY_MULT 0.823529
  850. // SHADER SOURCE
  851. #line 1
  852. #define SMF_TEXSQR_SIZE 1024.0
  853. #define SMF_DETAILTEX_RES 0.02
  854.  
  855. // uniform vec2 mapSizePO2; // pwr2map{x,z} * SQUARE_SIZE (TODO programmatically #define this)
  856. // uniform vec2 mapSize; // map{x,z} * SQUARE_SIZE (TODO programmatically #define this)
  857. // uniform vec2 mapHeights; // readmap->curr{Min, Max}Height
  858.  
  859. uniform ivec2 texSquare;
  860. uniform vec3 cameraPos;
  861. uniform vec4 lightDir; // mapInfo->light.sunDir
  862.  
  863. varying vec3 halfDir;
  864. varying float fogFactor;
  865. varying vec4 vertexWorldPos;
  866. varying vec2 diffuseTexCoords;
  867.  
  868.  
  869. void main() {
  870. // calc some lighting variables
  871. vec3 viewDir = vec3(gl_ModelViewMatrixInverse * vec4(0.0, 0.0, 0.0, 1.0));
  872. viewDir = normalize(viewDir - gl_Vertex.xyz);
  873. halfDir = normalize(lightDir.xyz + viewDir);
  874. vertexWorldPos = gl_Vertex;
  875.  
  876. // calc texcoords
  877. diffuseTexCoords = (floor(gl_Vertex.xz) / SMF_TEXSQR_SIZE) - vec2(texSquare);
  878.  
  879. // transform vertex pos
  880. gl_Position = gl_ModelViewMatrix * gl_Vertex;
  881. gl_ClipVertex = gl_Position;
  882.  
  883. #if (DEFERRED_MODE == 0)
  884. float fogCoord = length(gl_Position.xyz);
  885. #endif
  886.  
  887. gl_Position = gl_ProjectionMatrix * gl_Position;
  888.  
  889. #if (DEFERRED_MODE == 0)
  890. // emulate linear fog
  891. fogFactor = (gl_Fog.end - fogCoord) * gl_Fog.scale; // gl_Fog.scale == 1.0 / (gl_Fog.end - gl_Fog.start)
  892. fogFactor = clamp(fogFactor, 0.0, 1.0);
  893. #endif
  894. }
  895.  
  896.  
  897. [f=0000000] [Shader] Warning: [GLSL-SO::Compile] shader-object name: GLSL/SMFFragProg.glsl, compile-log:
  898. Fragment shader failed to compile with the following errors:
  899. ERROR: 6:14: error(#71) Syntax error incorrect preprocessor directive
  900. WARNING: 6:14: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  901. ERROR: 6:18: error(#71) Syntax error incorrect preprocessor directive
  902. WARNING: 6:18: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  903. ERROR: 6:29: error(#71) Syntax error incorrect preprocessor directive
  904. WARNING: 6:29: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  905. ERROR: 6:35: error(#71) Syntax error incorrect preprocessor directive
  906. WARNING: 6:35: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  907. ERROR: 6:43: error(#71) Syntax error incorrect preprocessor directive
  908. WARNING: 6:43: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  909. ERROR: 6:48: error(#71) Syntax error incorrect preprocessor directive
  910. WARNING: 6:48: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  911. ERROR: 6:52: error(#71) Syntax error incorrect preprocessor directive
  912. WARNING: 6:52: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  913. ERROR: 6:56: error(#71) Syntax error incorrect preprocessor directive
  914. WARNING: 6:56: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  915. ERROR: 6:60: error(#71) Syntax error incorrect preprocessor directive
  916. WARNING: 6:60: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  917. ERROR: 6:75: error(#71) Syntax error incorrect preprocessor directive
  918. WARNING: 6:75: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  919. ERROR: 6:110: error(#71) Syntax error incorrect preprocessor directive
  920. WARNING: 6:110: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  921. ERROR: 6:137: error(#71) Syntax error incorrect preprocessor directive
  922. WARNING: 6:137: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  923. ERROR: 6:142: error(#71) Syntax error incorrect preprocessor directive
  924. WARNING: 6:142: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  925. ERROR: 6:149: error(#71) Syntax error incorrect preprocessor directive
  926. WARNING: 6:149: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  927. ERROR: 6:196: error(#71) Syntax error incorrect preprocessor directive
  928. WARNING: 6:196: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  929. ERROR: 6:206: error(#71) Syntax error incorrect preprocessor directive
  930. WARNING: 6:206: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  931. ERROR: 6:226: error(#71) Syntax error incorrect preprocessor directive
  932. WARNING: 6:226: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  933. ERROR: 6:236: error(#71) Syntax error incorrect preprocessor directive
  934. WARNING: 6:236: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  935. ERROR: 6:247: error(#71) Syntax error incorrect preprocessor directive
  936. WARNING: 6:247: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  937. ERROR: 6:257: error(#71) Syntax error incorrect preprocessor directive
  938. WARNING: 6:257: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  939. ERROR: 6:269: error(#71) Syntax error incorrect preprocessor directive
  940. WARNING: 6:269: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  941. ERROR: 6:284: error(#71) Syntax error incorrect preprocessor directive
  942. WARNING: 6:284: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  943. ERROR: 6:294: error(#71) Syntax error incorrect preprocessor directive
  944. WARNING: 6:294: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  945. ERROR: 6:299: error(#71) Syntax error incorrect preprocessor directive
  946. WARNING: 6:299: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  947. ERROR: 6:305: error(#71) Syntax error incorrect preprocessor directive
  948. WARNING: 6:305: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  949. ERROR: 6:308: error(#71) Syntax error incorrect preprocessor directive
  950. WARNING: 6:308: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  951. ERROR: 6:321: error(#71) Syntax error incorrect preprocessor directive
  952. WARNING: 6:321: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  953. ERROR: 6:322: error(#143) Undeclared identifier MAX_DYNAMIC_MAP_LIGHTS
  954. ERROR: 6:323: error(#143) Undeclared identifier BASE_DYNAMIC_MAP_LIGHT
  955. ERROR: 6:323: error(#166) Integer expression required []
  956. ERROR: 6:324: error(#166) Integer expression required []
  957. ERROR: 6:326: error(#166) Integer expression required []
  958. ERROR: 6:342: error(#166) Integer expression required []
  959. ERROR: 6:343: error(#166) Integer expression required []
  960. ERROR: 6:345: error(#71) Syntax error incorrect preprocessor directive
  961. WARNING: 6:345: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  962. ERROR: 6:353: error(#166) Integer expression required []
  963. ERROR: 6:354: error(#166) Integer expression required []
  964. ERROR: 6:355: error(#166) Integer expression required []
  965. ERROR: 6:359: error(#71) Syntax error incorrect preprocessor directive
  966. WARNING: 6:359: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  967. ERROR: 6:360: error(#143) Undeclared identifier GBUFFER_NORMTEX_IDX
  968. ERROR: 6:360: error(#166) Integer expression required []
  969. ERROR: 6:361: error(#143) Undeclared identifier GBUFFER_DIFFTEX_IDX
  970. ERROR: 6:361: error(#166) Integer expression required []
  971. ERROR: 6:362: error(#143) Undeclared identifier GBUFFER_SPECTEX_IDX
  972. ERROR: 6:362: error(#166) Integer expression required []
  973. ERROR: 6:363: error(#143) Undeclared identifier GBUFFER_EMITTEX_IDX
  974. ERROR: 6:363: error(#166) Integer expression required []
  975. ERROR: 6:364: error(#143) Undeclared identifier GBUFFER_MISCTEX_IDX
  976. ERROR: 6:364: error(#166) Integer expression required []
  977. ERROR: error(#273) 49 compilation errors. No code generated
  978.  
  979.  
  980. [f=0000000] [Shader] Warning:
  981. // SHADER VERSION
  982. #version 120
  983. // SHADER FLAGS
  984. #define SMF_TEXSQUARE_SIZE 1024.000000
  985. #define SMF_INTENSITY_MULT 0.823529
  986. // SHADER SOURCE
  987. #line 1
  988. #define SSMF_UNCOMPRESSED_NORMALS 0
  989. #define SMF_SHALLOW_WATER_DEPTH (10.0 )
  990. #define SMF_SHALLOW_WATER_DEPTH_INV ( 1.0 / SMF_SHALLOW_WATER_DEPTH)
  991. #define SMF_DETAILTEX_RES 0.02
  992.  
  993. uniform sampler2D diffuseTex;
  994. uniform sampler2D normalsTex;
  995. uniform sampler2D detailTex;
  996. uniform sampler2D infoTex;
  997. uniform vec2 normalTexGen; // either 1.0/mapSize (when NPOT are supported) or 1.0/mapSizePO2
  998. uniform vec2 specularTexGen; // 1.0/mapSize
  999.  
  1000. #if (SMF_ARB_LIGHTING == 0)
  1001. uniform sampler2D specularTex;
  1002. #endif
  1003.  
  1004. #if (HAVE_SHADOWS == 1)
  1005. uniform sampler2DShadow shadowTex;
  1006. uniform mat4 shadowMat;
  1007. uniform vec4 shadowParams;
  1008. #endif
  1009.  
  1010. uniform vec3 groundAmbientColor;
  1011. uniform vec3 groundDiffuseColor;
  1012. uniform vec3 groundSpecularColor;
  1013. uniform float groundShadowDensity;
  1014.  
  1015. #if (SMF_WATER_ABSORPTION == 1)
  1016. uniform vec3 waterMinColor;
  1017. uniform vec3 waterBaseColor;
  1018. uniform vec3 waterAbsorbColor;
  1019. #endif
  1020.  
  1021. #if (SMF_DETAIL_TEXTURE_SPLATTING == 1)
  1022. uniform sampler2D splatDetailTex;
  1023. uniform sampler2D splatDistrTex;
  1024. uniform vec4 splatTexMults; // per-channel splat intensity multipliers
  1025. uniform vec4 splatTexScales; // defaults to SMF_DETAILTEX_RES per channel
  1026. #endif
  1027.  
  1028.  
  1029. #if (SMF_SKY_REFLECTIONS == 1)
  1030. uniform samplerCube skyReflectTex;
  1031. uniform sampler2D skyReflectModTex;
  1032. #endif
  1033.  
  1034. #if (SMF_DETAIL_NORMALS == 1)
  1035. uniform sampler2D detailNormalTex;
  1036. #endif
  1037.  
  1038. #if (SMF_LIGHT_EMISSION == 1)
  1039. uniform sampler2D lightEmissionTex;
  1040. #endif
  1041.  
  1042. #if (SMF_PARALLAX_MAPPING == 1)
  1043. uniform sampler2D parallaxHeightTex;
  1044. #endif
  1045.  
  1046. #if (HAVE_INFOTEX == 1)
  1047. uniform float infoTexIntensityMul;
  1048. uniform vec2 infoTexGen; // 1.0/(pwr2map{x,z} * SQUARE_SIZE)
  1049. #endif
  1050.  
  1051. uniform vec4 lightDir;
  1052. uniform vec3 cameraPos;
  1053. varying vec3 halfDir;
  1054.  
  1055. varying float fogFactor;
  1056. varying vec4 vertexWorldPos;
  1057. varying vec2 diffuseTexCoords;
  1058.  
  1059.  
  1060.  
  1061. #if (SMF_PARALLAX_MAPPING == 1)
  1062. vec2 GetParallaxUVOffset(vec2 uv, vec3 dir) {
  1063. vec4 texel = texture2D(parallaxHeightTex, uv);
  1064.  
  1065. // RG: height in [ 0.0, 1.0] (256^2 strata)
  1066. // B: scale in [ 0.0, 1.0] (256 strata), eg. 0.04 (~10.0/256.0)
  1067. // A: bias in [-0.5, 0.5] (256 strata), eg. -0.02 (~75.0/256.0)
  1068. //
  1069. #define RMUL 65280.0 // 255 * 256
  1070. #define GMUL 256.0
  1071. #define HDIV 65536.0
  1072.  
  1073. float heightValue = (texel.r * RMUL + texel.g * GMUL) / HDIV;
  1074. float heightScale = texel.b;
  1075. float heightBias = texel.a - 0.5;
  1076. float heightOffset = heightValue * heightScale + heightBias;
  1077.  
  1078. return ((dir.xy / dir.z) * heightOffset);
  1079. }
  1080. #endif
  1081.  
  1082. vec3 GetFragmentNormal(vec2 uv) {
  1083. vec3 normal;
  1084.  
  1085. #if (SSMF_UNCOMPRESSED_NORMALS == 1)
  1086. normal = normalize(texture2D(normalsTex, uv).xyz);
  1087. #else
  1088. normal.xz = texture2D(normalsTex, uv).ra;
  1089. normal.y = sqrt(1.0 - dot(normal.xz, normal.xz));
  1090. #endif
  1091.  
  1092. return normal;
  1093. }
  1094.  
  1095. vec4 GetDetailTextureColor(vec2 uv) {
  1096. #if (SMF_DETAIL_TEXTURE_SPLATTING == 0)
  1097. vec2 detailTexCoord = vertexWorldPos.xz * vec2(SMF_DETAILTEX_RES);
  1098. vec4 detailCol = (texture2D(detailTex, detailTexCoord) * 2.0) - 1.0;
  1099. #else
  1100. vec4 splatTexCoord0 = vertexWorldPos.xzxz * splatTexScales.rrgg;
  1101. vec4 splatTexCoord1 = vertexWorldPos.xzxz * splatTexScales.bbaa;
  1102. vec4 splatDetails;
  1103. splatDetails.r = texture2D(splatDetailTex, splatTexCoord0.st).r;
  1104. splatDetails.g = texture2D(splatDetailTex, splatTexCoord0.pq).g;
  1105. splatDetails.b = texture2D(splatDetailTex, splatTexCoord1.st).b;
  1106. splatDetails.a = texture2D(splatDetailTex, splatTexCoord1.pq).a;
  1107. splatDetails = (splatDetails * 2.0) - 1.0;
  1108.  
  1109. vec4 splatCofac = texture2D(splatDistrTex, uv) * splatTexMults;
  1110. vec4 detailCol = vec4(dot(splatDetails, splatCofac));
  1111. #endif
  1112.  
  1113. return detailCol;
  1114. }
  1115.  
  1116. vec4 GetShadeInt(float groundLightInt, float groundShadowCoeff, float groundDiffuseAlpha) {
  1117. vec4 groundShadeInt = vec4(0.0, 0.0, 0.0, 1.0);
  1118. vec4 waterShadeInt = vec4(0.0, 0.0, 0.0, 1.0);
  1119.  
  1120. groundShadeInt.rgb = groundAmbientColor + groundDiffuseColor * (groundLightInt * groundShadowCoeff);
  1121. groundShadeInt.rgb *= SMF_INTENSITY_MULT;
  1122.  
  1123. #if (SMF_VOID_WATER == 1)
  1124. // cut out all underwater fragments indiscriminately
  1125. groundShadeInt.a = float(vertexWorldPos.y >= 0.0);
  1126. #endif
  1127.  
  1128. #if (SMF_VOID_GROUND == 1)
  1129. // assume the map(per)'s diffuse texture provides sensible alphas
  1130. // note that voidground overrides voidwater if *both* are enabled
  1131. // (limiting it to just above-water fragments would be arbitrary)
  1132. groundShadeInt.a = groundDiffuseAlpha;
  1133. #endif
  1134.  
  1135. #if (SMF_WATER_ABSORPTION == 1)
  1136. {
  1137. float waterShadeAlpha = abs(vertexWorldPos.y) * SMF_SHALLOW_WATER_DEPTH_INV;
  1138. float waterShadeDecay = 0.2 + (waterShadeAlpha * 0.1);
  1139. float vertexStepHeight = min(1023.0, -floor(vertexWorldPos.y));
  1140. float waterLightInt = min((groundLightInt + 0.2) * 2.0, 1.0);
  1141.  
  1142. // vertex below shallow water depth --> alpha=1
  1143. // vertex above shallow water depth --> alpha=waterShadeAlpha
  1144. //
  1145. waterShadeAlpha = min(1.0, waterShadeAlpha + float(vertexWorldPos.y <= -SMF_SHALLOW_WATER_DEPTH));
  1146.  
  1147. waterShadeInt.rgb = waterBaseColor.rgb - (waterAbsorbColor.rgb * vertexStepHeight);
  1148. waterShadeInt.rgb = max(waterMinColor.rgb, waterShadeInt.rgb);
  1149. waterShadeInt.rgb *= (SMF_INTENSITY_MULT * waterLightInt);
  1150.  
  1151. // allow voidground maps to create holes in the seabed
  1152. // (SMF_WATER_ABSORPTION == 1 implies voidwater is not
  1153. // enabled but says nothing about the voidground state)
  1154. waterShadeInt.a = groundShadeInt.a;
  1155.  
  1156. // make shadowed areas darker over deeper water
  1157. waterShadeInt.rgb -= (waterShadeInt.rgb * waterShadeDecay * (1.0 - groundShadowCoeff));
  1158.  
  1159. // if depth is greater than _SHALLOW_ depth, select waterShadeInt
  1160. // otherwise interpolate between groundShadeInt and waterShadeInt
  1161. // (both are already cosine-weighted)
  1162. waterShadeInt.rgb = mix(groundShadeInt.rgb, waterShadeInt.rgb, waterShadeAlpha);
  1163. }
  1164.  
  1165. return mix(groundShadeInt, waterShadeInt, float(vertexWorldPos.y < 0.0));
  1166. #else
  1167. return groundShadeInt;
  1168. #endif
  1169. }
  1170.  
  1171.  
  1172.  
  1173. void main() {
  1174. vec2 diffTexCoords = diffuseTexCoords;
  1175. vec2 specTexCoords = vertexWorldPos.xz * specularTexGen;
  1176. vec2 normTexCoords = vertexWorldPos.xz * normalTexGen;
  1177.  
  1178. // not calculated in the vertex shader to save varying components (OpenGL2.0 allows just 32)
  1179. vec3 cameraDir = vertexWorldPos.xyz - cameraPos;
  1180. vec3 normal = GetFragmentNormal(normTexCoords);
  1181.  
  1182. #if (SMF_DETAIL_NORMALS == 1 || SMF_PARALLAX_MAPPING == 1)
  1183. // detail-normals are (assumed to be) defined within STN space
  1184. // (for a regular vertex normal equal to <0, 1, 0>, the S- and
  1185. // T-tangents are aligned with Spring's +x and +z (!) axes)
  1186. vec3 tTangent = cross(normal, vec3(-1.0, 0.0, 0.0));
  1187. vec3 sTangent = cross(normal, tTangent);
  1188. mat3 stnMatrix = mat3(sTangent, tTangent, normal);
  1189. #endif
  1190.  
  1191.  
  1192. #if (SMF_PARALLAX_MAPPING == 1)
  1193. {
  1194. // use specular-texture coordinates to index parallaxHeightTex
  1195. // (ie. specularTex and parallaxHeightTex must have equal size)
  1196. // cameraDir does not need to be normalized, x/z and y/z ratios
  1197. // do not change
  1198. vec2 uvOffset = GetParallaxUVOffset(specTexCoords, transpose(stnMatrix) * cameraDir);
  1199. vec2 normTexSize = 1.0 / normalTexGen;
  1200. vec2 specTexSize = 1.0 / specularTexGen;
  1201.  
  1202. // scale the parallax offset since it is in spectex-space
  1203. diffTexCoords += (uvOffset * (specTexSize / SMF_TEXSQUARE_SIZE));
  1204. normTexCoords += (uvOffset * (specTexSize / normTexSize));
  1205. specTexCoords += (uvOffset);
  1206.  
  1207. normal = GetFragmentNormal(normTexCoords);
  1208. }
  1209. #endif
  1210.  
  1211.  
  1212. #if (SMF_DETAIL_NORMALS == 1)
  1213. {
  1214. vec4 dtSample = texture2D(detailNormalTex, normTexCoords);
  1215. vec3 dtNormal = (dtSample.xyz * 2.0) - 1.0;
  1216.  
  1217. // convert dtNormal from TS to WS before mixing
  1218. normal = normalize(mix(normal, stnMatrix * dtNormal, dtSample.a));
  1219. }
  1220. #endif
  1221.  
  1222. #if (DEFERRED_MODE == 0)
  1223. float cosAngleDiffuse = clamp(dot(normalize(lightDir.xyz), normal), 0.0, 1.0);
  1224. float cosAngleSpecular = clamp(dot(normalize(halfDir), normal), 0.0, 1.0);
  1225. #endif
  1226.  
  1227. vec4 diffuseCol = texture2D(diffuseTex, diffTexCoords);
  1228. vec4 detailCol = GetDetailTextureColor(specTexCoords);
  1229. // non-zero default specularity on non-SSMF maps (for DL)
  1230. vec4 specularCol = vec4(0.5, 0.5, 0.5, 1.0);
  1231. vec4 emissionCol = vec4(0.0, 0.0, 0.0, 0.0);
  1232.  
  1233. #if (DEFERRED_MODE == 0 && SMF_SKY_REFLECTIONS == 1)
  1234. {
  1235. // cameraDir does not need to be normalized for reflect()
  1236. vec3 reflectDir = reflect(cameraDir, normal);
  1237. vec3 reflectCol = textureCube(skyReflectTex, gl_NormalMatrix * reflectDir).rgb;
  1238. vec3 reflectMod = texture2D(skyReflectModTex, specTexCoords).rgb;
  1239.  
  1240. diffuseCol.rgb = mix(diffuseCol.rgb, reflectCol, reflectMod);
  1241. }
  1242. #endif
  1243. #if (DEFERRED_MODE == 0 && HAVE_INFOTEX == 1)
  1244. // increase contrast and brightness for the overlays
  1245. // TODO: make the multiplier configurable by users?
  1246. vec2 infoTexCoords = vertexWorldPos.xz * infoTexGen;
  1247. diffuseCol.rgb += (texture2D(infoTex, infoTexCoords).rgb * infoTexIntensityMul);
  1248. diffuseCol.rgb -= (vec3(0.5, 0.5, 0.5) * float(infoTexIntensityMul == 1.0));
  1249. #endif
  1250.  
  1251.  
  1252.  
  1253. float shadowCoeff = 1.0;
  1254.  
  1255. #if (DEFERRED_MODE == 0 && HAVE_SHADOWS == 1)
  1256. {
  1257. vec2 p17 = vec2(shadowParams.z, shadowParams.z);
  1258. vec2 p18 = vec2(shadowParams.w, shadowParams.w);
  1259.  
  1260. vec4 vertexShadowPos = shadowMat * vertexWorldPos;
  1261. vertexShadowPos.st *= (inversesqrt(abs(vertexShadowPos.st) + p17) + p18);
  1262. vertexShadowPos.st += shadowParams.xy;
  1263.  
  1264. // same as ARB shader: shadowCoeff = 1 - (1 - shadowCoeff) * groundShadowDensity
  1265. shadowCoeff = shadow2DProj(shadowTex, vertexShadowPos).r;
  1266. shadowCoeff = mix(1.0, shadowCoeff, groundShadowDensity);
  1267. }
  1268. #endif
  1269.  
  1270. #if (DEFERRED_MODE == 0)
  1271. {
  1272. // GroundMaterialAmbientDiffuseColor * LightAmbientDiffuseColor
  1273. vec4 shadeInt = GetShadeInt(cosAngleDiffuse, shadowCoeff, diffuseCol.a);
  1274.  
  1275. gl_FragColor.rgb = (diffuseCol.rgb + detailCol.rgb) * shadeInt.rgb;
  1276. gl_FragColor.a = shadeInt.a;
  1277. }
  1278. #endif
  1279.  
  1280. #if (SMF_LIGHT_EMISSION == 1)
  1281. {
  1282. // apply self-illumination aka. glow, not masked by shadows
  1283. emissionCol = texture2D(lightEmissionTex, specTexCoords);
  1284.  
  1285. #if (DEFERRED_MODE == 0)
  1286. gl_FragColor.rgb = gl_FragColor.rgb * (1.0 - emissionCol.a) + emissionCol.rgb;
  1287. #endif
  1288. }
  1289. #endif
  1290.  
  1291. #if (SMF_ARB_LIGHTING == 0)
  1292. specularCol = texture2D(specularTex, specTexCoords);
  1293.  
  1294. #if (DEFERRED_MODE == 0)
  1295. // sun specular lighting contribution
  1296. float specularExp = specularCol.a * 16.0;
  1297. float specularPow = pow(cosAngleSpecular, specularExp);
  1298.  
  1299. vec3 specularInt = specularCol.rgb * specularPow;
  1300. specularInt *= shadowCoeff;
  1301.  
  1302. // no need to multiply by groundSpecularColor anymore
  1303. gl_FragColor.rgb += specularInt;
  1304. #endif
  1305. #endif
  1306.  
  1307. #if (DEFERRED_MODE == 0 && MAX_DYNAMIC_MAP_LIGHTS > 0)
  1308. for (int i = 0; i < MAX_DYNAMIC_MAP_LIGHTS; i++) {
  1309. vec3 lightVec = gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].position.xyz - vertexWorldPos.xyz;
  1310. vec3 halfVec = gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].halfVector.xyz;
  1311.  
  1312. float lightRadius = gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].constantAttenuation;
  1313. float lightDistance = length(lightVec);
  1314. float lightScale = float(lightDistance <= lightRadius);
  1315. float lightCosAngDiff = clamp(dot(normal, lightVec / lightDistance), 0.0, 1.0);
  1316. float lightCosAngSpec = clamp(dot(normal, normalize(halfVec)), 0.0, 1.0);
  1317. #ifdef OGL_SPEC_ATTENUATION
  1318. float lightAttenuation =
  1319. (gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].constantAttenuation) +
  1320. (gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].linearAttenuation * lightDistance) +
  1321. (gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].quadraticAttenuation * lightDistance * lightDistance);
  1322.  
  1323. lightAttenuation = 1.0 / max(lightAttenuation, 1.0);
  1324. #else
  1325. float lightAttenuation = 1.0 - min(1.0, ((lightDistance * lightDistance) / (lightRadius * lightRadius)));
  1326. #endif
  1327.  
  1328. float vectorDot = dot((-lightVec / lightDistance), gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].spotDirection);
  1329. float cutoffDot = gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].spotCosCutoff;
  1330.  
  1331. #if (SMF_ARB_LIGHTING == 0)
  1332. float lightSpecularPow = max(0.0, pow(lightCosAngSpec, specularExp));
  1333. #else
  1334. float lightSpecularPow = 0.0;
  1335. #endif
  1336.  
  1337. lightScale *= float(vectorDot >= cutoffDot);
  1338.  
  1339. gl_FragColor.rgb += (lightScale * gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].ambient.rgb);
  1340. gl_FragColor.rgb += (lightScale * lightAttenuation * (diffuseCol.rgb * gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].diffuse.rgb * lightCosAngDiff));
  1341. gl_FragColor.rgb += (lightScale * lightAttenuation * (specularCol.rgb * gl_LightSource[BASE_DYNAMIC_MAP_LIGHT + i].specular.rgb * lightSpecularPow));
  1342. }
  1343. #endif
  1344.  
  1345. #if (DEFERRED_MODE == 1)
  1346. gl_FragData[GBUFFER_NORMTEX_IDX] = vec4((normal + vec3(1.0, 1.0, 1.0)) * 0.5, 1.0);
  1347. gl_FragData[GBUFFER_DIFFTEX_IDX] = diffuseCol + detailCol;
  1348. gl_FragData[GBUFFER_SPECTEX_IDX] = specularCol;
  1349. gl_FragData[GBUFFER_EMITTEX_IDX] = emissionCol;
  1350. gl_FragData[GBUFFER_MISCTEX_IDX] = vec4(0.0, 0.0, 0.0, 0.0);
  1351.  
  1352. // linearly transform the eye-space depths, might be more useful?
  1353. // gl_FragDepth = gl_FragCoord.z / gl_FragCoord.w;
  1354. #else
  1355. gl_FragColor.rgb = mix(gl_Fog.color.rgb, gl_FragColor.rgb, fogFactor);
  1356. #endif
  1357. }
  1358.  
  1359.  
  1360. [f=0000000] Creating TreeDrawer
  1361. [f=0000000] Creating ProjectileDrawer & UnitDrawer
  1362. [f=0000000] Creating Projectile Textures
  1363. [f=0000000] Warning: [CCEG::Load] railgun: Unknown tag CSimpleParticleSystem::colorchange
  1364. [f=0000000] Warning: [CCEG::Load] ebombexpl: Unknown tag smoke::sizegrowth
  1365. [f=0000000] Warning: [CCEG::Load] genericshellexplosion-large-blue-emp: Unknown tag CSimpleParticleSystem::delay
  1366. [f=0000000] Warning: [CCEG::Load] nukeartyexpl: Unknown tag smoke::sizegrowth
  1367. [f=0000000] Warning: [CCEG::Load] AREAHEALING: Unknown tag smoke::sizegrowth
  1368. [f=0000000] Warning: [CCEG::Load] FACTORY_EXPLOSION_SMALL: Unknown tag smoke::sizegrowth
  1369. [f=0000000] Warning: [CCEG::Load] FACTORY_EXPLOSION_SMALL: Unknown tag smoke::sizegrowth
  1370. [f=0000000] Warning: [CCEG::Load] POWERPLANT_EXPLOSION_BIG: Unknown tag smoke::sizegrowth
  1371. [f=0000000] Warning: [CCEG::Load] POWERPLANT_EXPLOSION_MEDIUM: Unknown tag smoke::sizegrowth
  1372. [f=0000000] Warning: [CCEG::Load] FACTORY_EXPLOSION: Unknown tag smoke::sizegrowth
  1373. [f=0000000] Warning: [CCEG::Load] FACTORY_EXPLOSION: Unknown tag smoke::sizegrowth
  1374. [f=0000000] Warning: [CCEG::Load] FACTORY_EXPLOSION_MEDIUM: Unknown tag smoke::sizegrowth
  1375. [f=0000000] Warning: [CCEG::Load] FACTORY_EXPLOSION_MEDIUM: Unknown tag smoke::sizegrowth
  1376. [f=0000000] Warning: [CCEG::Load] POWERPLANT_EXPLOSION: Unknown tag smoke::sizegrowth
  1377. [f=0000000] Warning: [CCEG::Load] dirt: Unknown tag CSimpleParticleSystem::colorchange
  1378. [f=0000000] Warning: [CCEG::Load] blacksmoke: Unknown tag CSimpleParticleSystem::colorchange
  1379. [f=0000000] Warning: [CCEG::Load] dirtsmall: Unknown tag CSimpleParticleSystem::colorchange
  1380. [f=0000000] [Shader] Warning: [GLSL-SO::Compile] shader-object name: GLSL/ModelVertProg.glsl, compile-log:
  1381. Vertex shader failed to compile with the following errors:
  1382. ERROR: 6:23: error(#71) Syntax error incorrect preprocessor directive
  1383. WARNING: 6:23: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1384. ERROR: 6:55: error(#71) Syntax error incorrect preprocessor directive
  1385. WARNING: 6:55: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1386. ERROR: 6:62: error(#71) Syntax error incorrect preprocessor directive
  1387. WARNING: 6:62: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1388. ERROR: error(#273) 3 compilation errors. No code generated
  1389.  
  1390.  
  1391. [f=0000000] [Shader] Warning:
  1392. // SHADER VERSION
  1393. // SHADER FLAGS
  1394. #define BASE_DYNAMIC_MODEL_LIGHT 2
  1395. #define MAX_DYNAMIC_MODEL_LIGHTS 1
  1396. // SHADER SOURCE
  1397. #line 1
  1398. // note: gl_ModelViewMatrix actually only contains the
  1399.  
  1400. // model matrix, view matrix is on the projection stack
  1401.  
  1402. //
  1403.  
  1404. // todo: clip gl_Position against gl_ClipPlane[3] if advFade
  1405.  
  1406. // note: many gfx will fallback to software rendering when
  1407.  
  1408. // gl_ClipDistance or gl_ClipPosition are used, so it might
  1409.  
  1410. // be better to use may a `discard` in the fragment shader
  1411.  
  1412. //
  1413.  
  1414. // note: shadow-map texture coordinates should be generated
  1415.  
  1416. // per fragment (the non-linear projection used can produce
  1417.  
  1418. // shifting artefacts with large triangles due to the linear
  1419.  
  1420. // interpolation of vertex positions), but this is a source
  1421.  
  1422. // of acne itself
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428. // #define use_normalmapping
  1429.  
  1430. // #define flip_normalmap
  1431.  
  1432.  
  1433.  
  1434. //uniform mat4 cameraMat;
  1435.  
  1436. //uniform mat4 cameraInv;
  1437.  
  1438. uniform vec3 cameraPos;
  1439.  
  1440. #if (USE_SHADOWS == 1)
  1441.  
  1442. uniform mat4 shadowMatrix;
  1443.  
  1444. uniform vec4 shadowParams;
  1445.  
  1446. #endif
  1447.  
  1448.  
  1449.  
  1450. varying vec4 vertexWorldPos;
  1451.  
  1452. varying vec3 cameraDir;
  1453.  
  1454. varying float fogFactor;
  1455.  
  1456.  
  1457.  
  1458. #ifdef use_normalmapping
  1459.  
  1460. varying mat3 tbnMatrix;
  1461.  
  1462. #else
  1463.  
  1464. varying vec3 normalv;
  1465.  
  1466. #endif
  1467.  
  1468.  
  1469.  
  1470. uniform int numModelDynLights;
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476. void main(void)
  1477.  
  1478. {
  1479.  
  1480. #ifdef use_normalmapping
  1481.  
  1482. vec3 tangent = gl_MultiTexCoord5.xyz;
  1483.  
  1484. vec3 bitangent = gl_MultiTexCoord6.xyz;
  1485.  
  1486. tbnMatrix = gl_NormalMatrix * mat3(tangent, bitangent, gl_Normal);
  1487.  
  1488. #else
  1489.  
  1490. normalv = gl_NormalMatrix * gl_Normal;
  1491.  
  1492. #endif
  1493.  
  1494.  
  1495.  
  1496. vertexWorldPos = gl_ModelViewMatrix * gl_Vertex;
  1497.  
  1498. gl_Position = gl_ProjectionMatrix * vertexWorldPos;
  1499.  
  1500. cameraDir = vertexWorldPos.xyz - cameraPos;
  1501.  
  1502.  
  1503.  
  1504. #if (USE_SHADOWS == 1)
  1505.  
  1506. gl_TexCoord[1] = shadowMatrix * vertexWorldPos;
  1507.  
  1508. gl_TexCoord[1].st = gl_TexCoord[1].st * (inversesqrt( abs(gl_TexCoord[1].st) + shadowParams.z) + shadowParams.w) + shadowParams.xy;
  1509.  
  1510. #endif
  1511.  
  1512.  
  1513.  
  1514. gl_TexCoord[0].st = gl_MultiTexCoord0.st;
  1515.  
  1516.  
  1517.  
  1518. #if (DEFERRED_MODE == 0)
  1519.  
  1520. float fogCoord = length(cameraDir.xyz);
  1521.  
  1522. fogFactor = (gl_Fog.end - fogCoord) * gl_Fog.scale; //gl_Fog.scale := 1.0 / (gl_Fog.end - gl_Fog.start)
  1523.  
  1524. fogFactor = clamp(fogFactor, 0.0, 1.0);
  1525.  
  1526. #endif
  1527.  
  1528. }
  1529.  
  1530.  
  1531. [f=0000000] [Shader] Warning: [GLSL-SO::Compile] shader-object name: GLSL/ModelFragProg.glsl, compile-log:
  1532. Fragment shader failed to compile with the following errors:
  1533. ERROR: 6:16: error(#71) Syntax error incorrect preprocessor directive
  1534. WARNING: 6:16: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1535. ERROR: 6:58: error(#71) Syntax error incorrect preprocessor directive
  1536. WARNING: 6:58: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1537. ERROR: 6:70: error(#71) Syntax error incorrect preprocessor directive
  1538. WARNING: 6:70: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1539. ERROR: 6:76: error(#71) Syntax error incorrect preprocessor directive
  1540. WARNING: 6:76: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1541. ERROR: 6:108: error(#71) Syntax error incorrect preprocessor directive
  1542. WARNING: 6:108: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1543. ERROR: 6:109: error(#143) Undeclared identifier GBUFFER_NORMTEX_IDX
  1544. ERROR: 6:109: error(#166) Integer expression required []
  1545. ERROR: 6:110: error(#143) Undeclared identifier GBUFFER_DIFFTEX_IDX
  1546. ERROR: 6:110: error(#166) Integer expression required []
  1547. ERROR: 6:113: error(#143) Undeclared identifier GBUFFER_SPECTEX_IDX
  1548. ERROR: 6:113: error(#166) Integer expression required []
  1549. ERROR: 6:114: error(#143) Undeclared identifier GBUFFER_EMITTEX_IDX
  1550. ERROR: 6:114: error(#166) Integer expression required []
  1551. ERROR: 6:115: error(#143) Undeclared identifier GBUFFER_MISCTEX_IDX
  1552. ERROR: 6:115: error(#166) Integer expression required []
  1553. ERROR: error(#273) 15 compilation errors. No code generated
  1554.  
  1555.  
  1556. [f=0000000] [Shader] Warning:
  1557. // SHADER VERSION
  1558. // SHADER FLAGS
  1559. #define BASE_DYNAMIC_MODEL_LIGHT 2
  1560. #define MAX_DYNAMIC_MODEL_LIGHTS 1
  1561. // SHADER SOURCE
  1562. #line 1
  1563. // #define use_normalmapping
  1564.  
  1565. // #define flip_normalmap
  1566.  
  1567.  
  1568.  
  1569. #define textureS3o1 diffuseTex
  1570.  
  1571. #define textureS3o2 shadingTex
  1572.  
  1573. uniform sampler2D textureS3o1;
  1574.  
  1575. uniform sampler2D textureS3o2;
  1576.  
  1577. uniform samplerCube specularTex;
  1578.  
  1579. uniform samplerCube reflectTex;
  1580.  
  1581.  
  1582.  
  1583. uniform vec3 sunDir;
  1584.  
  1585. uniform vec3 sunDiffuse;
  1586.  
  1587. uniform vec3 sunAmbient;
  1588.  
  1589.  
  1590.  
  1591. #if (USE_SHADOWS == 1)
  1592.  
  1593. uniform sampler2DShadow shadowTex;
  1594.  
  1595. uniform float shadowDensity;
  1596.  
  1597. #endif
  1598.  
  1599.  
  1600.  
  1601. uniform vec4 teamColor; // alpha contains `far distance fading factor`
  1602.  
  1603.  
  1604.  
  1605. varying vec4 vertexWorldPos;
  1606.  
  1607. varying vec3 cameraDir;
  1608.  
  1609. varying float fogFactor;
  1610.  
  1611.  
  1612.  
  1613. #ifdef use_normalmapping
  1614.  
  1615. uniform sampler2D normalMap;
  1616.  
  1617. varying mat3 tbnMatrix;
  1618.  
  1619. #else
  1620.  
  1621. varying vec3 normalv;
  1622.  
  1623. #endif
  1624.  
  1625.  
  1626.  
  1627. uniform int numModelDynLights;
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633. void main(void)
  1634.  
  1635. {
  1636.  
  1637. #ifdef use_normalmapping
  1638.  
  1639. vec2 tc = gl_TexCoord[0].st;
  1640.  
  1641. #ifdef flip_normalmap
  1642.  
  1643. tc.t = 1.0 - tc.t;
  1644.  
  1645. #endif
  1646.  
  1647. vec3 nvTS = normalize((texture2D(normalMap, tc).xyz - 0.5) * 2.0);
  1648.  
  1649. vec3 normal = tbnMatrix * nvTS;
  1650.  
  1651. #else
  1652.  
  1653. vec3 normal = normalize(normalv);
  1654.  
  1655. #endif
  1656.  
  1657. vec3 light = max(dot(normal, sunDir), 0.0) * sunDiffuse + sunAmbient;
  1658.  
  1659.  
  1660.  
  1661. vec4 diffuse = texture2D(textureS3o1, gl_TexCoord[0].st);
  1662.  
  1663. vec4 extraColor = texture2D(textureS3o2, gl_TexCoord[0].st);
  1664.  
  1665.  
  1666.  
  1667. vec3 reflectDir = reflect(cameraDir, normal);
  1668.  
  1669. vec3 specular = textureCube(specularTex, reflectDir).rgb * extraColor.g * 4.0;
  1670.  
  1671. vec3 reflection = textureCube(reflectTex, reflectDir).rgb;
  1672.  
  1673.  
  1674.  
  1675. #if (USE_SHADOWS == 1)
  1676.  
  1677. float shadow = shadow2DProj(shadowTex, gl_TexCoord[1]).r;
  1678.  
  1679. shadow = 1.0 - (1.0 - shadow) * shadowDensity;
  1680.  
  1681. vec3 shade = mix(sunAmbient, light, shadow);
  1682.  
  1683. reflection = mix(shade, reflection, extraColor.g); // reflection
  1684.  
  1685. reflection += extraColor.rrr; // self-illum
  1686.  
  1687. specular *= shadow;
  1688.  
  1689. #else
  1690.  
  1691. reflection = mix(light, reflection, extraColor.g); // reflection
  1692.  
  1693. reflection += extraColor.rrr; // self-illum
  1694.  
  1695. #endif
  1696.  
  1697.  
  1698.  
  1699. #if (DEFERRED_MODE == 0)
  1700.  
  1701. gl_FragColor = diffuse;
  1702.  
  1703. gl_FragColor.rgb = mix(gl_FragColor.rgb, teamColor.rgb, gl_FragColor.a); // teamcolor
  1704.  
  1705. gl_FragColor.rgb = gl_FragColor.rgb * reflection + specular;
  1706.  
  1707. #endif
  1708.  
  1709.  
  1710.  
  1711. #if (DEFERRED_MODE == 0 && MAX_DYNAMIC_MODEL_LIGHTS > 0)
  1712.  
  1713. for (int i = 0; i < MAX_DYNAMIC_MODEL_LIGHTS; i++) {
  1714.  
  1715. vec3 lightVec = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].position.xyz - vertexWorldPos.xyz;
  1716.  
  1717. vec3 halfVec = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].halfVector.xyz;
  1718.  
  1719.  
  1720.  
  1721. float lightRadius = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].constantAttenuation;
  1722.  
  1723. float lightDistance = length(lightVec);
  1724.  
  1725. float lightScale = (lightDistance > lightRadius)? 0.0: 1.0;
  1726.  
  1727. float lightCosAngDiff = clamp(dot(normal, lightVec / lightDistance), 0.0, 1.0);
  1728.  
  1729. float lightCosAngSpec = clamp(dot(normal, normalize(halfVec)), 0.0, 1.0);
  1730.  
  1731. #ifdef OGL_SPEC_ATTENUATION
  1732.  
  1733. float lightAttenuation =
  1734.  
  1735. (gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].constantAttenuation) +
  1736.  
  1737. (gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].linearAttenuation * lightDistance) +
  1738.  
  1739. (gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].quadraticAttenuation * lightDistance * lightDistance);
  1740.  
  1741.  
  1742.  
  1743. lightAttenuation = 1.0 / max(lightAttenuation, 1.0);
  1744.  
  1745. #else
  1746.  
  1747. float lightAttenuation = 1.0 - min(1.0, ((lightDistance * lightDistance) / (lightRadius * lightRadius)));
  1748.  
  1749. #endif
  1750.  
  1751.  
  1752.  
  1753. float vectorDot = dot((-lightVec / lightDistance), gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].spotDirection);
  1754.  
  1755. float cutoffDot = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].spotCosCutoff;
  1756.  
  1757.  
  1758.  
  1759. lightScale *= ((vectorDot < cutoffDot)? 0.0: 1.0);
  1760.  
  1761.  
  1762.  
  1763. gl_FragColor.rgb += (lightScale * gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].ambient.rgb);
  1764.  
  1765. gl_FragColor.rgb += (lightScale * lightAttenuation * (diffuse.rgb * gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].diffuse.rgb * lightCosAngDiff));
  1766.  
  1767. gl_FragColor.rgb += (lightScale * lightAttenuation * (specular.rgb * gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].specular.rgb * pow(lightCosAngSpec, 4.0)));
  1768.  
  1769. }
  1770.  
  1771. #endif
  1772.  
  1773.  
  1774.  
  1775. #if (DEFERRED_MODE == 1)
  1776.  
  1777. gl_FragData[GBUFFER_NORMTEX_IDX] = vec4(normal, 1.0);
  1778.  
  1779. gl_FragData[GBUFFER_DIFFTEX_IDX] = vec4(mix(diffuse.rgb, teamColor.rgb, diffuse.a), extraColor.a * teamColor.a);
  1780.  
  1781. // do not premultiply reflection, leave it to the deferred lighting pass
  1782.  
  1783. // gl_FragData[GBUFFER_DIFFTEX_IDX] = vec4(mix(diffuse.rgb, teamColor.rgb, diffuse.a) * reflection, extraColor.a * teamColor.a);
  1784.  
  1785. gl_FragData[GBUFFER_SPECTEX_IDX] = vec4(specular, 1.0);
  1786.  
  1787. gl_FragData[GBUFFER_EMITTEX_IDX] = vec4(extraColor.r, extraColor.r, extraColor.r, 1.0);
  1788.  
  1789. gl_FragData[GBUFFER_MISCTEX_IDX] = vec4(0.0, 0.0, 0.0, 0.0);
  1790.  
  1791. #else
  1792.  
  1793. gl_FragColor.rgb = mix(gl_Fog.color.rgb, gl_FragColor.rgb, fogFactor); // fog
  1794.  
  1795. gl_FragColor.a = extraColor.a * teamColor.a;
  1796.  
  1797. #endif
  1798.  
  1799. }
  1800.  
  1801.  
  1802. [f=0000000] [Shader] Warning: [GLSL-SO::Compile] shader-object name: GLSL/ModelVertProg.glsl, compile-log:
  1803. Vertex shader failed to compile with the following errors:
  1804. ERROR: 6:23: error(#71) Syntax error incorrect preprocessor directive
  1805. WARNING: 6:23: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1806. ERROR: 6:55: error(#71) Syntax error incorrect preprocessor directive
  1807. WARNING: 6:55: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1808. ERROR: 6:62: error(#71) Syntax error incorrect preprocessor directive
  1809. WARNING: 6:62: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1810. ERROR: error(#273) 3 compilation errors. No code generated
  1811.  
  1812.  
  1813. [f=0000000] [Shader] Warning:
  1814. // SHADER VERSION
  1815. // SHADER FLAGS
  1816. #define BASE_DYNAMIC_MODEL_LIGHT 2
  1817. #define MAX_DYNAMIC_MODEL_LIGHTS 1
  1818. // SHADER SOURCE
  1819. #line 1
  1820. // note: gl_ModelViewMatrix actually only contains the
  1821.  
  1822. // model matrix, view matrix is on the projection stack
  1823.  
  1824. //
  1825.  
  1826. // todo: clip gl_Position against gl_ClipPlane[3] if advFade
  1827.  
  1828. // note: many gfx will fallback to software rendering when
  1829.  
  1830. // gl_ClipDistance or gl_ClipPosition are used, so it might
  1831.  
  1832. // be better to use may a `discard` in the fragment shader
  1833.  
  1834. //
  1835.  
  1836. // note: shadow-map texture coordinates should be generated
  1837.  
  1838. // per fragment (the non-linear projection used can produce
  1839.  
  1840. // shifting artefacts with large triangles due to the linear
  1841.  
  1842. // interpolation of vertex positions), but this is a source
  1843.  
  1844. // of acne itself
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850. // #define use_normalmapping
  1851.  
  1852. // #define flip_normalmap
  1853.  
  1854.  
  1855.  
  1856. //uniform mat4 cameraMat;
  1857.  
  1858. //uniform mat4 cameraInv;
  1859.  
  1860. uniform vec3 cameraPos;
  1861.  
  1862. #if (USE_SHADOWS == 1)
  1863.  
  1864. uniform mat4 shadowMatrix;
  1865.  
  1866. uniform vec4 shadowParams;
  1867.  
  1868. #endif
  1869.  
  1870.  
  1871.  
  1872. varying vec4 vertexWorldPos;
  1873.  
  1874. varying vec3 cameraDir;
  1875.  
  1876. varying float fogFactor;
  1877.  
  1878.  
  1879.  
  1880. #ifdef use_normalmapping
  1881.  
  1882. varying mat3 tbnMatrix;
  1883.  
  1884. #else
  1885.  
  1886. varying vec3 normalv;
  1887.  
  1888. #endif
  1889.  
  1890.  
  1891.  
  1892. uniform int numModelDynLights;
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898. void main(void)
  1899.  
  1900. {
  1901.  
  1902. #ifdef use_normalmapping
  1903.  
  1904. vec3 tangent = gl_MultiTexCoord5.xyz;
  1905.  
  1906. vec3 bitangent = gl_MultiTexCoord6.xyz;
  1907.  
  1908. tbnMatrix = gl_NormalMatrix * mat3(tangent, bitangent, gl_Normal);
  1909.  
  1910. #else
  1911.  
  1912. normalv = gl_NormalMatrix * gl_Normal;
  1913.  
  1914. #endif
  1915.  
  1916.  
  1917.  
  1918. vertexWorldPos = gl_ModelViewMatrix * gl_Vertex;
  1919.  
  1920. gl_Position = gl_ProjectionMatrix * vertexWorldPos;
  1921.  
  1922. cameraDir = vertexWorldPos.xyz - cameraPos;
  1923.  
  1924.  
  1925.  
  1926. #if (USE_SHADOWS == 1)
  1927.  
  1928. gl_TexCoord[1] = shadowMatrix * vertexWorldPos;
  1929.  
  1930. gl_TexCoord[1].st = gl_TexCoord[1].st * (inversesqrt( abs(gl_TexCoord[1].st) + shadowParams.z) + shadowParams.w) + shadowParams.xy;
  1931.  
  1932. #endif
  1933.  
  1934.  
  1935.  
  1936. gl_TexCoord[0].st = gl_MultiTexCoord0.st;
  1937.  
  1938.  
  1939.  
  1940. #if (DEFERRED_MODE == 0)
  1941.  
  1942. float fogCoord = length(cameraDir.xyz);
  1943.  
  1944. fogFactor = (gl_Fog.end - fogCoord) * gl_Fog.scale; //gl_Fog.scale := 1.0 / (gl_Fog.end - gl_Fog.start)
  1945.  
  1946. fogFactor = clamp(fogFactor, 0.0, 1.0);
  1947.  
  1948. #endif
  1949.  
  1950. }
  1951.  
  1952.  
  1953. [f=0000000] [Shader] Warning: [GLSL-SO::Compile] shader-object name: GLSL/ModelFragProg.glsl, compile-log:
  1954. Fragment shader failed to compile with the following errors:
  1955. ERROR: 6:16: error(#71) Syntax error incorrect preprocessor directive
  1956. WARNING: 6:16: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1957. ERROR: 6:58: error(#71) Syntax error incorrect preprocessor directive
  1958. WARNING: 6:58: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1959. ERROR: 6:70: error(#71) Syntax error incorrect preprocessor directive
  1960. WARNING: 6:70: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1961. ERROR: 6:76: error(#71) Syntax error incorrect preprocessor directive
  1962. WARNING: 6:76: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1963. ERROR: 6:108: error(#71) Syntax error incorrect preprocessor directive
  1964. WARNING: 6:108: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  1965. ERROR: 6:109: error(#143) Undeclared identifier GBUFFER_NORMTEX_IDX
  1966. ERROR: 6:109: error(#166) Integer expression required []
  1967. ERROR: 6:110: error(#143) Undeclared identifier GBUFFER_DIFFTEX_IDX
  1968. ERROR: 6:110: error(#166) Integer expression required []
  1969. ERROR: 6:113: error(#143) Undeclared identifier GBUFFER_SPECTEX_IDX
  1970. ERROR: 6:113: error(#166) Integer expression required []
  1971. ERROR: 6:114: error(#143) Undeclared identifier GBUFFER_EMITTEX_IDX
  1972. ERROR: 6:114: error(#166) Integer expression required []
  1973. ERROR: 6:115: error(#143) Undeclared identifier GBUFFER_MISCTEX_IDX
  1974. ERROR: 6:115: error(#166) Integer expression required []
  1975. ERROR: error(#273) 15 compilation errors. No code generated
  1976.  
  1977.  
  1978. [f=0000000] [Shader] Warning:
  1979. // SHADER VERSION
  1980. // SHADER FLAGS
  1981. #define BASE_DYNAMIC_MODEL_LIGHT 2
  1982. #define MAX_DYNAMIC_MODEL_LIGHTS 1
  1983. // SHADER SOURCE
  1984. #line 1
  1985. // #define use_normalmapping
  1986.  
  1987. // #define flip_normalmap
  1988.  
  1989.  
  1990.  
  1991. #define textureS3o1 diffuseTex
  1992.  
  1993. #define textureS3o2 shadingTex
  1994.  
  1995. uniform sampler2D textureS3o1;
  1996.  
  1997. uniform sampler2D textureS3o2;
  1998.  
  1999. uniform samplerCube specularTex;
  2000.  
  2001. uniform samplerCube reflectTex;
  2002.  
  2003.  
  2004.  
  2005. uniform vec3 sunDir;
  2006.  
  2007. uniform vec3 sunDiffuse;
  2008.  
  2009. uniform vec3 sunAmbient;
  2010.  
  2011.  
  2012.  
  2013. #if (USE_SHADOWS == 1)
  2014.  
  2015. uniform sampler2DShadow shadowTex;
  2016.  
  2017. uniform float shadowDensity;
  2018.  
  2019. #endif
  2020.  
  2021.  
  2022.  
  2023. uniform vec4 teamColor; // alpha contains `far distance fading factor`
  2024.  
  2025.  
  2026.  
  2027. varying vec4 vertexWorldPos;
  2028.  
  2029. varying vec3 cameraDir;
  2030.  
  2031. varying float fogFactor;
  2032.  
  2033.  
  2034.  
  2035. #ifdef use_normalmapping
  2036.  
  2037. uniform sampler2D normalMap;
  2038.  
  2039. varying mat3 tbnMatrix;
  2040.  
  2041. #else
  2042.  
  2043. varying vec3 normalv;
  2044.  
  2045. #endif
  2046.  
  2047.  
  2048.  
  2049. uniform int numModelDynLights;
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055. void main(void)
  2056.  
  2057. {
  2058.  
  2059. #ifdef use_normalmapping
  2060.  
  2061. vec2 tc = gl_TexCoord[0].st;
  2062.  
  2063. #ifdef flip_normalmap
  2064.  
  2065. tc.t = 1.0 - tc.t;
  2066.  
  2067. #endif
  2068.  
  2069. vec3 nvTS = normalize((texture2D(normalMap, tc).xyz - 0.5) * 2.0);
  2070.  
  2071. vec3 normal = tbnMatrix * nvTS;
  2072.  
  2073. #else
  2074.  
  2075. vec3 normal = normalize(normalv);
  2076.  
  2077. #endif
  2078.  
  2079. vec3 light = max(dot(normal, sunDir), 0.0) * sunDiffuse + sunAmbient;
  2080.  
  2081.  
  2082.  
  2083. vec4 diffuse = texture2D(textureS3o1, gl_TexCoord[0].st);
  2084.  
  2085. vec4 extraColor = texture2D(textureS3o2, gl_TexCoord[0].st);
  2086.  
  2087.  
  2088.  
  2089. vec3 reflectDir = reflect(cameraDir, normal);
  2090.  
  2091. vec3 specular = textureCube(specularTex, reflectDir).rgb * extraColor.g * 4.0;
  2092.  
  2093. vec3 reflection = textureCube(reflectTex, reflectDir).rgb;
  2094.  
  2095.  
  2096.  
  2097. #if (USE_SHADOWS == 1)
  2098.  
  2099. float shadow = shadow2DProj(shadowTex, gl_TexCoord[1]).r;
  2100.  
  2101. shadow = 1.0 - (1.0 - shadow) * shadowDensity;
  2102.  
  2103. vec3 shade = mix(sunAmbient, light, shadow);
  2104.  
  2105. reflection = mix(shade, reflection, extraColor.g); // reflection
  2106.  
  2107. reflection += extraColor.rrr; // self-illum
  2108.  
  2109. specular *= shadow;
  2110.  
  2111. #else
  2112.  
  2113. reflection = mix(light, reflection, extraColor.g); // reflection
  2114.  
  2115. reflection += extraColor.rrr; // self-illum
  2116.  
  2117. #endif
  2118.  
  2119.  
  2120.  
  2121. #if (DEFERRED_MODE == 0)
  2122.  
  2123. gl_FragColor = diffuse;
  2124.  
  2125. gl_FragColor.rgb = mix(gl_FragColor.rgb, teamColor.rgb, gl_FragColor.a); // teamcolor
  2126.  
  2127. gl_FragColor.rgb = gl_FragColor.rgb * reflection + specular;
  2128.  
  2129. #endif
  2130.  
  2131.  
  2132.  
  2133. #if (DEFERRED_MODE == 0 && MAX_DYNAMIC_MODEL_LIGHTS > 0)
  2134.  
  2135. for (int i = 0; i < MAX_DYNAMIC_MODEL_LIGHTS; i++) {
  2136.  
  2137. vec3 lightVec = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].position.xyz - vertexWorldPos.xyz;
  2138.  
  2139. vec3 halfVec = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].halfVector.xyz;
  2140.  
  2141.  
  2142.  
  2143. float lightRadius = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].constantAttenuation;
  2144.  
  2145. float lightDistance = length(lightVec);
  2146.  
  2147. float lightScale = (lightDistance > lightRadius)? 0.0: 1.0;
  2148.  
  2149. float lightCosAngDiff = clamp(dot(normal, lightVec / lightDistance), 0.0, 1.0);
  2150.  
  2151. float lightCosAngSpec = clamp(dot(normal, normalize(halfVec)), 0.0, 1.0);
  2152.  
  2153. #ifdef OGL_SPEC_ATTENUATION
  2154.  
  2155. float lightAttenuation =
  2156.  
  2157. (gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].constantAttenuation) +
  2158.  
  2159. (gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].linearAttenuation * lightDistance) +
  2160.  
  2161. (gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].quadraticAttenuation * lightDistance * lightDistance);
  2162.  
  2163.  
  2164.  
  2165. lightAttenuation = 1.0 / max(lightAttenuation, 1.0);
  2166.  
  2167. #else
  2168.  
  2169. float lightAttenuation = 1.0 - min(1.0, ((lightDistance * lightDistance) / (lightRadius * lightRadius)));
  2170.  
  2171. #endif
  2172.  
  2173.  
  2174.  
  2175. float vectorDot = dot((-lightVec / lightDistance), gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].spotDirection);
  2176.  
  2177. float cutoffDot = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].spotCosCutoff;
  2178.  
  2179.  
  2180.  
  2181. lightScale *= ((vectorDot < cutoffDot)? 0.0: 1.0);
  2182.  
  2183.  
  2184.  
  2185. gl_FragColor.rgb += (lightScale * gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].ambient.rgb);
  2186.  
  2187. gl_FragColor.rgb += (lightScale * lightAttenuation * (diffuse.rgb * gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].diffuse.rgb * lightCosAngDiff));
  2188.  
  2189. gl_FragColor.rgb += (lightScale * lightAttenuation * (specular.rgb * gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].specular.rgb * pow(lightCosAngSpec, 4.0)));
  2190.  
  2191. }
  2192.  
  2193. #endif
  2194.  
  2195.  
  2196.  
  2197. #if (DEFERRED_MODE == 1)
  2198.  
  2199. gl_FragData[GBUFFER_NORMTEX_IDX] = vec4(normal, 1.0);
  2200.  
  2201. gl_FragData[GBUFFER_DIFFTEX_IDX] = vec4(mix(diffuse.rgb, teamColor.rgb, diffuse.a), extraColor.a * teamColor.a);
  2202.  
  2203. // do not premultiply reflection, leave it to the deferred lighting pass
  2204.  
  2205. // gl_FragData[GBUFFER_DIFFTEX_IDX] = vec4(mix(diffuse.rgb, teamColor.rgb, diffuse.a) * reflection, extraColor.a * teamColor.a);
  2206.  
  2207. gl_FragData[GBUFFER_SPECTEX_IDX] = vec4(specular, 1.0);
  2208.  
  2209. gl_FragData[GBUFFER_EMITTEX_IDX] = vec4(extraColor.r, extraColor.r, extraColor.r, 1.0);
  2210.  
  2211. gl_FragData[GBUFFER_MISCTEX_IDX] = vec4(0.0, 0.0, 0.0, 0.0);
  2212.  
  2213. #else
  2214.  
  2215. gl_FragColor.rgb = mix(gl_Fog.color.rgb, gl_FragColor.rgb, fogFactor); // fog
  2216.  
  2217. gl_FragColor.a = extraColor.a * teamColor.a;
  2218.  
  2219. #endif
  2220.  
  2221. }
  2222.  
  2223.  
  2224. [f=0000000] [Shader] Warning: [GLSL-SO::Compile] shader-object name: GLSL/ModelVertProg.glsl, compile-log:
  2225. Vertex shader failed to compile with the following errors:
  2226. ERROR: 6:23: error(#71) Syntax error incorrect preprocessor directive
  2227. WARNING: 6:23: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2228. ERROR: 6:55: error(#71) Syntax error incorrect preprocessor directive
  2229. WARNING: 6:55: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2230. ERROR: 6:62: error(#71) Syntax error incorrect preprocessor directive
  2231. WARNING: 6:62: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2232. ERROR: error(#273) 3 compilation errors. No code generated
  2233.  
  2234.  
  2235. [f=0000000] [Shader] Warning:
  2236. // SHADER VERSION
  2237. // SHADER FLAGS
  2238. #define BASE_DYNAMIC_MODEL_LIGHT 2
  2239. #define MAX_DYNAMIC_MODEL_LIGHTS 1
  2240. // SHADER SOURCE
  2241. #line 1
  2242. // note: gl_ModelViewMatrix actually only contains the
  2243.  
  2244. // model matrix, view matrix is on the projection stack
  2245.  
  2246. //
  2247.  
  2248. // todo: clip gl_Position against gl_ClipPlane[3] if advFade
  2249.  
  2250. // note: many gfx will fallback to software rendering when
  2251.  
  2252. // gl_ClipDistance or gl_ClipPosition are used, so it might
  2253.  
  2254. // be better to use may a `discard` in the fragment shader
  2255.  
  2256. //
  2257.  
  2258. // note: shadow-map texture coordinates should be generated
  2259.  
  2260. // per fragment (the non-linear projection used can produce
  2261.  
  2262. // shifting artefacts with large triangles due to the linear
  2263.  
  2264. // interpolation of vertex positions), but this is a source
  2265.  
  2266. // of acne itself
  2267.  
  2268.  
  2269.  
  2270.  
  2271.  
  2272. // #define use_normalmapping
  2273.  
  2274. // #define flip_normalmap
  2275.  
  2276.  
  2277.  
  2278. //uniform mat4 cameraMat;
  2279.  
  2280. //uniform mat4 cameraInv;
  2281.  
  2282. uniform vec3 cameraPos;
  2283.  
  2284. #if (USE_SHADOWS == 1)
  2285.  
  2286. uniform mat4 shadowMatrix;
  2287.  
  2288. uniform vec4 shadowParams;
  2289.  
  2290. #endif
  2291.  
  2292.  
  2293.  
  2294. varying vec4 vertexWorldPos;
  2295.  
  2296. varying vec3 cameraDir;
  2297.  
  2298. varying float fogFactor;
  2299.  
  2300.  
  2301.  
  2302. #ifdef use_normalmapping
  2303.  
  2304. varying mat3 tbnMatrix;
  2305.  
  2306. #else
  2307.  
  2308. varying vec3 normalv;
  2309.  
  2310. #endif
  2311.  
  2312.  
  2313.  
  2314. uniform int numModelDynLights;
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320. void main(void)
  2321.  
  2322. {
  2323.  
  2324. #ifdef use_normalmapping
  2325.  
  2326. vec3 tangent = gl_MultiTexCoord5.xyz;
  2327.  
  2328. vec3 bitangent = gl_MultiTexCoord6.xyz;
  2329.  
  2330. tbnMatrix = gl_NormalMatrix * mat3(tangent, bitangent, gl_Normal);
  2331.  
  2332. #else
  2333.  
  2334. normalv = gl_NormalMatrix * gl_Normal;
  2335.  
  2336. #endif
  2337.  
  2338.  
  2339.  
  2340. vertexWorldPos = gl_ModelViewMatrix * gl_Vertex;
  2341.  
  2342. gl_Position = gl_ProjectionMatrix * vertexWorldPos;
  2343.  
  2344. cameraDir = vertexWorldPos.xyz - cameraPos;
  2345.  
  2346.  
  2347.  
  2348. #if (USE_SHADOWS == 1)
  2349.  
  2350. gl_TexCoord[1] = shadowMatrix * vertexWorldPos;
  2351.  
  2352. gl_TexCoord[1].st = gl_TexCoord[1].st * (inversesqrt( abs(gl_TexCoord[1].st) + shadowParams.z) + shadowParams.w) + shadowParams.xy;
  2353.  
  2354. #endif
  2355.  
  2356.  
  2357.  
  2358. gl_TexCoord[0].st = gl_MultiTexCoord0.st;
  2359.  
  2360.  
  2361.  
  2362. #if (DEFERRED_MODE == 0)
  2363.  
  2364. float fogCoord = length(cameraDir.xyz);
  2365.  
  2366. fogFactor = (gl_Fog.end - fogCoord) * gl_Fog.scale; //gl_Fog.scale := 1.0 / (gl_Fog.end - gl_Fog.start)
  2367.  
  2368. fogFactor = clamp(fogFactor, 0.0, 1.0);
  2369.  
  2370. #endif
  2371.  
  2372. }
  2373.  
  2374.  
  2375. [f=0000000] [Shader] Warning: [GLSL-SO::Compile] shader-object name: GLSL/ModelFragProg.glsl, compile-log:
  2376. Fragment shader failed to compile with the following errors:
  2377. ERROR: 6:16: error(#71) Syntax error incorrect preprocessor directive
  2378. WARNING: 6:16: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2379. ERROR: 6:58: error(#71) Syntax error incorrect preprocessor directive
  2380. WARNING: 6:58: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2381. ERROR: 6:70: error(#71) Syntax error incorrect preprocessor directive
  2382. WARNING: 6:70: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2383. ERROR: 6:76: error(#71) Syntax error incorrect preprocessor directive
  2384. WARNING: 6:76: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2385. ERROR: 6:108: error(#71) Syntax error incorrect preprocessor directive
  2386. WARNING: 6:108: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2387. ERROR: 6:109: error(#143) Undeclared identifier GBUFFER_NORMTEX_IDX
  2388. ERROR: 6:109: error(#166) Integer expression required []
  2389. ERROR: 6:110: error(#143) Undeclared identifier GBUFFER_DIFFTEX_IDX
  2390. ERROR: 6:110: error(#166) Integer expression required []
  2391. ERROR: 6:113: error(#143) Undeclared identifier GBUFFER_SPECTEX_IDX
  2392. ERROR: 6:113: error(#166) Integer expression required []
  2393. ERROR: 6:114: error(#143) Undeclared identifier GBUFFER_EMITTEX_IDX
  2394. ERROR: 6:114: error(#166) Integer expression required []
  2395. ERROR: 6:115: error(#143) Undeclared identifier GBUFFER_MISCTEX_IDX
  2396. ERROR: 6:115: error(#166) Integer expression required []
  2397. ERROR: error(#273) 15 compilation errors. No code generated
  2398.  
  2399.  
  2400. [f=0000000] [Shader] Warning:
  2401. // SHADER VERSION
  2402. // SHADER FLAGS
  2403. #define BASE_DYNAMIC_MODEL_LIGHT 2
  2404. #define MAX_DYNAMIC_MODEL_LIGHTS 1
  2405. // SHADER SOURCE
  2406. #line 1
  2407. // #define use_normalmapping
  2408.  
  2409. // #define flip_normalmap
  2410.  
  2411.  
  2412.  
  2413. #define textureS3o1 diffuseTex
  2414.  
  2415. #define textureS3o2 shadingTex
  2416.  
  2417. uniform sampler2D textureS3o1;
  2418.  
  2419. uniform sampler2D textureS3o2;
  2420.  
  2421. uniform samplerCube specularTex;
  2422.  
  2423. uniform samplerCube reflectTex;
  2424.  
  2425.  
  2426.  
  2427. uniform vec3 sunDir;
  2428.  
  2429. uniform vec3 sunDiffuse;
  2430.  
  2431. uniform vec3 sunAmbient;
  2432.  
  2433.  
  2434.  
  2435. #if (USE_SHADOWS == 1)
  2436.  
  2437. uniform sampler2DShadow shadowTex;
  2438.  
  2439. uniform float shadowDensity;
  2440.  
  2441. #endif
  2442.  
  2443.  
  2444.  
  2445. uniform vec4 teamColor; // alpha contains `far distance fading factor`
  2446.  
  2447.  
  2448.  
  2449. varying vec4 vertexWorldPos;
  2450.  
  2451. varying vec3 cameraDir;
  2452.  
  2453. varying float fogFactor;
  2454.  
  2455.  
  2456.  
  2457. #ifdef use_normalmapping
  2458.  
  2459. uniform sampler2D normalMap;
  2460.  
  2461. varying mat3 tbnMatrix;
  2462.  
  2463. #else
  2464.  
  2465. varying vec3 normalv;
  2466.  
  2467. #endif
  2468.  
  2469.  
  2470.  
  2471. uniform int numModelDynLights;
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477. void main(void)
  2478.  
  2479. {
  2480.  
  2481. #ifdef use_normalmapping
  2482.  
  2483. vec2 tc = gl_TexCoord[0].st;
  2484.  
  2485. #ifdef flip_normalmap
  2486.  
  2487. tc.t = 1.0 - tc.t;
  2488.  
  2489. #endif
  2490.  
  2491. vec3 nvTS = normalize((texture2D(normalMap, tc).xyz - 0.5) * 2.0);
  2492.  
  2493. vec3 normal = tbnMatrix * nvTS;
  2494.  
  2495. #else
  2496.  
  2497. vec3 normal = normalize(normalv);
  2498.  
  2499. #endif
  2500.  
  2501. vec3 light = max(dot(normal, sunDir), 0.0) * sunDiffuse + sunAmbient;
  2502.  
  2503.  
  2504.  
  2505. vec4 diffuse = texture2D(textureS3o1, gl_TexCoord[0].st);
  2506.  
  2507. vec4 extraColor = texture2D(textureS3o2, gl_TexCoord[0].st);
  2508.  
  2509.  
  2510.  
  2511. vec3 reflectDir = reflect(cameraDir, normal);
  2512.  
  2513. vec3 specular = textureCube(specularTex, reflectDir).rgb * extraColor.g * 4.0;
  2514.  
  2515. vec3 reflection = textureCube(reflectTex, reflectDir).rgb;
  2516.  
  2517.  
  2518.  
  2519. #if (USE_SHADOWS == 1)
  2520.  
  2521. float shadow = shadow2DProj(shadowTex, gl_TexCoord[1]).r;
  2522.  
  2523. shadow = 1.0 - (1.0 - shadow) * shadowDensity;
  2524.  
  2525. vec3 shade = mix(sunAmbient, light, shadow);
  2526.  
  2527. reflection = mix(shade, reflection, extraColor.g); // reflection
  2528.  
  2529. reflection += extraColor.rrr; // self-illum
  2530.  
  2531. specular *= shadow;
  2532.  
  2533. #else
  2534.  
  2535. reflection = mix(light, reflection, extraColor.g); // reflection
  2536.  
  2537. reflection += extraColor.rrr; // self-illum
  2538.  
  2539. #endif
  2540.  
  2541.  
  2542.  
  2543. #if (DEFERRED_MODE == 0)
  2544.  
  2545. gl_FragColor = diffuse;
  2546.  
  2547. gl_FragColor.rgb = mix(gl_FragColor.rgb, teamColor.rgb, gl_FragColor.a); // teamcolor
  2548.  
  2549. gl_FragColor.rgb = gl_FragColor.rgb * reflection + specular;
  2550.  
  2551. #endif
  2552.  
  2553.  
  2554.  
  2555. #if (DEFERRED_MODE == 0 && MAX_DYNAMIC_MODEL_LIGHTS > 0)
  2556.  
  2557. for (int i = 0; i < MAX_DYNAMIC_MODEL_LIGHTS; i++) {
  2558.  
  2559. vec3 lightVec = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].position.xyz - vertexWorldPos.xyz;
  2560.  
  2561. vec3 halfVec = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].halfVector.xyz;
  2562.  
  2563.  
  2564.  
  2565. float lightRadius = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].constantAttenuation;
  2566.  
  2567. float lightDistance = length(lightVec);
  2568.  
  2569. float lightScale = (lightDistance > lightRadius)? 0.0: 1.0;
  2570.  
  2571. float lightCosAngDiff = clamp(dot(normal, lightVec / lightDistance), 0.0, 1.0);
  2572.  
  2573. float lightCosAngSpec = clamp(dot(normal, normalize(halfVec)), 0.0, 1.0);
  2574.  
  2575. #ifdef OGL_SPEC_ATTENUATION
  2576.  
  2577. float lightAttenuation =
  2578.  
  2579. (gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].constantAttenuation) +
  2580.  
  2581. (gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].linearAttenuation * lightDistance) +
  2582.  
  2583. (gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].quadraticAttenuation * lightDistance * lightDistance);
  2584.  
  2585.  
  2586.  
  2587. lightAttenuation = 1.0 / max(lightAttenuation, 1.0);
  2588.  
  2589. #else
  2590.  
  2591. float lightAttenuation = 1.0 - min(1.0, ((lightDistance * lightDistance) / (lightRadius * lightRadius)));
  2592.  
  2593. #endif
  2594.  
  2595.  
  2596.  
  2597. float vectorDot = dot((-lightVec / lightDistance), gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].spotDirection);
  2598.  
  2599. float cutoffDot = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].spotCosCutoff;
  2600.  
  2601.  
  2602.  
  2603. lightScale *= ((vectorDot < cutoffDot)? 0.0: 1.0);
  2604.  
  2605.  
  2606.  
  2607. gl_FragColor.rgb += (lightScale * gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].ambient.rgb);
  2608.  
  2609. gl_FragColor.rgb += (lightScale * lightAttenuation * (diffuse.rgb * gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].diffuse.rgb * lightCosAngDiff));
  2610.  
  2611. gl_FragColor.rgb += (lightScale * lightAttenuation * (specular.rgb * gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].specular.rgb * pow(lightCosAngSpec, 4.0)));
  2612.  
  2613. }
  2614.  
  2615. #endif
  2616.  
  2617.  
  2618.  
  2619. #if (DEFERRED_MODE == 1)
  2620.  
  2621. gl_FragData[GBUFFER_NORMTEX_IDX] = vec4(normal, 1.0);
  2622.  
  2623. gl_FragData[GBUFFER_DIFFTEX_IDX] = vec4(mix(diffuse.rgb, teamColor.rgb, diffuse.a), extraColor.a * teamColor.a);
  2624.  
  2625. // do not premultiply reflection, leave it to the deferred lighting pass
  2626.  
  2627. // gl_FragData[GBUFFER_DIFFTEX_IDX] = vec4(mix(diffuse.rgb, teamColor.rgb, diffuse.a) * reflection, extraColor.a * teamColor.a);
  2628.  
  2629. gl_FragData[GBUFFER_SPECTEX_IDX] = vec4(specular, 1.0);
  2630.  
  2631. gl_FragData[GBUFFER_EMITTEX_IDX] = vec4(extraColor.r, extraColor.r, extraColor.r, 1.0);
  2632.  
  2633. gl_FragData[GBUFFER_MISCTEX_IDX] = vec4(0.0, 0.0, 0.0, 0.0);
  2634.  
  2635. #else
  2636.  
  2637. gl_FragColor.rgb = mix(gl_Fog.color.rgb, gl_FragColor.rgb, fogFactor); // fog
  2638.  
  2639. gl_FragColor.a = extraColor.a * teamColor.a;
  2640.  
  2641. #endif
  2642.  
  2643. }
  2644.  
  2645.  
  2646. [f=0000000] [Shader] Warning: [GLSL-SO::Compile] shader-object name: GLSL/ModelVertProg.glsl, compile-log:
  2647. Vertex shader failed to compile with the following errors:
  2648. ERROR: 6:23: error(#71) Syntax error incorrect preprocessor directive
  2649. WARNING: 6:23: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2650. ERROR: 6:55: error(#71) Syntax error incorrect preprocessor directive
  2651. WARNING: 6:55: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2652. ERROR: 6:62: error(#71) Syntax error incorrect preprocessor directive
  2653. WARNING: 6:62: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2654. ERROR: error(#273) 3 compilation errors. No code generated
  2655.  
  2656.  
  2657. [f=0000000] [Shader] Warning:
  2658. // SHADER VERSION
  2659. // SHADER FLAGS
  2660. #define BASE_DYNAMIC_MODEL_LIGHT 2
  2661. #define MAX_DYNAMIC_MODEL_LIGHTS 1
  2662. // SHADER SOURCE
  2663. #line 1
  2664. // note: gl_ModelViewMatrix actually only contains the
  2665.  
  2666. // model matrix, view matrix is on the projection stack
  2667.  
  2668. //
  2669.  
  2670. // todo: clip gl_Position against gl_ClipPlane[3] if advFade
  2671.  
  2672. // note: many gfx will fallback to software rendering when
  2673.  
  2674. // gl_ClipDistance or gl_ClipPosition are used, so it might
  2675.  
  2676. // be better to use may a `discard` in the fragment shader
  2677.  
  2678. //
  2679.  
  2680. // note: shadow-map texture coordinates should be generated
  2681.  
  2682. // per fragment (the non-linear projection used can produce
  2683.  
  2684. // shifting artefacts with large triangles due to the linear
  2685.  
  2686. // interpolation of vertex positions), but this is a source
  2687.  
  2688. // of acne itself
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694. // #define use_normalmapping
  2695.  
  2696. // #define flip_normalmap
  2697.  
  2698.  
  2699.  
  2700. //uniform mat4 cameraMat;
  2701.  
  2702. //uniform mat4 cameraInv;
  2703.  
  2704. uniform vec3 cameraPos;
  2705.  
  2706. #if (USE_SHADOWS == 1)
  2707.  
  2708. uniform mat4 shadowMatrix;
  2709.  
  2710. uniform vec4 shadowParams;
  2711.  
  2712. #endif
  2713.  
  2714.  
  2715.  
  2716. varying vec4 vertexWorldPos;
  2717.  
  2718. varying vec3 cameraDir;
  2719.  
  2720. varying float fogFactor;
  2721.  
  2722.  
  2723.  
  2724. #ifdef use_normalmapping
  2725.  
  2726. varying mat3 tbnMatrix;
  2727.  
  2728. #else
  2729.  
  2730. varying vec3 normalv;
  2731.  
  2732. #endif
  2733.  
  2734.  
  2735.  
  2736. uniform int numModelDynLights;
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742. void main(void)
  2743.  
  2744. {
  2745.  
  2746. #ifdef use_normalmapping
  2747.  
  2748. vec3 tangent = gl_MultiTexCoord5.xyz;
  2749.  
  2750. vec3 bitangent = gl_MultiTexCoord6.xyz;
  2751.  
  2752. tbnMatrix = gl_NormalMatrix * mat3(tangent, bitangent, gl_Normal);
  2753.  
  2754. #else
  2755.  
  2756. normalv = gl_NormalMatrix * gl_Normal;
  2757.  
  2758. #endif
  2759.  
  2760.  
  2761.  
  2762. vertexWorldPos = gl_ModelViewMatrix * gl_Vertex;
  2763.  
  2764. gl_Position = gl_ProjectionMatrix * vertexWorldPos;
  2765.  
  2766. cameraDir = vertexWorldPos.xyz - cameraPos;
  2767.  
  2768.  
  2769.  
  2770. #if (USE_SHADOWS == 1)
  2771.  
  2772. gl_TexCoord[1] = shadowMatrix * vertexWorldPos;
  2773.  
  2774. gl_TexCoord[1].st = gl_TexCoord[1].st * (inversesqrt( abs(gl_TexCoord[1].st) + shadowParams.z) + shadowParams.w) + shadowParams.xy;
  2775.  
  2776. #endif
  2777.  
  2778.  
  2779.  
  2780. gl_TexCoord[0].st = gl_MultiTexCoord0.st;
  2781.  
  2782.  
  2783.  
  2784. #if (DEFERRED_MODE == 0)
  2785.  
  2786. float fogCoord = length(cameraDir.xyz);
  2787.  
  2788. fogFactor = (gl_Fog.end - fogCoord) * gl_Fog.scale; //gl_Fog.scale := 1.0 / (gl_Fog.end - gl_Fog.start)
  2789.  
  2790. fogFactor = clamp(fogFactor, 0.0, 1.0);
  2791.  
  2792. #endif
  2793.  
  2794. }
  2795.  
  2796.  
  2797. [f=0000000] [Shader] Warning: [GLSL-SO::Compile] shader-object name: GLSL/ModelFragProg.glsl, compile-log:
  2798. Fragment shader failed to compile with the following errors:
  2799. ERROR: 6:16: error(#71) Syntax error incorrect preprocessor directive
  2800. WARNING: 6:16: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2801. ERROR: 6:58: error(#71) Syntax error incorrect preprocessor directive
  2802. WARNING: 6:58: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2803. ERROR: 6:70: error(#71) Syntax error incorrect preprocessor directive
  2804. WARNING: 6:70: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2805. ERROR: 6:76: error(#71) Syntax error incorrect preprocessor directive
  2806. WARNING: 6:76: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2807. ERROR: 6:108: error(#71) Syntax error incorrect preprocessor directive
  2808. WARNING: 6:108: warning(#64) Unexpected tokens following the preprocessor directive - expected a newline(#if )
  2809. ERROR: 6:109: error(#143) Undeclared identifier GBUFFER_NORMTEX_IDX
  2810. ERROR: 6:109: error(#166) Integer expression required []
  2811. ERROR: 6:110: error(#143) Undeclared identifier GBUFFER_DIFFTEX_IDX
  2812. ERROR: 6:110: error(#166) Integer expression required []
  2813. ERROR: 6:113: error(#143) Undeclared identifier GBUFFER_SPECTEX_IDX
  2814. ERROR: 6:113: error(#166) Integer expression required []
  2815. ERROR: 6:114: error(#143) Undeclared identifier GBUFFER_EMITTEX_IDX
  2816. ERROR: 6:114: error(#166) Integer expression required []
  2817. ERROR: 6:115: error(#143) Undeclared identifier GBUFFER_MISCTEX_IDX
  2818. ERROR: 6:115: error(#166) Integer expression required []
  2819. ERROR: error(#273) 15 compilation errors. No code generated
  2820.  
  2821.  
  2822. [f=0000000] [Shader] Warning:
  2823. // SHADER VERSION
  2824. // SHADER FLAGS
  2825. #define BASE_DYNAMIC_MODEL_LIGHT 2
  2826. #define MAX_DYNAMIC_MODEL_LIGHTS 1
  2827. // SHADER SOURCE
  2828. #line 1
  2829. // #define use_normalmapping
  2830.  
  2831. // #define flip_normalmap
  2832.  
  2833.  
  2834.  
  2835. #define textureS3o1 diffuseTex
  2836.  
  2837. #define textureS3o2 shadingTex
  2838.  
  2839. uniform sampler2D textureS3o1;
  2840.  
  2841. uniform sampler2D textureS3o2;
  2842.  
  2843. uniform samplerCube specularTex;
  2844.  
  2845. uniform samplerCube reflectTex;
  2846.  
  2847.  
  2848.  
  2849. uniform vec3 sunDir;
  2850.  
  2851. uniform vec3 sunDiffuse;
  2852.  
  2853. uniform vec3 sunAmbient;
  2854.  
  2855.  
  2856.  
  2857. #if (USE_SHADOWS == 1)
  2858.  
  2859. uniform sampler2DShadow shadowTex;
  2860.  
  2861. uniform float shadowDensity;
  2862.  
  2863. #endif
  2864.  
  2865.  
  2866.  
  2867. uniform vec4 teamColor; // alpha contains `far distance fading factor`
  2868.  
  2869.  
  2870.  
  2871. varying vec4 vertexWorldPos;
  2872.  
  2873. varying vec3 cameraDir;
  2874.  
  2875. varying float fogFactor;
  2876.  
  2877.  
  2878.  
  2879. #ifdef use_normalmapping
  2880.  
  2881. uniform sampler2D normalMap;
  2882.  
  2883. varying mat3 tbnMatrix;
  2884.  
  2885. #else
  2886.  
  2887. varying vec3 normalv;
  2888.  
  2889. #endif
  2890.  
  2891.  
  2892.  
  2893. uniform int numModelDynLights;
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899. void main(void)
  2900.  
  2901. {
  2902.  
  2903. #ifdef use_normalmapping
  2904.  
  2905. vec2 tc = gl_TexCoord[0].st;
  2906.  
  2907. #ifdef flip_normalmap
  2908.  
  2909. tc.t = 1.0 - tc.t;
  2910.  
  2911. #endif
  2912.  
  2913. vec3 nvTS = normalize((texture2D(normalMap, tc).xyz - 0.5) * 2.0);
  2914.  
  2915. vec3 normal = tbnMatrix * nvTS;
  2916.  
  2917. #else
  2918.  
  2919. vec3 normal = normalize(normalv);
  2920.  
  2921. #endif
  2922.  
  2923. vec3 light = max(dot(normal, sunDir), 0.0) * sunDiffuse + sunAmbient;
  2924.  
  2925.  
  2926.  
  2927. vec4 diffuse = texture2D(textureS3o1, gl_TexCoord[0].st);
  2928.  
  2929. vec4 extraColor = texture2D(textureS3o2, gl_TexCoord[0].st);
  2930.  
  2931.  
  2932.  
  2933. vec3 reflectDir = reflect(cameraDir, normal);
  2934.  
  2935. vec3 specular = textureCube(specularTex, reflectDir).rgb * extraColor.g * 4.0;
  2936.  
  2937. vec3 reflection = textureCube(reflectTex, reflectDir).rgb;
  2938.  
  2939.  
  2940.  
  2941. #if (USE_SHADOWS == 1)
  2942.  
  2943. float shadow = shadow2DProj(shadowTex, gl_TexCoord[1]).r;
  2944.  
  2945. shadow = 1.0 - (1.0 - shadow) * shadowDensity;
  2946.  
  2947. vec3 shade = mix(sunAmbient, light, shadow);
  2948.  
  2949. reflection = mix(shade, reflection, extraColor.g); // reflection
  2950.  
  2951. reflection += extraColor.rrr; // self-illum
  2952.  
  2953. specular *= shadow;
  2954.  
  2955. #else
  2956.  
  2957. reflection = mix(light, reflection, extraColor.g); // reflection
  2958.  
  2959. reflection += extraColor.rrr; // self-illum
  2960.  
  2961. #endif
  2962.  
  2963.  
  2964.  
  2965. #if (DEFERRED_MODE == 0)
  2966.  
  2967. gl_FragColor = diffuse;
  2968.  
  2969. gl_FragColor.rgb = mix(gl_FragColor.rgb, teamColor.rgb, gl_FragColor.a); // teamcolor
  2970.  
  2971. gl_FragColor.rgb = gl_FragColor.rgb * reflection + specular;
  2972.  
  2973. #endif
  2974.  
  2975.  
  2976.  
  2977. #if (DEFERRED_MODE == 0 && MAX_DYNAMIC_MODEL_LIGHTS > 0)
  2978.  
  2979. for (int i = 0; i < MAX_DYNAMIC_MODEL_LIGHTS; i++) {
  2980.  
  2981. vec3 lightVec = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].position.xyz - vertexWorldPos.xyz;
  2982.  
  2983. vec3 halfVec = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].halfVector.xyz;
  2984.  
  2985.  
  2986.  
  2987. float lightRadius = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].constantAttenuation;
  2988.  
  2989. float lightDistance = length(lightVec);
  2990.  
  2991. float lightScale = (lightDistance > lightRadius)? 0.0: 1.0;
  2992.  
  2993. float lightCosAngDiff = clamp(dot(normal, lightVec / lightDistance), 0.0, 1.0);
  2994.  
  2995. float lightCosAngSpec = clamp(dot(normal, normalize(halfVec)), 0.0, 1.0);
  2996.  
  2997. #ifdef OGL_SPEC_ATTENUATION
  2998.  
  2999. float lightAttenuation =
  3000.  
  3001. (gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].constantAttenuation) +
  3002.  
  3003. (gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].linearAttenuation * lightDistance) +
  3004.  
  3005. (gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].quadraticAttenuation * lightDistance * lightDistance);
  3006.  
  3007.  
  3008.  
  3009. lightAttenuation = 1.0 / max(lightAttenuation, 1.0);
  3010.  
  3011. #else
  3012.  
  3013. float lightAttenuation = 1.0 - min(1.0, ((lightDistance * lightDistance) / (lightRadius * lightRadius)));
  3014.  
  3015. #endif
  3016.  
  3017.  
  3018.  
  3019. float vectorDot = dot((-lightVec / lightDistance), gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].spotDirection);
  3020.  
  3021. float cutoffDot = gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].spotCosCutoff;
  3022.  
  3023.  
  3024.  
  3025. lightScale *= ((vectorDot < cutoffDot)? 0.0: 1.0);
  3026.  
  3027.  
  3028.  
  3029. gl_FragColor.rgb += (lightScale * gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].ambient.rgb);
  3030.  
  3031. gl_FragColor.rgb += (lightScale * lightAttenuation * (diffuse.rgb * gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].diffuse.rgb * lightCosAngDiff));
  3032.  
  3033. gl_FragColor.rgb += (lightScale * lightAttenuation * (specular.rgb * gl_LightSource[BASE_DYNAMIC_MODEL_LIGHT + i].specular.rgb * pow(lightCosAngSpec, 4.0)));
  3034.  
  3035. }
  3036.  
  3037. #endif
  3038.  
  3039.  
  3040.  
  3041. #if (DEFERRED_MODE == 1)
  3042.  
  3043. gl_FragData[GBUFFER_NORMTEX_IDX] = vec4(normal, 1.0);
  3044.  
  3045. gl_FragData[GBUFFER_DIFFTEX_IDX] = vec4(mix(diffuse.rgb, teamColor.rgb, diffuse.a), extraColor.a * teamColor.a);
  3046.  
  3047. // do not premultiply reflection, leave it to the deferred lighting pass
  3048.  
  3049. // gl_FragData[GBUFFER_DIFFTEX_IDX] = vec4(mix(diffuse.rgb, teamColor.rgb, diffuse.a) * reflection, extraColor.a * teamColor.a);
  3050.  
  3051. gl_FragData[GBUFFER_SPECTEX_IDX] = vec4(specular, 1.0);
  3052.  
  3053. gl_FragData[GBUFFER_EMITTEX_IDX] = vec4(extraColor.r, extraColor.r, extraColor.r, 1.0);
  3054.  
  3055. gl_FragData[GBUFFER_MISCTEX_IDX] = vec4(0.0, 0.0, 0.0, 0.0);
  3056.  
  3057. #else
  3058.  
  3059. gl_FragColor.rgb = mix(gl_Fog.color.rgb, gl_FragColor.rgb, fogFactor); // fog
  3060.  
  3061. gl_FragColor.a = extraColor.a * teamColor.a;
  3062.  
  3063. #endif
  3064.  
  3065. }
  3066.  
  3067.  
  3068. [f=0000000] Creating Water
  3069. [f=0000000] Game::LoadInterface (Camera&Mouse): 173 ms
  3070. [f=0000000] Game::LoadInterface (Console): 13 ms
  3071. [f=0000000] [Sound] Error: Unable to open audio file: FailedCommand
  3072. [f=0000000] [Sound] Error: CSound::GetSoundId: could not find sound: FailedCommand
  3073. [f=0000000] Loading LuaRules
  3074. [f=0000000] -------------Survival Debug Messages----------------
  3075. [f=0000000] TEAM
  3076. [f=0000000] TEAM , 0, 0, false, false, outer_colonies, 0, <table>, 1
  3077. [f=0000000] ----------------------------------------------------
  3078. [f=0000000] -------------Survival Debug Messages----------------
  3079. [f=0000000] TEAM
  3080. [f=0000000] TEAM , 1, 1, false, false, outer_colonies, 0, <table>, 1
  3081. [f=0000000] ----------------------------------------------------
  3082. [f=0000000] -------------Survival Debug Messages----------------
  3083. [f=0000000] TEAM
  3084. [f=0000000] TEAM , 2, 2, false, false, outer_colonies, 0, <table>, 1
  3085. [f=0000000] ----------------------------------------------------
  3086. [f=0000000] -------------Survival Debug Messages----------------
  3087. [f=0000000] TEAM
  3088. [f=0000000] TEAM , 3, 3, false, false, outer_colonies, 0, <table>, 1
  3089. [f=0000000] ----------------------------------------------------
  3090. [f=0000000] -------------Survival Debug Messages----------------
  3091. [f=0000000] TEAM
  3092. [f=0000000] TEAM , 4, 4, false, false, outer_colonies, 1, <table>, 1
  3093. [f=0000000] ----------------------------------------------------
  3094. [f=0000000] -------------Survival Debug Messages----------------
  3095. [f=0000000] TEAM
  3096. [f=0000000] TEAM , 5, 5, false, false, outer_colonies, 1, <table>, 1
  3097. [f=0000000] ----------------------------------------------------
  3098. [f=0000000] -------------Survival Debug Messages----------------
  3099. [f=0000000] TEAM
  3100. [f=0000000] TEAM , 6, 6, false, false, outer_colonies, 1, <table>, 1
  3101. [f=0000000] ----------------------------------------------------
  3102. [f=0000000] -------------Survival Debug Messages----------------
  3103. [f=0000000] TEAM
  3104. [f=0000000] TEAM , 7, -1, false, false, , 2, <table>, 1
  3105. [f=0000000] ----------------------------------------------------
  3106. [f=0000000] Survival Spawner: Normal
  3107. [f=0000000] [gadgets.lua] Error: Failed to load: chickens_unit_spawner_defense.lua ([string "LuaRules/Gadgets/chickens_unit_spawner_defe..."]:277: attempt to index field 'difficulties' (a nil value))
  3108. [f=0000000] Loading gadget: Lua unit script framework <unit_script.lua>
  3109. [f=0000000] ammobox, 131
  3110. [f=0000000] LUARULES-DRAW (GADGETS)
  3111. [f=0000000] Loading LuaGaia
  3112. [f=0000000] Loading LuaUI
  3113. [f=0000000] LuaSocketEnabled: yes
  3114. [f=0000000] This game has locked LuaUI access
  3115. [f=0000000] This game has locked LuaUI access
  3116. [f=0000000] Using LUAUI_DIRNAME = LuaUI/
  3117. [f=0000000] Reloaded ctrlpanel from file: LuaUI/ctrlpanel.txt
  3118. [f=0000000] LuaUI: bound F11 to the widget selector
  3119. [f=0000000] LuaUI: bound CTRL+F11 to tweak mode
  3120. [f=0000000] Error: [UnitDefIndex] ERROR_TYPE for key "extractSquare" in UnitDefs __index
  3121. [f=0000000] Loaded API widget: Shared Functions <api_shared_functions.lua>
  3122. [f=0000000] Loaded API widget: Avatars <api_avatars.lua>
  3123. [f=0000000] Loaded API widget: Chili Framework <api_chili.lua>
  3124. [f=0000000] Loaded API widget: Lups <lups_wrapper.lua>
  3125. [f=0000000] Hardware mouse-cursor is disabled!
  3126. [f=0000000] Set "shadows" config-parameter to 1
  3127. [f=0000000] Set UnitLodDist to 1000
  3128. [f=0000000] model shaders is enabled!
  3129. [f=0000000] Ground-decals rendering is disabled!
  3130. [f=0000000] Set maximum particles to: 500
  3131. [f=0000000] Set UnitIconDist to 200
  3132. [f=0000000] Loaded widget: EPIC Menu <gui_epicmenu.lua>
  3133. [f=0000000] Loaded widget: Chili Minimap <gui_chili_minimap.lua>
  3134. [f=0000000] Loaded widget: Chili Widget Selector <gui_chili_widgetselector.lua>
  3135. [f=0000000] Loaded widget: Custom Cursor Sets <gui_customcursorsets.lua>
  3136. [f=0000000] Mexspot Fetcher fetching
  3137. [f=0000000] Loaded widget: Mexspot Fetcher <wg_mexspot_fetcher.lua>
  3138. [f=0000000] *** Common Colors ***
  3139. [f=0000000] - ÿÿraven4444 (Red)
  3140. [f=0000000] - ÿ9¯LanselptXC (Purple)
  3141. [f=0000000] - ÿÿÿGhost333 (Yellow)
  3142. [f=0000000] - ÿDªGKAGamer (Blue)
  3143. [f=0000000] - ÿÌGugu42 (Green)
  3144. [f=0000000] - ÿÿfKingDalak (Orange)
  3145. [f=0000000] - ÿÿÿÂCorlian (Parchment)
  3146. [f=0000000] Loaded widget: Common Team Colors <gui_common_colors.lua>
  3147. [f=0000000] Loaded widget: Commander Name Tags <unit_comm_nametags.lua>
  3148. [f=0000000] Loaded widget: HealthBars <unit_healthbars.lua>
  3149. [f=0000000] Loaded widget: Outline <gfx_outline.lua>
  3150. [f=0000000] Loaded widget: BuildETA <gui_build_eta.lua>
  3151. [f=0000000] Loaded widget: AA Command Helper <cmd_attackcmd_aid.lua>
  3152. [f=0000000] End spec mode / action finder
  3153. [f=0000000] Loaded widget: Action Finder <cmd_actionfinder.lua>
  3154. [f=0000000] Loaded widget: Auto Group <unit_auto_group.lua>
  3155. [f=0000000] Loaded widget: Autoquit <autoquit.lua>
  3156. [f=0000000] Loaded widget: CameraShake <camera_shake.lua>
  3157. [f=0000000] Loaded widget: Chili Rejoining Progress Bar <gui_chili_rejoin_progress.lua>
  3158. [f=0000000] Loaded widget: Chili Resource Bars <gui_chili_resource_bars.lua>
  3159. [f=0000000] Loaded widget: Chili Selections & CursorTip <gui_chili_selections_and_cursortip.lua>
  3160. [f=0000000] Loaded widget: Context Menu <gui_contextmenu.lua>
  3161. [f=0000000] Loaded widget: Custom Unit Rings <unit_customrings.lua>
  3162. [f=0000000] Loaded widget: Darkening <gui_darkening.lua>
  3163. [f=0000000] Loaded widget: Funks EndGame Graph <gui_chili_endgraph.lua>
  3164. [f=0000000] Loaded widget: Ground Texture Highlight - Frames <gui_power_range.lua>
  3165. [f=0000000] Loaded widget: GroupMove <unit_group_move.lua>
  3166. [f=0000000] Loaded widget: Highlight Geos <gui_highlight_geos.lua>
  3167. [f=0000000] Loaded widget: Keep Morpheds Selected <keep_morphed_selected.lua>
  3168. [f=0000000] Loaded widget: Load Own Moving <unit_load_own_moving.lua>
  3169. [f=0000000] Loaded widget: Local Widgets Config <localwidgets.lua>
  3170. [f=0000000] Loaded widget: Luarules Console Commands <cnslcmd.lua>
  3171. [f=0000000] Loaded widget: Mex Placement Handler <cmd_mex_placement.lua>
  3172. [f=0000000] Loaded widget: MinimapEvents <minimap_events.lua>
  3173. [f=0000000] Loaded widget: Pause Screen <gui_pausescreen.lua>
  3174. [f=0000000] Loaded widget: Point Tracker <gui_point_tracker.lua>
  3175. [f=0000000] Loaded widget: Reset Hotkeys <reset_hotkeys.lua>
  3176. [f=0000000] Loaded widget: SmartSelect <unit_smart_select.lua>
  3177. [f=0000000] Loaded widget: Spectate Selected <gui_spectate_selected.lua>
  3178. [f=0000000] Loaded widget: State Reverse Toggle <cmd_state_reverse_toggle.lua>
  3179. [f=0000000] Loaded widget: Stereo3D <gfx_stereo3d.lua>
  3180. [f=0000000] Loaded widget: Auto First Build Facing <autofirstbuildfacing.lua>
  3181. [f=0000000] Loaded widget: NoDuplicateOrders <cmd_no_duplicate_orders.lua>
  3182. [f=0000000] Loaded widget: Stockpiler <unit_stockpile.lua>
  3183. [f=0000000] Loaded widget: Supply Bar <gui_chili_supplydisplay.lua>
  3184. [f=0000000] Loaded widget: Write GameState <gamestate_write.lua>
  3185. [f=0000000] Loaded widget: Music Player <snd_music.lua>
  3186. [f=0000000] Loaded widget: Show All Commands <unit_showallcommands.lua>
  3187. [f=0000000] Loaded widget: Ghost Radar v1.11 <unit_ghostradar.lua>
  3188. [f=0000000] Loaded widget: Nuke Button <gui_nukebutton.lua>
  3189. [f=0000000] Loaded widget: MiniMap Start Boxes <minimap_startbox.lua>
  3190. [f=0000000] Loaded widget: Transport AI <unit_transport_ai.lua>
  3191. [f=0000000] Loaded widget: StartRadius <gui_startradius.lua>
  3192. [f=0000000] Loaded widget: Unit Auto Reclaim/Heal/Assist <unit_auto_reclaim_heal_assist.lua>
  3193. [f=0000000] Loaded widget: Stall Assist <cmd_stall_assist.lua>
  3194. [f=0000000] Loaded widget: Auto Group Com <unit_auto_group_com.lua>
  3195. [f=0000000] Loaded widget: Start Point Remover & Comm Selector <init_start_point_remover.lua>
  3196. [f=0000000] Loaded widget: Improved MetalMakers <unit_improved_metal_maker.lua>
  3197. [f=0000000] Loaded widget: Mission Briefing <gui_mission_briefing.lua>
  3198. [f=0000000] Loaded widget: Radar Colours <gui_radar_colors.lua>
  3199. [f=0000000] Loaded widget: Attack AoE <gui_attack_aoe.lua>
  3200. [f=0000000] Loaded widget: Select Keys <gui_selectkeys.lua>
  3201. [f=0000000] Loaded widget: Unit Icons <unit_icons.lua>
  3202. [f=0000000] map shaders is disabled!
  3203. [f=0000000] model shaders is disabled!
  3204. [f=0000000] dynamic-sky rendering is disabled!
  3205. [f=0000000] dynamic-sun rendering is disabled!
  3206. [f=0000000] Set maximum nano-particles to: 500
  3207. [f=0000000] Set maximum particles to: 2000
  3208. [f=0000000] Set "shadows" config-parameter to 0
  3209. [f=0000000] Loaded widget: Graphics Settings (1 - Ultra Low) <gfx_settings_ultra_low.lua>
  3210. [f=0000000] map shaders is disabled!
  3211. [f=0000000] model shaders is enabled!
  3212. [f=0000000] dynamic-sky rendering is disabled!
  3213. [f=0000000] dynamic-sun rendering is disabled!
  3214. [f=0000000] Set maximum nano-particles to: 1000
  3215. [f=0000000] Set maximum particles to: 2500
  3216. [f=0000000] Set "shadows" config-parameter to 0
  3217. [f=0000000] Loaded widget: Graphics Settings (2 - Low) <gfx_settings_low.lua>
  3218. [f=0000000] Loaded widget: AllyCursors <gui_ally_cursors.lua>
  3219. [f=0000000] Loaded widget: BA Waypoint Dragger <unit_waypoint_dragger.lua>
  3220. [f=0000000] Loaded widget: CEG Spawner <dbg_ceg_spawner.lua>
  3221. [f=0000000] Loaded widget: CommandInsert <gui_commandinsert.lua>
  3222. [f=0000000] Loaded widget: Dev Commands <dbg_devcommands.lua>
  3223. [f=0000000] Loaded widget: Fancy Teamplatter <gui_fancy_teamplatter.lua>
  3224. [f=0000000] Loaded widget: QueueCopypasta <cmd_queue_copypasta.lua>
  3225. [f=0000000] Loaded widget: Rank Icons 2 <unit_rank_icons.lua>
  3226. [f=0000000] Reloaded cmdcolors from file: cmdcolors.tmp
  3227. [f=0000000] Loaded widget: SelectionHalo <gui_selectionhalo.lua>
  3228. [f=0000000] Loaded widget: Select n Center! <gui_center_n_select.lua>
  3229. [f=0000000] Loaded widget: LupsManager <gfx_lups_manager.lua>
  3230. [f=0000000] Loaded widget: Units on Fire <gfx_lups_units_on_fire.lua>
  3231. [f=0000000] Loaded widget: Smoke Signal <gfx_lups_smokesignal.lua>
  3232. [f=0000000] Loaded widget: Chili Chat 2.1 <gui_chili_chat2_1.lua>
  3233. [f=0000000] Loaded widget: Chili Deluxe Player List - Alpha 2.02 (Modified for Evolution RTS) <gui_chili_deluxeplayerlist.lua>
  3234. [f=0000000] Loaded widget: Chili Docking <gui_chili_docking.lua>
  3235. [f=0000000] Loaded widget: Mouse Buildspacing <gui_buildspacing.lua>
  3236. [f=0000000] Loaded widget: Image Preloader <dbg_buildpic_preload.lua>
  3237. [f=0000000] Epicmenu: tab (overviewmode, Combo Overhead/Free Camera (experimental))
  3238. [f=0000000] Epicmenu: alt+t (trackmode, Combo Overhead/Free Camera (experimental))
  3239. [f=0000000] Epicmenu: alt+k (thirdpersontrack, Combo Overhead/Free Camera (experimental))
  3240. [f=0000000] Loaded widget: Combo Overhead/Free Camera (experimental) <camera_cofc.lua>
  3241. [f=0000000] Loaded widget: Default Group Recall Fix <gui_group_recall_fix.lua>
  3242. [f=0000000] Loaded widget: CustomFormations2 <unit_customformations2.lua>
  3243. [f=0000000] Loaded widget: Chili Integral Menu <gui_chili_integral_menu.lua>
  3244. [f=0000000] [EPIC Menu] Error: Could not open keybind file LuaUI/Configs/evo_keys.lua for writing
  3245. [f=0000000] LuaUI v0.3
  3246. [f=0000000] Initializing PathCache
  3247. [f=0000000] Finalizing
  3248. [f=0000000] Set water rendering mode to 0 (basic)
  3249. [f=0000000] [Shader] Warning: [GLSL-SO::Compile] shader-object name: GLSL/bumpWaterCoastBlurFS.glsl, compile-log:
  3250. Fragment shader failed to compile with the following errors:
  3251. ERROR: 6:57: error(#132) Syntax error: 'out' parse error
  3252. ERROR: error(#273) 1 compilation errors. No code generated
  3253.  
  3254.  
  3255. [f=0000000] [Shader] Warning:
  3256. // SHADER VERSION
  3257. #version 120
  3258. // SHADER FLAGS
  3259. // SHADER SOURCE
  3260. #line 1
  3261.  
  3262. /**
  3263. * @project Spring RTS
  3264. * @file bumpWaterCoastBlurFS.glsl
  3265. * @brief Input is a 0/1 bitmap and 1 indicates land.
  3266. * Now this shader blurs this map, so you get something like
  3267. * a distance to land map (->coastmap).
  3268. * @author jK
  3269. *
  3270. * Copyright (C) 2008,2009. Licensed under the terms of the
  3271. * GNU GPL, v2 or later.
  3272. */
  3273.  
  3274. #define res 15.0
  3275. #define renderToAtlas (gl_TexCoord[2].x > 0.5)
  3276. #define radius gl_TexCoord[2].y
  3277.  
  3278. uniform sampler2D tex0; //! final (fullsize) texture
  3279. uniform sampler2D tex1; //! atlas with to be updated rects
  3280.  
  3281. const float kernel = 1.0 / 10.0;
  3282.  
  3283. vec2 texelScissor = vec2(dFdx(gl_TexCoord[0].p), dFdy(gl_TexCoord[0].q)); // heightmap pos
  3284. vec2 texel0 = vec2(dFdx(gl_TexCoord[0].s), dFdy(gl_TexCoord[0].t)); // 0..1
  3285.  
  3286. vec4 tex2D(vec2 offset) {
  3287. if (renderToAtlas) {
  3288. return texture2D(tex0, gl_TexCoord[0].st + offset * texel0);
  3289. } else {
  3290. vec2 scissor = gl_TexCoord[0].pq + (offset * texelScissor);
  3291. bool outOfAtlasBound = any(greaterThan(scissor,vec2(1.0))) || any(lessThan(scissor,vec2(0.0)));
  3292. if (outOfAtlasBound) {
  3293. return texture2D(tex1, gl_TexCoord[0].st);
  3294. } else {
  3295. return texture2D(tex1, gl_TexCoord[0].st + offset * texel0);
  3296. }
  3297. }
  3298. }
  3299.  
  3300. vec2 getDistRect(float d, vec2 offset) {
  3301. vec2 dist;
  3302. float minDist = res - d * res;
  3303. dist.x = floor(minDist);
  3304. float iDist = dist.x * dist.x;
  3305. minDist *= minDist;
  3306. dist.y = sqrt(minDist - iDist);
  3307. dist += offset;
  3308. return dist;
  3309. }
  3310.  
  3311. float sqlength(vec2 v) {
  3312. return dot(v, v);
  3313. }
  3314.  
  3315.  
  3316. void LoopIter(in out float maxDist, in out vec3 minDist, float i) {
  3317. // 0____1____2
  3318. // | |
  3319. // | |
  3320. // 3 x 4
  3321. // | |
  3322. // | |
  3323. // 5____6____7
  3324.  
  3325. vec4 v1, v2;
  3326. v1.x = tex2D(vec2(-i, radius)).g;
  3327. v1.y = tex2D(vec2( i, radius)).g;
  3328. v1.z = tex2D(vec2(-i, -radius)).g;
  3329. v1.w = tex2D(vec2( i, -radius)).g;
  3330.  
  3331. v2.x = tex2D(vec2( radius, i)).g;
  3332. v2.y = tex2D(vec2( radius, -i)).g;
  3333. v2.z = tex2D(vec2(-radius, i)).g;
  3334. v2.w = tex2D(vec2(-radius, -i)).g;
  3335.  
  3336. v1 = max(v1, v2 );
  3337. v1.xy = max(v1.xy, v1.zw);
  3338. v1.x = max(v1.x, v1.y );
  3339. v1.x = max(v1.x, maxDist );
  3340.  
  3341. vec2 dist = getDistRect(v1.x, vec2(radius, i));
  3342. //minDist.z = min(minDist.z, sqlength(dist));
  3343.  
  3344. if (sqlength(dist) < minDist.z) {
  3345. maxDist = v1.x;
  3346. minDist = vec3(dist, sqlength(dist));
  3347. }
  3348. }
  3349.  
  3350.  
  3351. void main() {
  3352. if (radius < 0.5) {
  3353. //! initialize
  3354. gl_FragColor = texture2D(tex1, gl_TexCoord[0].st);
  3355. return;
  3356. }
  3357.  
  3358. if (radius > 9.5) {
  3359. //! blur the texture in the final stage
  3360. vec2
  3361. groundSurrounding = tex2D(vec2( 1.0, 1.0)).rb;
  3362. groundSurrounding += tex2D(vec2(-1.0, 1.0)).rb;
  3363. groundSurrounding += tex2D(vec2(-1.0,-1.0)).rb;
  3364. groundSurrounding += tex2D(vec2( 1.0,-1.0)).rb;
  3365.  
  3366. gl_FragColor = texture2D(tex1, gl_TexCoord[0].st);
  3367.  
  3368. if (groundSurrounding.x + gl_FragColor.r == 5.0) {
  3369. gl_FragColor.r = 1.0;
  3370. } else {
  3371. gl_FragColor.r = 0.93 - (groundSurrounding.y + gl_FragColor.b) / 5.0;
  3372. }
  3373.  
  3374. return;
  3375. } else if (radius > 8.5) {
  3376. //! blur the texture in the final stage
  3377. vec2
  3378. blur = texture2D(tex0, gl_TexCoord[0].st + vec2( 1.0, 1.0) * texel0).rg;
  3379. blur += texture2D(tex0, gl_TexCoord[0].st + vec2(-1.0, 1.0) * texel0).rg;
  3380. blur += texture2D(tex0, gl_TexCoord[0].st + vec2(-1.0,-1.0) * texel0).rg;
  3381. blur += texture2D(tex0, gl_TexCoord[0].st + vec2( 1.0,-1.0) * texel0).rg;
  3382.  
  3383. gl_FragColor = texture2D(tex0, gl_TexCoord[0].st);
  3384. gl_FragColor.r = step(5.0, blur.x + gl_FragColor.r);
  3385. gl_FragColor.g = mix(gl_FragColor.g, blur.y * 0.25, 0.4);
  3386. return;
  3387. }
  3388.  
  3389. float maxValue = 0.0;
  3390. vec3 minDist = vec3(1e9);
  3391.  
  3392. // driver fails at unrolling when count is not known
  3393. // at compile-time, so we do it manually (radius is
  3394. // in [0.5, 8.5], so we need at most 8 iterations)
  3395. float iter = 0.0;
  3396. if (iter <= radius) { LoopIter(maxValue, minDist, iter); iter += 1.0; }
  3397. if (iter <= radius) { LoopIter(maxValue, minDist, iter); iter += 1.0; }
  3398. if (iter <= radius) { LoopIter(maxValue, minDist, iter); iter += 1.0; }
  3399. if (iter <= radius) { LoopIter(maxValue, minDist, iter); iter += 1.0; }
  3400. if (iter <= radius) { LoopIter(maxValue, minDist, iter); iter += 1.0; }
  3401. if (iter <= radius) { LoopIter(maxValue, minDist, iter); iter += 1.0; }
  3402. if (iter <= radius) { LoopIter(maxValue, minDist, iter); iter += 1.0; }
  3403. if (iter <= radius) { LoopIter(maxValue, minDist, iter); iter += 1.0; }
  3404.  
  3405. //! PROCESS maxValue
  3406. //if (maxValue == 0.0)
  3407. // discard;
  3408.  
  3409. float fDist = 1.0 - (min(res, sqrt(minDist.z)) / res);
  3410.  
  3411. if (renderToAtlas) {
  3412. gl_FragColor = texture2D(tex0, gl_TexCoord[0].st);
  3413. } else {
  3414. gl_FragColor = texture2D(tex1, gl_TexCoord[0].st);
  3415. }
  3416.  
  3417. gl_FragColor.g = max(gl_FragColor.g, fDist * fDist * fDist);
  3418. }
  3419.  
  3420. [f=0000000] Error: Spring 96.0 has crashed.
  3421. [f=0000000] Error: DLL information:
  3422. [f=0000000] Error: 0x00400000 spring
  3423. [f=0000000] Error: 0x772a0000 ntdll
  3424. [f=0000000] Error: 0x76b40000 kernel32
  3425. [f=0000000] Error: 0x76160000 KERNELBASE
  3426. [f=0000000] Error: 0x76970000 ADVAPI32
  3427. [f=0000000] Error: 0x75c40000 msvcrt
  3428. [f=0000000] Error: 0x762f0000 sechost
  3429. [f=0000000] Error: 0x76db0000 RPCRT4
  3430. [f=0000000] Error: 0x74cd0000 SspiCli
  3431. [f=0000000] Error: 0x74cc0000 CRYPTBASE
  3432. [f=0000000] Error: 0x63a50000 GLU32
  3433. [f=0000000] Error: 0x63a80000 OPENGL32
  3434. [f=0000000] Error: 0x76a10000 GDI32
  3435. [f=0000000] Error: 0x76cb0000 USER32
  3436. [f=0000000] Error: 0x75bf0000 LPK
  3437. [f=0000000] Error: 0x766a0000 USP10
  3438. [f=0000000] Error: 0x62ff0000 DDRAW
  3439. [f=0000000] Error: 0x6d0d0000 DCIMAN32
  3440. [f=0000000] Error: 0x75cf0000 SETUPAPI
  3441. [f=0000000] Error: 0x761b0000 CFGMGR32
  3442. [f=0000000] Error: 0x76310000 OLEAUT32
  3443. [f=0000000] Error: 0x74d30000 ole32
  3444. [f=0000000] Error: 0x75c00000 DEVOBJ
  3445. [f=0000000] Error: 0x68ed0000 dwmapi
  3446. [f=0000000] Error: 0x75b80000 IMAGEHLP
  3447. [f=0000000] Error: 0x74ea0000 SHELL32
  3448. [f=0000000] Error: 0x76c50000 SHLWAPI
  3449. [f=0000000] Error: 0x74380000 WINMM
  3450. [f=0000000] Error: 0x75bb0000 WS2_32
  3451. [f=0000000] Error: 0x762e0000 NSI
  3452. [f=0000000] Error: 0x10000000 DevIL
  3453. [f=0000000] Error: 0x747c0000 MSVCP80
  3454. [f=0000000] Error: 0x74720000 MSVCR80
  3455. [f=0000000] Error: 0x6b600000 OpenAL32
  3456. [f=0000000] Error: 0x70780000 vorbisfile
  3457. [f=0000000] Error: 0x68140000 ogg
  3458. [f=0000000] Error: 0x64cc0000 vorbis
  3459. [f=0000000] Error: 0x62e80000 zlib1
  3460. [f=0000000] Error: 0x66fc0000 freetype6
  3461. [f=0000000] Error: 0x62aa0000 glew32
  3462. [f=0000000] Error: 0x01390000 SDL
  3463. [f=0000000] Error: 0x7c340000 MSVCR71
  3464. [f=0000000] Error: 0x76100000 IMM32
  3465. [f=0000000] Error: 0x761f0000 MSCTF
  3466. [f=0000000] Error: 0x63db0000 dsound
  3467. [f=0000000] Error: 0x6e020000 POWRPROF
  3468. [f=0000000] Error: 0x76ab0000 CLBCatQ
  3469. [f=0000000] Error: 0x6dfa0000 MMDevApi
  3470. [f=0000000] Error: 0x67af0000 PROPSYS
  3471. [f=0000000] Error: 0x6d110000 wdmaud
  3472. [f=0000000] Error: 0x6d100000 ksuser
  3473. [f=0000000] Error: 0x6d0f0000 AVRT
  3474. [f=0000000] Error: 0x6e0b0000 AUDIOSES
  3475. [f=0000000] Error: 0x67c80000 msacm32
  3476. [f=0000000] Error: 0x62b40000 MSACM32
  3477. [f=0000000] Error: 0x67920000 midimap
  3478. [f=0000000] Error: 0x5bdd0000 gameoverlayrenderer
  3479. [f=0000000] Error: 0x75c20000 psapi
  3480. [f=0000000] Error: 0x72ee0000 profapi
  3481. [f=0000000] Error: 0x68ef0000 uxtheme
  3482. [f=0000000] Error: 0x68f70000 saHook
  3483. [f=0000000] Error: 0x04d60000 pmls
  3484. [f=0000000] Error: 0x6e1b0000 OLEACC
  3485. [f=0000000] Error: 0x75e90000 WININET
  3486. [f=0000000] Error: 0x762c0000 api-ms-win-downlevel-user32-l1-1-0
  3487. [f=0000000] Error: 0x76aa0000 api-ms-win-downlevel-shlwapi-l1-1-0
  3488. [f=0000000] Error: 0x761e0000 api-ms-win-downlevel-version-l1-1-0
  3489. [f=0000000] Error: 0x74bf0000 version
  3490. [f=0000000] Error: 0x77270000 api-ms-win-downlevel-normaliz-l1-1-0
  3491. [f=0000000] Error: 0x762d0000 normaliz
  3492. [f=0000000] Error: 0x04e10000 iertutil
  3493. [f=0000000] Error: 0x74e90000 api-ms-win-downlevel-advapi32-l1-1-0
  3494. [f=0000000] Error: 0x693b0000 ntmarta
  3495. [f=0000000] Error: 0x76530000 WLDAP32
  3496. [f=0000000] Error: 0x63d70000 Schannel
  3497. [f=0000000] Error: 0x76580000 CRYPT32
  3498. [f=0000000] Error: 0x75c30000 MSASN1
  3499. [f=0000000] Error: 0x72e20000 mswsock
  3500. [f=0000000] Error: 0x72e10000 wshtcpip
  3501. [f=0000000] Error: 0x685e0000 atiglpxx
  3502. [f=0000000] Error: 0x07080000 atioglxx
  3503. [f=0000000] Error: 0x68560000 atigktxx
  3504. [f=0000000] Error: 0x6de10000 aticfx32
  3505. [f=0000000] Error: 0x056a0000 atiadlxy
  3506. [f=0000000] Error: 0x76050000 WINTRUST
  3507. [f=0000000] Error: 0x639f0000 DINPUT
  3508. [f=0000000] Error: 0x6e1a0000 HID
  3509. [f=0000000] Error: 0x6c970000 wship6
  3510. [f=0000000] Error: 0x665c0000 dbghelp
  3511. [f=0000000] Error: Exception: Access violation (0xc0000005)
  3512. [f=0000000] Error: Exception Address: 0x0774c6e2
  3513. [f=0000000] Error: Stacktrace for Spring 96.0:
  3514. [f=0000000] Error: This stack trace indicates a problem with your graphic card driver. Please try upgrading or downgrading it. Specifically recommended is the latest driver, and one that is as old as your graphic card. Make sure to use a driver removal utility, before installing other drivers.
  3515. [f=0000000] Error: (0) C:\Windows\system32\atioglxx.dll(atiPPHSN+0x5f1a62) [0x0774C6E2]
  3516. [f=0000000] Error: (1) C:\Windows\SysWOW64\ntdll.dll(RtlInitUnicodeString+0x164) [0x772CE38C]
  3517. [f=0000000] Error: (2) C:\Windows\SysWOW64\ntdll.dll(RtlAllocateHeap+0xac) [0x772CE0F2]
  3518. [f=0000000] Error: (3) C:\Windows\system32\atioglxx.dll(atiPPHSN+0x5f2fe1) [0x0774DC61]
  3519. [f=0000000] Error: [ErrorMessageBox][1] msg="Spring has crashed:
  3520. Access violation.
  3521.  
  3522. A stacktrace has been written to:
  3523. C:\Users\Joshua\Documents\My Games\Spring\infolog.txt" IsMainThread()=1 fromMain=0
  3524. [f=0000000] Error: [ErrorMessageBox][2]
  3525. [f=0000000] [SpringApp::ShutDown][1]
  3526. [f=0000000] [ThreadPool::SetThreadCount][1] #wanted=0 #current=3
  3527. [f=0000000] [ThreadPool::SetThreadCount][2] #threads=0
  3528. [f=0000000] [SpringApp::ShutDown][2]
  3529. [f=0000000] [~CGame][1]
  3530. [f=0000000] [~CGame][2]
  3531. [f=0000000] [~CGame][3]
  3532. [f=0000000] [~CGame][4]
  3533. [f=0000000] [~CGame][5]
  3534. [f=0000000] MetalMakers widget disabled for spectators
  3535. [f=0000000] [~CGame][6]
  3536. [f=0000000] [EPIC Menu] Error: Could not open keybind file LuaUI/Configs/evo_keys.lua for writing
  3537. [f=0000000] [~CGame][7]
  3538. [f=0000000] [~CGame][8]
  3539. [f=0000000] [CCollisionHandler] dis-/continuous tests: 0/0
  3540. [f=0000000] [~CGame][9]
  3541. [f=0000000] [~CGame][10]
  3542. [f=0000000] [~CPathCache(24x28)] cacheHits=0 hitPercentage=0% numHashColls=0 maxCacheSize=0
  3543. [f=0000000] [~CPathCache(24x28)] cacheHits=0 hitPercentage=0% numHashColls=0 maxCacheSize=0
  3544. [f=0000000] [~CPathCache(96x112)] cacheHits=0 hitPercentage=0% numHashColls=0 maxCacheSize=0
  3545. [f=0000000] [~CPathCache(96x112)] cacheHits=0 hitPercentage=0% numHashColls=0 maxCacheSize=0
  3546. [f=0000000] Statistics for RectangleOptimizer: 0%
  3547. [f=0000000] Statistics for RectangleOptimizer: 0%
  3548. [f=0000000] [~CGame][11]
  3549. [f=0000000] [~CGame][12]
  3550. [f=0000000] [~CGame][13]
  3551. [f=0000000] [~CGame][14]
  3552. [f=0000000] [~CGame][15]
  3553. [f=0000000] [~CGame][16]
  3554. [f=0000000] [Sound] [~CSound][1] soundThread=02CB3860
  3555. [f=0000000] [Sound] [~CSound][2]
  3556. [f=0000000] [Sound] [~CSound][3]
  3557. [f=0000000] [~CGame][17]
  3558. [f=0000000] [SpringApp::ShutDown][3]
  3559. [f=0000000] [SpringApp::ShutDown][4]
  3560. [f=0000000] Statistics for UDP connection:
  3561. Received: 2901 bytes in 51 packets (56.8824 bytes/package)
  3562. Sent: 256 bytes in 24 packets (10.6667 bytes/package)
  3563. Relative protocol overhead: 0 up, 0.105481 down
  3564. 3 incoming chunks dropped, 0 outgoing chunks resent
  3565.  
  3566. [f=0000000] Writing demo: demos/20140413_112952_Eye_Of_Horus_v2_96.sdf
  3567. [f=0000000] [SpringApp::ShutDown][5]
  3568. [f=0000000] [SpringApp::ShutDown][6]
  3569. [f=0000000] [SpringApp::ShutDown][7]
  3570. [f=0000000] [SpringApp::ShutDown][8]
  3571. [f=0000000] [SpringApp::ShutDown][9]
  3572. [SpringApp::ShutDown][10]
  3573. [SpringApp::ShutDown][11]
  3574. [WatchDog::Uninstall][1] hangDetectorThread=02CB3550
  3575. [WatchDog::Uninstall][2]
  3576. [WatchDog::Uninstall][3]
  3577. [SpringApp::ShutDown][12]
  3578. Error: [ErrorMessageBox][3]
  3579. Error: [ErrorMessageBox][4]
  3580. Fatal: Spring: Unhandled exception
  3581. Spring has crashed:
  3582. Access violation.
  3583.  
  3584. A stacktrace has been written to:
  3585. C:\Users\Joshua\Documents\My Games\Spring\infolog.txt
Advertisement
Add Comment
Please, Sign In to add comment