Guest User

Untitled

a guest
Aug 9th, 2026
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 62.70 KB | None | 0 0
  1. client-main.log
  2.  
  3. 9.8.2026 08:40:48 [Notification] Client logger started.
  4. 9.8.2026 08:40:48 [Notification] Game Version: v1.22.6 (Stable)
  5. 9.8.2026 08:40:48 [Notification] Process path: ~/.config/VSLGameVersions/1.22.6/Vintagestory
  6. 9.8.2026 08:40:48 [Notification] Operating System: Linux (CachyOS) [Kernel 7.1.5.1]
  7. 9.8.2026 08:40:48 [Notification] CPU Cores: 20
  8. 9.8.2026 08:40:48 [Notification] CPU: 13th Gen Intel(R) Core(TM) i5-13600K
  9. 9.8.2026 08:40:48 [Notification] Available RAM: 31797 MB
  10. 9.8.2026 08:40:49 [Notification] OpenAL Initialized. Available Mono/Stereo Sources: 255/1
  11. 9.8.2026 08:40:49 [Notification] Graphics Card Vendor: AMD
  12. 9.8.2026 08:40:49 [Notification] Graphics Card Version: 4.6 (Core Profile) Mesa 26.1.6-arch3.1
  13. 9.8.2026 08:40:49 [Notification] Graphics Card Renderer: AMD Radeon RX 9060 XT (radeonsi, gfx1200, ACO, DRM 3.64, 7.1.5-1-cachyos)
  14. 9.8.2026 08:40:49 [Notification] Graphics Card ShadingLanguageVersion: 4.60
  15. 9.8.2026 08:40:49 [Notification] GL.MaxVertexUniformComponents: 16384
  16. 9.8.2026 08:40:49 [Notification] GL.MaxUniformBlockSize: 2147483647
  17. 9.8.2026 08:40:49 [Notification] C# Framework: .net 10.0.10
  18. 9.8.2026 08:40:49 [Notification] Cairo Graphics Version: 1.18.4
  19. 9.8.2026 08:40:49 [Notification] OpenAL Version: 1.1 ALSOFT 1.23.0
  20. 9.8.2026 08:40:49 [Notification] Zstd Version: 1.5.7
  21. 9.8.2026 08:40:49 [Notification] Start discovering assets
  22. 9.8.2026 08:40:49 [Notification] Found 35 base assets in category lang
  23. 9.8.2026 08:40:49 [Notification] Found 0 base assets in category patches
  24. 9.8.2026 08:40:49 [Notification] Found 24 base assets in category config
  25. 9.8.2026 08:40:49 [Notification] Found 0 base assets in category worldproperties
  26. 9.8.2026 08:40:49 [Notification] Found 49 base assets in category sounds
  27. 9.8.2026 08:40:49 [Notification] Found 230 base assets in category shapes
  28. 9.8.2026 08:40:49 [Notification] Found 84 base assets in category shaders
  29. 9.8.2026 08:40:49 [Notification] Found 19 base assets in category shaderincludes
  30. 9.8.2026 08:40:49 [Notification] Found 182 base assets in category textures
  31. 9.8.2026 08:40:49 [Notification] Found 4 base assets in category music
  32. 9.8.2026 08:40:49 [Notification] Found 0 base assets in category dialog
  33. 9.8.2026 08:40:49 [Notification] Found 627 base assets in total
  34. 9.8.2026 08:40:49 [Notification] Loading sounds
  35. 9.8.2026 08:40:49 [Notification] (Re-)loaded frame buffers
  36. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass .
  37. 9.8.2026 08:40:49 [Notification] Waiting for async sound loading...
  38. 9.8.2026 08:40:49 [Notification] Sounds loaded
  39. 9.8.2026 08:40:49 [Notification] Begin loading shaders
  40. 9.8.2026 08:40:49 [Notification] Load shaders now
  41. 9.8.2026 08:40:49 [Notification] Loading shaders...
  42. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass standard.
  43. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass particlescube.
  44. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass particlesquad.
  45. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass sky.
  46. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass nightsky.
  47. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass woittest.
  48. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass transparentcompose.
  49. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass debugdepthbuffer.
  50. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass helditem.
  51. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass chunkopaque.
  52. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass chunkliquid.
  53. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass decals.
  54. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass final.
  55. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass gui.
  56. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass blur.
  57. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass chunktransparent.
  58. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass findbright.
  59. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass chunktopsoil.
  60. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass godrays.
  61. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass autocamera.
  62. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass blockhighlights.
  63. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass wireframe.
  64. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass entityanimated.
  65. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass luma.
  66. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass blit.
  67. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass particlesquad2d.
  68. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass shadowmapentityanimated.
  69. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass chunkshadowmap.
  70. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass texture2texture.
  71. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass celestialobject.
  72. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass guitopsoil.
  73. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass colorgrade.
  74. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass guigear.
  75. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass ssao.
  76. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass bilateralblur.
  77. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass chunkliquiddepth.
  78. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass aurora.
  79. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass cloudmap.
  80. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass cloudvolumetric.
  81. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass instanced.
  82. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass lines.
  83. 9.8.2026 08:40:49 [Notification] Loaded Shaderprogramm for render pass entityanimated.
  84. 9.8.2026 08:40:49 [Notification] Cached session key is valid, validating with server
  85. 9.8.2026 08:40:50 [Notification] Server validation response: Good
  86. 9.8.2026 08:40:50 [Notification] Will search the following paths for mods:
  87. 9.8.2026 08:40:50 [Notification] ~/.config/VSLGameVersions/1.22.6/Mods
  88. 9.8.2026 08:40:50 [Notification] ~/.config/VSLInstallations/My-New-Installation/Mods
  89. 9.8.2026 08:40:57 [Notification] Initialized GUI Manager
  90. 9.8.2026 08:40:57 [Notification] Initialized Server Connection
  91. 9.8.2026 08:40:57 [Notification] Server args parsed
  92. 9.8.2026 08:40:57 [Notification] Server main instantiated
  93. 9.8.2026 08:41:07 [Notification] Processed server identification
  94. 9.8.2026 08:41:07 [Notification] Map initialized
  95. 9.8.2026 08:41:07 [Notification] Received server assets
  96. 9.8.2026 08:41:07 [Notification] Loading and pre-starting client side mods...
  97. 9.8.2026 08:41:07 [Notification] Will search the following paths for mods:
  98. 9.8.2026 08:41:07 [Notification] ~/.config/VSLGameVersions/1.22.6/Mods
  99. 9.8.2026 08:41:07 [Notification] ~/.config/VSLInstallations/My-New-Installation/Mods
  100. 9.8.2026 08:41:07 [Notification] Found 4 mods (0 disabled)
  101. 9.8.2026 08:41:07 [Notification] Mods, sorted by dependency: game, coriaendershaders, creative, survival
  102. 9.8.2026 08:41:07 [Notification] Instantiated 149 mod systems from 4 enabled mods
  103. 9.8.2026 08:41:07 [Notification] Done loading and pre-starting client side mods.
  104. 9.8.2026 08:41:07 [Notification] External Origins in load order: modorigin@~/.config/VSLGameVersions/1.22.6/assets/creative/, modorigin@~/.config/VSLGameVersions/1.22.6/assets/survival/, [email protected]
  105. 9.8.2026 08:41:07 [Notification] Tags registries now locked.
  106. 9.8.2026 08:41:07 [Notification] Found 1 external assets in category lang
  107. 9.8.2026 08:41:07 [Notification] Found 10 external assets in category patches
  108. 9.8.2026 08:41:07 [Notification] Found 128 external assets in category config
  109. 9.8.2026 08:41:07 [Notification] Found 25 external assets in category worldproperties
  110. 9.8.2026 08:41:07 [Notification] Found 681 external assets in category sounds
  111. 9.8.2026 08:41:07 [Notification] Found 6123 external assets in category shapes
  112. 9.8.2026 08:41:07 [Notification] Found 31 external assets in category shaders
  113. 9.8.2026 08:41:07 [Notification] Found 8 external assets in category shaderincludes
  114. 9.8.2026 08:41:07 [Notification] Found 9459 external assets in category textures
  115. 9.8.2026 08:41:07 [Notification] Found 83 external assets in category music
  116. 9.8.2026 08:41:07 [Notification] Found 18 external assets in category dialog
  117. 9.8.2026 08:41:07 [Notification] Found 0 external assets in category compatibility
  118. 9.8.2026 08:41:07 [Notification] Reloaded lang file now with mod assets
  119. 9.8.2026 08:41:07 [Notification] Compatibility lib: 0 assets added, 0 assets replaced.
  120. 9.8.2026 08:41:07 [Notification] JsonPatch Loader: 6 patches total, successfully applied 6 patches, no errors
  121. 9.8.2026 08:41:08 [Notification] Received 4469 item types from server
  122. 9.8.2026 08:41:08 [Notification] Loaded 14091 block types from server
  123. 9.8.2026 08:41:09 [Notification] Reloaded sounds, now with mod assets
  124. 9.8.2026 08:41:09 [Notification] Composed 1 4096x2048 entities texture atlases from 695 textures
  125. 9.8.2026 08:41:09 [Notification] Collected 3096 shapes to tesselate.
  126. 9.8.2026 08:41:10 [Notification] Composed 1 4096x2048 items texture atlases from 2346 textures
  127. 9.8.2026 08:41:12 [Notification] Composed 2 4096x2048 blocks texture atlases from 7449 textures
  128. 9.8.2026 08:41:12 [Notification] Server assets loaded
  129. 9.8.2026 08:41:12 [Notification] Blocks tesselated
  130. 9.8.2026 08:41:18 [Notification] Server launched
  131. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass standard.
  132. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass standard.
  133. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass entityanimated.
  134. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass particlescube.
  135. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass lines.
  136. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass aurora.
  137. 9.8.2026 08:41:18 [Notification] Initialised WeatherSystemClient. simLightning is loaded.
  138. 9.8.2026 08:41:18 [Warning] [coriaendershaders] [CoriaenderShadersModSystem] Couldn't find VsImGui mod system, GUI will be unavailable.
  139. 9.8.2026 08:41:18 [Notification] [coriaendershaders] [EffectManager] Initializing WaterEffects.
  140. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass watercompose.
  141. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass cameradepth.
  142. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass waternormals.
  143. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass screenspacereflections.
  144. 9.8.2026 08:41:18 [Notification] [coriaendershaders] [EffectManager] Initializing CloudShadows.
  145. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass cloudshadowmap.
  146. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass cloudshadowblur.
  147. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass cloudmapmip.
  148. 9.8.2026 08:41:18 [Notification] [coriaendershaders] [EffectManager] Initializing TerrainShadows.
  149. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass drawvoxeldata.
  150. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass depthmipmap.
  151. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass depthmipmap.
  152. 9.8.2026 08:41:18 [Notification] [coriaendershaders] [EffectManager] Initializing VoxelSpriteRenderer.
  153. 9.8.2026 08:41:18 [Notification] [ChunkMemoryManager] Initializing memory manager
  154. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass visibleculling.
  155. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass voxelcompaction.
  156. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass voxelcompaction.
  157. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass casterculling.
  158. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass drawvoxeldata.
  159. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogram for render pass depthmipmap.
  160. 9.8.2026 08:41:18 [Notification] [coriaendershaders] [EffectManager] Initializing DeferedShading.
  161. 9.8.2026 08:41:18 [Error] Shader compile error in deferredlighting 0:233(42): error: `shadowCoordsNear' undeclared
  162. 0:233(42): error: type mismatch
  163. 0:233(42): error: operands of `==' must have the same type
  164. 0:382(70): error: `shadowCoordsNear' undeclared
  165. 0:382(70): error: type mismatch
  166. 0:382(50): error: operands to arithmetic operators must be numeric
  167. 0:382(28): error: no matching function for call to `smoothstep(float, float, error)'; candidates are:
  168. 0:382(28): error: float smoothstep(float, float, float)
  169. 0:382(28): error: vec2 smoothstep(float, float, vec2)
  170. 0:382(28): error: vec3 smoothstep(float, float, vec3)
  171. 0:382(28): error: vec4 smoothstep(float, float, vec4)
  172. 0:382(28): error: vec2 smoothstep(vec2, vec2, vec2)
  173. 0:382(28): error: vec3 smoothstep(vec3, vec3, vec3)
  174. 0:382(28): error: vec4 smoothstep(vec4, vec4, vec4)
  175. 0:382(28): error: double smoothstep(double, double, double)
  176. 0:382(28): error: dvec2 smoothstep(double, double, dvec2)
  177. 0:382(28): error: dvec3 smoothstep(double, double, dvec3)
  178. 0:382(28): error: dvec4 smoothstep(double, double, dvec4)
  179. 0:382(28): error: dvec2 smoothstep(dvec2, dvec2, dvec2)
  180. 0:382(28): error: dvec3 smoothstep(dvec3, dvec3, dvec3)
  181. 0:382(28): error: dvec4 smoothstep(dvec4, dvec4, dvec4)
  182. 0:382(6): error: no matching function for call to `mix(float, float, error)'; candidates are:
  183. 0:382(6): error: float mix(float, float, float)
  184. 0:382(6): error: vec2 mix(vec2, vec2, float)
  185. 0:382(6): error: vec3 mix(vec3, vec3, float)
  186. 0:382(6): error: vec4 mix(vec4, vec4, float)
  187. 0:382(6): error: vec2 mix(vec2, vec2, vec2)
  188. 0:382(6): error: vec3 mix(vec3, vec3, vec3)
  189. 0:382(6): error: vec4 mix(vec4, vec4, vec4)
  190. 0:382(6): error: double mix(double, double, double)
  191. 0:382(6): error: dvec2 mix(dvec2, dvec2, double)
  192. 0:382(6): error: dvec3 mix(dvec3, dvec3, double)
  193. 0:382(6): error: dvec4 mix(dvec4, dvec4, double)
  194. 0:382(6): error: dvec2 mix(dvec2, dvec2, dvec2)
  195. 0:382(6): error: dvec3 mix(dvec3, dvec3, dvec3)
  196. 0:382(6): error: dvec4 mix(dvec4, dvec4, dvec4)
  197. 0:382(6): error: float mix(float, float, bool)
  198. 0:382(6): error: vec2 mix(vec2, vec2, bvec2)
  199. 0:382(6): error: vec3 mix(vec3, vec3, bvec3)
  200. 0:382(6): error: vec4 mix(vec4, vec4, bvec4)
  201. 0:382(6): error: double mix(double, double, bool)
  202. 0:382(6): error: dvec2 mix(dvec2, dvec2, bvec2)
  203. 0:382(6): error: dvec3 mix(dvec3, dvec3, bvec3)
  204. 0:382(6): error: dvec4 mix(dvec4, dvec4, bvec4)
  205. 9.8.2026 08:41:18 [Error] Couldn't write to log file, failed formatting #version 430
  206. #define FXAA 1
  207. #define SSAOLEVEL 1
  208. #define NORMALVIEW 0
  209. #define BLOOM 1
  210. #define GODRAYS 0
  211. #define FOAMEFFECT 1
  212. #define SHINYEFFECT 1
  213. #define SHADOWQUALITY 1
  214. #define DYNLIGHTS 25
  215. #define USEOIT 1
  216. #define TERRAINSHADOWS
  217. #define CLOUDSHADOWS
  218. #define INCOLORUNIT 0
  219. #define INGLOWUNIT 1
  220. #define GPOSITIONUNIT 2
  221. #define GNORMALUNIT 3
  222. #define SHADOW_CASCADE_BINDING 4
  223. #define DEFERBASE
  224. #define SHADOWMAPFARUNIT 4
  225. #define SHADOWMAPNEARUNIT 5
  226. #define INCLUDESHADOWCOORDS
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234. layout(location=0) out vec4 outColor;
  235.  
  236.  
  237.  
  238.  
  239.  
  240. layout(binding=INCOLORUNIT) uniform sampler2D inColor;
  241. layout(binding=INGLOWUNIT) uniform sampler2D inGlow;
  242. layout(binding=GPOSITIONUNIT) uniform sampler2D GPosition;
  243. layout(binding=GNORMALUNIT) uniform sampler2D GNormal;
  244.  
  245. in vec2 vUV;
  246. uniform mat4 invModelView;
  247. uniform float shadowIntensity;
  248.  
  249. #ifdef INCLUDESHADOWCOORDS
  250. uniform mat4 modelViewMtx;
  251.  
  252. #if SHADOWQUALITY > 0
  253. uniform float shadowRangeFar;
  254. uniform mat4 toShadowMapSpaceMatrixFar;
  255. vec4 shadowCoordsFar;
  256. #endif
  257. #if SHADOWQUALITY > 1
  258. uniform float shadowRangeNear;
  259. uniform mat4 toShadowMapSpaceMatrixNear;
  260. vec4 shadowCoordsNear;
  261. #endif
  262.  
  263.  
  264. const float transitionDistance = 10.0;
  265.  
  266.  
  267. void calcShadowMapCoords(mat4 modelviewMat, vec4 worldPos) {
  268. float nearSub = 0;
  269. #if SHADOWQUALITY > 0
  270. float len = length(worldPos);
  271. #endif
  272.  
  273. #if SHADOWQUALITY > 1
  274. // Near map
  275. shadowCoordsNear = toShadowMapSpaceMatrixNear * worldPos;
  276.  
  277. float distanceNear = clamp(
  278. max(max(0.0, 0.03 - shadowCoordsNear.x) * 100, max(0.0, shadowCoordsNear.x - 0.97) * 100) +
  279. max(max(0.0, 0.03 - shadowCoordsNear.y) * 100, max(0.0, shadowCoordsNear.y - 0.97) * 100) +
  280. max(0.0, shadowCoordsNear.z - 0.98) * 100 +
  281. max(0.0, len / shadowRangeNear - 0.15)
  282. , 0.0, 1.0);
  283.  
  284. nearSub = shadowCoordsNear.w = clamp(1.0 - distanceNear, 0.0, 1.0);
  285. if (shadowCoordsNear.z >= 0.999) shadowCoordsNear.w = 0.0; // so no need to test both in fogandlight.fsh
  286.  
  287. #endif
  288.  
  289. #if SHADOWQUALITY > 0
  290. // Far map
  291. shadowCoordsFar = toShadowMapSpaceMatrixFar * worldPos;
  292.  
  293. float distanceFar = clamp(
  294. max(max(0.0, 0.03 - shadowCoordsFar.x) * 10, max(0.0, shadowCoordsFar.x - 0.97) * 10) +
  295. max(max(0.0, 0.03 - shadowCoordsFar.y) * 10, max(0.0, shadowCoordsFar.y - 0.97) * 10) +
  296. max(0.0, shadowCoordsFar.z - 0.98) * 10 +
  297. max(0.0, len / shadowRangeFar - 0.15)
  298. , 0.0, 1.0);
  299.  
  300. distanceFar = distanceFar * 2 - 0.5;
  301.  
  302. shadowCoordsFar.w = max(0.0, clamp(1.0 - distanceFar, 0.0, 1.0) - nearSub);
  303. if (shadowCoordsFar.z >= 0.999) shadowCoordsFar.w = 0.0; // so no need to test both in fogandlight.fsh
  304.  
  305.  
  306. #endif
  307. }
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315. #endif
  316.  
  317. //? #version 430
  318.  
  319. // https://github.com/opengl-tutorials/ogl/blob/master/tutorial16_shadowmaps/ShadowMapping.fragmentshader
  320.  
  321. vec2 poissonDisk[16] = vec2[](
  322. vec2( -0.94201624, -0.39906216 ),
  323. vec2( 0.94558609, -0.76890725 ),
  324. vec2( -0.094184101, -0.92938870 ),
  325. vec2( 0.34495938, 0.29387760 ),
  326. vec2( -0.91588581, 0.45771432 ),
  327. vec2( -0.81544232, -0.87912464 ),
  328. vec2( -0.38277543, 0.27676845 ),
  329. vec2( 0.97484398, 0.75648379 ),
  330. vec2( 0.44323325, -0.97511554 ),
  331. vec2( 0.53742981, -0.47373420 ),
  332. vec2( -0.26496911, -0.41893023 ),
  333. vec2( 0.79197514, 0.19090188 ),
  334. vec2( -0.24188840, 0.99706507 ),
  335. vec2( -0.81409955, 0.91437590 ),
  336. vec2( 0.19984126, 0.78641367 ),
  337. vec2( 0.14383161, -0.14100790 )
  338. );
  339.  
  340. // Returns a random number based on a vec3 and an int.
  341. float random(vec3 seed, int i){
  342. vec4 seed4 = vec4(seed,i);
  343. float dot_product = dot(seed4, vec4(12.9898,78.233,45.164,94.673));
  344. return fract(sin(dot_product) * 43758.5453);
  345. }
  346.  
  347. float StratifiedPoisson(vec4 ShadowCoord, sampler2DShadow shadowMap) {
  348. float b = 1.0;
  349.  
  350. float visibility=1.0;
  351.  
  352. // Fixed bias, or...
  353. float bias = 0.005;
  354.  
  355. // ...variable bias
  356. // float bias = 0.005*tan(acos(cosTheta));
  357. // bias = clamp(bias, 0,0.01);
  358.  
  359. // Sample the shadow map 4 times
  360. for (int i=0;i<4;i++){
  361. // use either :
  362. // - Always the same samples.
  363. // Gives a fixed pattern in the shadow, but no noise
  364. int index = i;
  365. // - A random sample, based on the pixel's screen location.
  366. // No banding, but the shadow moves with the camera, which looks weird.
  367. // int index = int(16.0*random(gl_FragCoord.xyy, i))%16;
  368. // - A random sample, based on the pixel's position in world space.
  369. // The position is rounded to the millimeter to avoid too much aliasing
  370. // int index = int(16.0*random(floor(Position_worldspace.xyz*1000.0), i))%16;
  371.  
  372. // being fully in the shadow will eat up 4*0.2 = 0.8
  373. // 0.2 potentially remain, which is quite dark.
  374. visibility -= 0.2*(1.0-texture( shadowMap, vec3(ShadowCoord.xy + poissonDisk[index]/700.0, (ShadowCoord.z-bias)/ShadowCoord.w) ));
  375. }
  376.  
  377. return b;
  378. }
  379.  
  380. float StratifiedPoisson(vec3 worldPos, vec4 ShadowCoord, sampler2DArrayShadow shadowMap) {
  381. float b=1.0;
  382.  
  383. float bias = 0.001;
  384. float shadow = 0.0;
  385. int samples = 8;
  386. for (int i = 0; i < samples; i++){
  387. //int index = i;
  388. int index = int(16.0 * random(floor(worldPos.xyz * 1000.0), i)) % 16;
  389.  
  390. vec2 offset = poissonDisk[index] / textureSize(shadowMap, 0).x;
  391. shadow += texture(shadowMap, vec4(ShadowCoord.xy + offset, ShadowCoord.z, ShadowCoord.w-bias)).r;
  392. }
  393. b = shadow / samples;
  394. return b;
  395. }
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402. layout(std140, binding = SHADOW_CASCADE_BINDING) uniform ShadowCascadeBlock
  403. {
  404. mat4[4] terrainShadowMatrixes;
  405. vec4 splitEdges;
  406. vec4 normalOffsetScales;
  407. vec4 sunDir;
  408. float terrainShadowsMax;
  409. int cascadeCount;
  410. int dontMixWithBaseShadows;
  411. } shadow_uniforms;
  412.  
  413. #ifdef DEFERBASE
  414.  
  415.  
  416. layout(binding=SHADOWMAPFARUNIT) uniform sampler2DShadow shadowMapFar;
  417. layout(binding=SHADOWMAPNEARUNIT) uniform sampler2DShadow shadowMapNear;
  418.  
  419. uniform float shadowMapWidthInv;
  420. uniform float shadowMapHeightInv;
  421.  
  422. // Adapted from fogandlight.fsh
  423. float getBrightnessFromShadowMap() {
  424. #if SHADOWQUALITY > 0
  425. float totalFar = 9.0;
  426. if (shadowCoordsFar.w > 0) {
  427. for (int x = -1; x <= 1; x++) {
  428. for (int y = -1; y <= 1; y++) {
  429. totalFar -= texture (shadowMapFar, vec3(shadowCoordsFar.xy + vec2(x * shadowMapWidthInv, y * shadowMapHeightInv), shadowCoordsFar.z - 0.0009));
  430. }
  431. }
  432. }
  433. totalFar /= 9.0;
  434.  
  435. #ifdef TERRAINSHADOWS
  436. // Don't fade outside edge here
  437. float shadow = shadowCoordsFar.w > 0 && shadowCoordsNear.w == 0 ? totalFar : totalFar * shadowCoordsFar.w;
  438. #else
  439. float shadow = totalFar * shadowCoordsFar.w;
  440. #endif
  441. #endif
  442.  
  443. #if SHADOWQUALITY > 1
  444. float totalNear = 9.0;
  445. if (shadowCoordsNear.w > 0) {
  446. for (int x = -1; x <= 1; x++) {
  447. for (int y = -1; y <= 1; y++) {
  448. totalNear -= texture (shadowMapNear, vec3(shadowCoordsNear.xy + vec2(x * shadowMapWidthInv, y * shadowMapHeightInv), shadowCoordsNear.z - 0.0005));
  449. }
  450. }
  451. }
  452. totalNear /= 9.0;
  453.  
  454. shadow += totalNear * shadowCoordsNear.w;
  455. #endif
  456.  
  457. #if SHADOWQUALITY > 0
  458. return 1 - shadow * 0.5;
  459. #endif
  460.  
  461. return 1.0;
  462. }
  463. #endif
  464.  
  465.  
  466. uniform bool terrainShadowsEnabled;
  467. uniform bool softTerrainShadows;
  468.  
  469. #ifdef COLORCASCADES
  470. uniform bool colorCascades;
  471. #endif
  472.  
  473. layout(binding=6) uniform sampler2DArrayShadow terrainShadowNear;
  474. layout(binding=7) uniform sampler2DArrayShadow terrainShadowFar;
  475.  
  476. float getTerrainShadowBrightness(vec3 worldPos, vec3 normal, float viewDepth) {
  477. float b = 1.0;
  478.  
  479. // Normal offset shadow biasing, based on https://github.com/godotengine/godot/issues/17260
  480. float cosLightAngle = dot(shadow_uniforms.sunDir.xyz, normal);
  481. float normalOffsetScale = clamp(1 - cosLightAngle, 0, 1);
  482.  
  483. int terrainShadowIdx = viewDepth <= shadow_uniforms.splitEdges[0]? 0
  484. : viewDepth <= shadow_uniforms.splitEdges[1]? 1
  485. : viewDepth <= shadow_uniforms.splitEdges[2]? 2
  486. : 3;
  487. terrainShadowIdx = min(terrainShadowIdx, shadow_uniforms.cascadeCount);
  488. #ifdef COLORCASCADES
  489. if(colorCascades) outColor = (terrainShadowIdx == 3 ? vec4(0.8,0.3,0.8,0) : terrainShadowIdx == 2 ? vec4(0.8,0.8,0,0) : terrainShadowIdx == 1 ? vec4(0.2,0.5,1,0) : vec4(0.9,0.1,0.5,0));
  490. #endif
  491.  
  492. vec4 terrainShadowPos = (shadow_uniforms.terrainShadowMatrixes[terrainShadowIdx] * vec4(worldPos, 1));
  493.  
  494. normalOffsetScale *= shadow_uniforms.normalOffsetScales[terrainShadowIdx];
  495. vec3 shadowOffset = normal.xyz * normalOffsetScale;
  496. vec2 offsetShadowPos = (shadow_uniforms.terrainShadowMatrixes[terrainShadowIdx] * vec4(worldPos + shadowOffset, 1)).xy;
  497.  
  498. terrainShadowPos.xy = offsetShadowPos.xy;
  499.  
  500. // Ignore if not on the texture
  501. vec2 onMap = step(vec2(0.0), terrainShadowPos.xy) * step(terrainShadowPos.xy, vec2(1.0));
  502. if(onMap.x * onMap.y == 0) return 1.0;
  503.  
  504. // sampler2DArrayShadow indexing is weird
  505. vec4 shadowPos = vec4(terrainShadowPos.xy, terrainShadowIdx % 2, terrainShadowPos.z);
  506.  
  507. if(softTerrainShadows) {
  508. if(terrainShadowIdx < 2)
  509. {
  510. b = StratifiedPoisson(worldPos, shadowPos, terrainShadowNear);
  511. } else {
  512. b = StratifiedPoisson(worldPos, shadowPos, terrainShadowFar);
  513. }
  514. } else {
  515. if(terrainShadowIdx < 2)
  516. {
  517. b = texture(terrainShadowNear, shadowPos);
  518. } else {
  519. b = texture(terrainShadowFar, shadowPos);
  520. }
  521. }
  522.  
  523. #ifndef DEFERBASE
  524. // Blend with edges of base game shadows
  525. float blendFactor = shadowCoordsFar.w;
  526. #if SHADOWQUALITY > 1
  527. blendFactor += shadowCoordsNear.w;
  528. #endif
  529. blendFactor *= shadow_uniforms.dontMixWithBaseShadows;
  530. if(blendFactor > 0.33) { b = 1 - (1 - b) * smoothstep(1.1, SHADOWQUALITY > 1 ? 0.15 : 0.6, blendFactor); }
  531. #endif
  532.  
  533. return max(b, shadow_uniforms.terrainShadowsMax);
  534. }
  535. uniform bool cloudshadowsEnabled;
  536. layout(binding=8) uniform sampler2D cloudShadowmap;
  537. uniform vec3 cloudspaceOrigin;
  538. uniform int cloudmapSize;
  539. uniform int cloudTileSize;
  540. uniform vec3 sunPosition;
  541. uniform int cloudShadowStyle;
  542. uniform float cloudShadowMax;
  543. uniform float cloudStart;
  544. uniform float cloudRange;
  545. uniform float cloudshadowK;
  546.  
  547. float getCloudShadowBrightness(vec3 worldPos) {
  548. float bCloud = 1.0;
  549. vec3 sunPosition = -shadow_uniforms.sunDir.xyz;
  550.  
  551. // Slide position in sun direction to intersect cloud plane
  552. vec3 toCloudPlane = abs(sunPosition.y) > 0.01? (cloudspaceOrigin.y - worldPos.y) * (sunPosition / sunPosition.y) : vec3(0);
  553. vec2 cloudmapPos = (worldPos.xz + toCloudPlane.xz) / cloudTileSize;
  554. cloudmapPos -= cloudspaceOrigin.xz;
  555. vec2 cloudmapUV = cloudmapPos / cloudmapSize;
  556.  
  557. vec2 onMap = step(vec2(0), cloudmapUV) * step(cloudmapUV, vec2(1));
  558. if(onMap.x * onMap.y > 0) {
  559. float cloudExpShadow = cloudShadowStyle == 0? texelFetch(cloudShadowmap, ivec2(cloudmapPos) * 4, 0).r : texture(cloudShadowmap, cloudmapUV).r;
  560.  
  561. float shadowmapDepth = clamp((sign(sunPosition.y) * length(toCloudPlane) / cloudTileSize + cloudStart) / cloudRange, 0, 1);
  562. bCloud = clamp(exp(-cloudshadowK*shadowmapDepth) * cloudExpShadow, 1 - cloudShadowMax, 1);
  563. }
  564. return bCloud;
  565. }
  566.  
  567.  
  568. void main() {
  569. vec4 viewPos = texelFetch(GPosition, ivec2(gl_FragCoord.xy), 0);
  570. if(viewPos.z == 0.0) discard;
  571. vec4 inColor = texelFetch(inColor, ivec2(gl_FragCoord.xy), 0);
  572. vec4 glowData = texelFetch(inGlow, ivec2(gl_FragCoord.xy), 0);
  573. vec4 gnormal = texelFetch(GNormal, ivec2(gl_FragCoord.xy), 0);
  574. vec3 normal = (invModelView * vec4(gnormal.xyz, 0)).xyz;
  575. vec4 worldPos = invModelView * vec4(viewPos.xyz, 1);
  576. float fogLevel = (viewPos.w - glowData.r) / 2;
  577.  
  578. float b = 1.0;
  579. #ifdef DEFERBASE
  580. calcShadowMapCoords(modelViewMtx, worldPos);
  581. b = min(b, getBrightnessFromShadowMap());
  582. #endif
  583.  
  584. if(terrainShadowsEnabled) {
  585. float terrainShadow = getTerrainShadowBrightness(worldPos.xyz, normal, -viewPos.z);
  586. b = mix(b, terrainShadow, smoothstep(0.8, 0.6, (shadowCoordsFar.w + shadowCoordsNear.w)));
  587. }
  588. #ifdef COLORCASCADES
  589. if(colorCascades) return;
  590. #endif
  591. if(cloudshadowsEnabled) b = min(b, getCloudShadowBrightness(worldPos.xyz));
  592.  
  593.  
  594. b = 1 - (1 - b) * shadowIntensity;
  595.  
  596. // The game adjusts brightness based on surface normal, so we need to account for it
  597. float intensity = 0.34 + (1 - shadowIntensity)/8.0;
  598. float nb = max(max(intensity, 0.5 + 0.5 * dot(normal, -shadow_uniforms.sunDir.xyz)), normal.y * 0.95);
  599. if(b > nb) discard;
  600. b = clamp(glowData.z + 1 - (1 - b) * nb * (1 - fogLevel), 0 ,1);
  601.  
  602. outColor = inColor * b;
  603. }
  604. (FormatException)
  605. 9.8.2026 08:41:18 [Error] Link error in shader program for pass deferredlighting: error: linking with uncompiled/unspecialized shader
  606. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass sleepoverlay.
  607. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass machinegear.
  608. 9.8.2026 08:41:18 [Notification] Started 99 systems on Client:
  609. 9.8.2026 08:41:18 [Notification] Mod 'VSEssentials.dll' (game):
  610. 9.8.2026 08:41:18 [Notification] Vintagestory.ServerMods.Core
  611. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.EntityPartitioning
  612. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ErrorReporter
  613. 9.8.2026 08:41:18 [Notification] Vintagestory.ServerMods.ModCompatiblityUtil
  614. 9.8.2026 08:41:18 [Notification] Vintagestory.ServerMods.NoObf.ModJsonPatchLoader
  615. 9.8.2026 08:41:18 [Notification] FluffyClouds.FluffyCloudsModSystem
  616. 9.8.2026 08:41:18 [Notification] Vintagestory.Systems.ModSystemTfEditFromAttributes
  617. 9.8.2026 08:41:18 [Notification] Vintagestory.ServerMods.GenMaps
  618. 9.8.2026 08:41:18 [Notification] Vintagestory.ServerMods.ModSystemWorldGenStructures
  619. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemRenderFallingBlocksFast
  620. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.FallingBlockParticlesModSystem
  621. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemItemRendererOptimizer
  622. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemFpHands
  623. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.CharacterExtraDialogs
  624. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.EntityNameTagRendererRegistry
  625. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemAmbientParticles
  626. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.EntityParticleSpawner
  627. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.EntityParticleSystem
  628. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.POIRegistry
  629. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemProgressBar
  630. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.RoomRegistry
  631. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.WeatherSystemCommands
  632. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.WeatherSystemClient
  633. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.SystemRemotePlayerTracking
  634. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.WorldMapManager
  635. 9.8.2026 08:41:18 [Notification] Vintagestory.ServerMods.LoadColorMaps
  636. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ClothManager
  637. 9.8.2026 08:41:18 [Notification] Mod 'VSSurvivalMod.dll' (survival):
  638. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemControlPoints
  639. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.SurvivalCoreSystem
  640. 9.8.2026 08:41:18 [Notification] Vintagestory.Systems.StoryLockableDoor
  641. 9.8.2026 08:41:18 [Notification] Vintagestory.Client.NoObf.StoryGenFailedSystem
  642. 9.8.2026 08:41:18 [Notification] Vintagestory.Client.NoObf.ModSystemBossHealthBars
  643. 9.8.2026 08:41:18 [Notification] Vintagestory.ServerMods.UpgradeTasks
  644. 9.8.2026 08:41:18 [Notification] Vintagestory.ServerMods.ModSystemDetailModeSync
  645. 9.8.2026 08:41:18 [Notification] Vintagestory.ServerMods.ModSystemTiledDungeons
  646. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.MSShapeFromAttrCacheHelper
  647. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.MyceliumSystem
  648. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemLabelMeshCache
  649. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemShapeFromAttributesTransform
  650. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemCatchCreature
  651. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.FishingSupportModSystem
  652. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemGliding
  653. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemMeasuringRope
  654. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemStopRaiseShieldAnim
  655. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemSnowShoveling
  656. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemSubTongsDurability
  657. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.Timeswitch
  658. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ScreenshakeToClientModSystem
  659. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.StoryStructuresSpawnConditions
  660. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemNPCHairStyling
  661. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemSkinnableAdditions
  662. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemVillagerDebug
  663. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemAuction
  664. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemBlockReinforcement
  665. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.Core
  666. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemBoatingSoundAndRatlineStamina
  667. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemShipConstructionSitePreview
  668. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.CharacterSystem
  669. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.MealMeshCache
  670. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.VariablesModSystem
  671. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModsystemElevator
  672. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ActivityModSystem
  673. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ActivityEditorSystem
  674. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemFarming
  675. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemCommandHandbook
  676. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemSurvivalHandbook
  677. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemTutorial
  678. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.HeldItemMouseInputHandler
  679. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemNightVision
  680. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.TobiasTeleporter
  681. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModJournal
  682. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.LiquidItemStackRenderer
  683. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemStructureLocator
  684. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModLootRandomizer
  685. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemChiselCommands
  686. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.MicroBlockModelCache
  687. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemEntityOwnership
  688. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemRifts
  689. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemRiftWeather
  690. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSleeping
  691. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemUnbreakSupportBeam
  692. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemSupportBeamPlacer
  693. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.TeleporterManager
  694. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModTemperature
  695. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.SystemTemporalStability
  696. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.TemporalStabilityEffects
  697. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemWearableStats
  698. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemEditableBook
  699. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.Mechanics.MechanicalPowerMod
  700. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.TradeHandbookInfo
  701. 9.8.2026 08:41:18 [Notification] Vintagestory.ServerMods.GenDevastationLayer
  702. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.RecipeRegistrySystem
  703. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemOreMap
  704. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemSnowballs
  705. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.HumanoidOutfits
  706. 9.8.2026 08:41:18 [Notification] Vintagestory.GameContent.ModSystemDevastationEffects
  707. 9.8.2026 08:41:18 [Notification] Mod 'VSCreativeMod.dll' (creative):
  708. 9.8.2026 08:41:18 [Notification] Vintagestory.ServerMods.Core
  709. 9.8.2026 08:41:18 [Notification] Vintagestory.ServerMods.WorldEdit.WorldEdit
  710. 9.8.2026 08:41:18 [Notification] Mod 'coriaendershaders-1.2.2-pre.4.zip' (coriaendershaders):
  711. 9.8.2026 08:41:18 [Notification] CoriaenderShaders.CoriaenderShaders.CoriaenderShadersModSystem
  712. 9.8.2026 08:41:18 [Notification] Loading shaders...
  713. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass standard.
  714. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass particlescube.
  715. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass particlesquad.
  716. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass sky.
  717. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass nightsky.
  718. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass woittest.
  719. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass transparentcompose.
  720. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass debugdepthbuffer.
  721. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass helditem.
  722. 9.8.2026 08:41:18 [Notification] Loaded Shaderprogramm for render pass chunkopaque.
  723. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass chunkliquid.
  724. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass decals.
  725. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass final.
  726. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass gui.
  727. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass blur.
  728. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass chunktransparent.
  729. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass findbright.
  730. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass chunktopsoil.
  731. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass godrays.
  732. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass autocamera.
  733. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass blockhighlights.
  734. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass wireframe.
  735. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass entityanimated.
  736. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass luma.
  737. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass blit.
  738. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass particlesquad2d.
  739. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass shadowmapentityanimated.
  740. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass chunkshadowmap.
  741. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass texture2texture.
  742. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass celestialobject.
  743. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass guitopsoil.
  744. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass colorgrade.
  745. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass guigear.
  746. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass ssao.
  747. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass bilateralblur.
  748. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass chunkliquiddepth.
  749. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass aurora.
  750. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass cloudmap.
  751. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass cloudvolumetric.
  752. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass instanced.
  753. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass lines.
  754. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass entityanimated.
  755. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass chunkshadowmap.
  756. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass standard.
  757. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass standard.
  758. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass entityanimated.
  759. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass particlescube.
  760. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass lines.
  761. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass aurora.
  762. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass watercompose.
  763. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass cameradepth.
  764. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass waternormals.
  765. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass screenspacereflections.
  766. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass cloudshadowmap.
  767. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass cloudshadowblur.
  768. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass cloudmapmip.
  769. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass drawvoxeldata.
  770. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass depthmipmap.
  771. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass depthmipmap.
  772. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass visibleculling.
  773. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass voxelcompaction.
  774. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass voxelcompaction.
  775. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass casterculling.
  776. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass drawvoxeldata.
  777. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogram for render pass depthmipmap.
  778. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass sleepoverlay.
  779. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass machinegear.
  780. 9.8.2026 08:41:19 [Notification] Reloaded shaders now with mod assets
  781. 9.8.2026 08:41:19 [Notification] Received level init
  782. 9.8.2026 08:41:19 [Notification] Loaded Shaderprogramm for render pass instanced.
  783. 9.8.2026 08:41:19 [Event] 26 traits loaded from 1 files
  784. 9.8.2026 08:41:19 [Event] 6 classes loaded from 1 files
  785. 9.8.2026 08:41:19 [Notification] Initialized Music Engine
  786. 9.8.2026 08:41:19 [Notification] Texture size is 32 so decal atlas size of 128x128 should suffice
  787. 9.8.2026 08:41:20 [Notification] Received level finalize
  788. 9.8.2026 08:41:20 [Notification] Loaded Shaderprogramm for render pass cloudmap.
  789. 9.8.2026 08:41:20 [Notification] Loaded Shaderprogramm for render pass cloudvolumetric.
  790. 9.8.2026 08:41:20 [Notification] Loaded Shaderprogramm for render pass clouds.
  791. 9.8.2026 08:41:20 [Notification] Loading world map cache db...
  792. 9.8.2026 08:41:20 [Warning] ===============================================================
  793. 9.8.2026 08:41:20 [Warning] (x_x) Captured 4 issues during startup:
  794. 9.8.2026 08:41:20 [Warning] [coriaendershaders] [CoriaenderShadersModSystem] Couldn't find VsImGui mod system, GUI will be unavailable.
  795. 9.8.2026 08:41:20 [Error] Shader compile error in deferredlighting 0:233(42): error: `shadowCoordsNear' undeclared
  796. 0:233(42): error: type mismatch
  797. 0:233(42): error: operands of `==' must have the same type
  798. 0:382(70): error: `shadowCoordsNear' undeclared
  799. 0:382(70): error: type mismatch
  800. 0:382(50): error: operands to arithmetic operators must be numeric
  801. 0:382(28): error: no matching function for call to `smoothstep(float, float, error)'; candidates are:
  802. 0:382(28): error: float smoothstep(float, float, float)
  803. 0:382(28): error: vec2 smoothstep(float, float, vec2)
  804. 0:382(28): error: vec3 smoothstep(float, float, vec3)
  805. 0:382(28): error: vec4 smoothstep(float, float, vec4)
  806. 0:382(28): error: vec2 smoothstep(vec2, vec2, vec2)
  807. 0:382(28): error: vec3 smoothstep(vec3, vec3, vec3)
  808. 0:382(28): error: vec4 smoothstep(vec4, vec4, vec4)
  809. 0:382(28): error: double smoothstep(double, double, double)
  810. 0:382(28): error: dvec2 smoothstep(double, double, dvec2)
  811. 0:382(28): error: dvec3 smoothstep(double, double, dvec3)
  812. 0:382(28): error: dvec4 smoothstep(double, double, dvec4)
  813. 0:382(28): error: dvec2 smoothstep(dvec2, dvec2, dvec2)
  814. 0:382(28): error: dvec3 smoothstep(dvec3, dvec3, dvec3)
  815. 0:382(28): error: dvec4 smoothstep(dvec4, dvec4, dvec4)
  816. 0:382(6): error: no matching function for call to `mix(float, float, error)'; candidates are:
  817. 0:382(6): error: float mix(float, float, float)
  818. 0:382(6): error: vec2 mix(vec2, vec2, float)
  819. 0:382(6): error: vec3 mix(vec3, vec3, float)
  820. 0:382(6): error: vec4 mix(vec4, vec4, float)
  821. 0:382(6): error: vec2 mix(vec2, vec2, vec2)
  822. 0:382(6): error: vec3 mix(vec3, vec3, vec3)
  823. 0:382(6): error: vec4 mix(vec4, vec4, vec4)
  824. 0:382(6): error: double mix(double, double, double)
  825. 0:382(6): error: dvec2 mix(dvec2, dvec2, double)
  826. 0:382(6): error: dvec3 mix(dvec3, dvec3, double)
  827. 0:382(6): error: dvec4 mix(dvec4, dvec4, double)
  828. 0:382(6): error: dvec2 mix(dvec2, dvec2, dvec2)
  829. 0:382(6): error: dvec3 mix(dvec3, dvec3, dvec3)
  830. 0:382(6): error: dvec4 mix(dvec4, dvec4, dvec4)
  831. 0:382(6): error: float mix(float, float, bool)
  832. 0:382(6): error: vec2 mix(vec2, vec2, bvec2)
  833. 0:382(6): error: vec3 mix(vec3, vec3, bvec3)
  834. 0:382(6): error: vec4 mix(vec4, vec4, bvec4)
  835. 0:382(6): error: double mix(double, double, bool)
  836. 0:382(6): error: dvec2 mix(dvec2, dvec2, bvec2)
  837. 0:382(6): error: dvec3 mix(dvec3, dvec3, bvec3)
  838. 0:382(6): error: dvec4 mix(dvec4, dvec4, bvec4)
  839. 9.8.2026 08:41:20 [Error] Couldn't write to log file, failed formatting #version 430
  840. #define FXAA 1
  841. #define SSAOLEVEL 1
  842. #define NORMALVIEW 0
  843. #define BLOOM 1
  844. #define GODRAYS 0
  845. #define FOAMEFFECT 1
  846. #define SHINYEFFECT 1
  847. #define SHADOWQUALITY 1
  848. #define DYNLIGHTS 25
  849. #define USEOIT 1
  850. #define TERRAINSHADOWS
  851. #define CLOUDSHADOWS
  852. #define INCOLORUNIT 0
  853. #define INGLOWUNIT 1
  854. #define GPOSITIONUNIT 2
  855. #define GNORMALUNIT 3
  856. #define SHADOW_CASCADE_BINDING 4
  857. #define DEFERBASE
  858. #define SHADOWMAPFARUNIT 4
  859. #define SHADOWMAPNEARUNIT 5
  860. #define INCLUDESHADOWCOORDS
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868. layout(location=0) out vec4 outColor;
  869.  
  870.  
  871.  
  872.  
  873.  
  874. layout(binding=INCOLORUNIT) uniform sampler2D inColor;
  875. layout(binding=INGLOWUNIT) uniform sampler2D inGlow;
  876. layout(binding=GPOSITIONUNIT) uniform sampler2D GPosition;
  877. layout(binding=GNORMALUNIT) uniform sampler2D GNormal;
  878.  
  879. in vec2 vUV;
  880. uniform mat4 invModelView;
  881. uniform float shadowIntensity;
  882.  
  883. #ifdef INCLUDESHADOWCOORDS
  884. uniform mat4 modelViewMtx;
  885.  
  886. #if SHADOWQUALITY > 0
  887. uniform float shadowRangeFar;
  888. uniform mat4 toShadowMapSpaceMatrixFar;
  889. vec4 shadowCoordsFar;
  890. #endif
  891. #if SHADOWQUALITY > 1
  892. uniform float shadowRangeNear;
  893. uniform mat4 toShadowMapSpaceMatrixNear;
  894. vec4 shadowCoordsNear;
  895. #endif
  896.  
  897.  
  898. const float transitionDistance = 10.0;
  899.  
  900.  
  901. void calcShadowMapCoords(mat4 modelviewMat, vec4 worldPos) {
  902. float nearSub = 0;
  903. #if SHADOWQUALITY > 0
  904. float len = length(worldPos);
  905. #endif
  906.  
  907. #if SHADOWQUALITY > 1
  908. // Near map
  909. shadowCoordsNear = toShadowMapSpaceMatrixNear * worldPos;
  910.  
  911. float distanceNear = clamp(
  912. max(max(0.0, 0.03 - shadowCoordsNear.x) * 100, max(0.0, shadowCoordsNear.x - 0.97) * 100) +
  913. max(max(0.0, 0.03 - shadowCoordsNear.y) * 100, max(0.0, shadowCoordsNear.y - 0.97) * 100) +
  914. max(0.0, shadowCoordsNear.z - 0.98) * 100 +
  915. max(0.0, len / shadowRangeNear - 0.15)
  916. , 0.0, 1.0);
  917.  
  918. nearSub = shadowCoordsNear.w = clamp(1.0 - distanceNear, 0.0, 1.0);
  919. if (shadowCoordsNear.z >= 0.999) shadowCoordsNear.w = 0.0; // so no need to test both in fogandlight.fsh
  920.  
  921. #endif
  922.  
  923. #if SHADOWQUALITY > 0
  924. // Far map
  925. shadowCoordsFar = toShadowMapSpaceMatrixFar * worldPos;
  926.  
  927. float distanceFar = clamp(
  928. max(max(0.0, 0.03 - shadowCoordsFar.x) * 10, max(0.0, shadowCoordsFar.x - 0.97) * 10) +
  929. max(max(0.0, 0.03 - shadowCoordsFar.y) * 10, max(0.0, shadowCoordsFar.y - 0.97) * 10) +
  930. max(0.0, shadowCoordsFar.z - 0.98) * 10 +
  931. max(0.0, len / shadowRangeFar - 0.15)
  932. , 0.0, 1.0);
  933.  
  934. distanceFar = distanceFar * 2 - 0.5;
  935.  
  936. shadowCoordsFar.w = max(0.0, clamp(1.0 - distanceFar, 0.0, 1.0) - nearSub);
  937. if (shadowCoordsFar.z >= 0.999) shadowCoordsFar.w = 0.0; // so no need to test both in fogandlight.fsh
  938.  
  939.  
  940. #endif
  941. }
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949. #endif
  950.  
  951. //? #version 430
  952.  
  953. // https://github.com/opengl-tutorials/ogl/blob/master/tutorial16_shadowmaps/ShadowMapping.fragmentshader
  954.  
  955. vec2 poissonDisk[16] = vec2[](
  956. vec2( -0.94201624, -0.39906216 ),
  957. vec2( 0.94558609, -0.76890725 ),
  958. vec2( -0.094184101, -0.92938870 ),
  959. vec2( 0.34495938, 0.29387760 ),
  960. vec2( -0.91588581, 0.45771432 ),
  961. vec2( -0.81544232, -0.87912464 ),
  962. vec2( -0.38277543, 0.27676845 ),
  963. vec2( 0.97484398, 0.75648379 ),
  964. vec2( 0.44323325, -0.97511554 ),
  965. vec2( 0.53742981, -0.47373420 ),
  966. vec2( -0.26496911, -0.41893023 ),
  967. vec2( 0.79197514, 0.19090188 ),
  968. vec2( -0.24188840, 0.99706507 ),
  969. vec2( -0.81409955, 0.91437590 ),
  970. vec2( 0.19984126, 0.78641367 ),
  971. vec2( 0.14383161, -0.14100790 )
  972. );
  973.  
  974. // Returns a random number based on a vec3 and an int.
  975. float random(vec3 seed, int i){
  976. vec4 seed4 = vec4(seed,i);
  977. float dot_product = dot(seed4, vec4(12.9898,78.233,45.164,94.673));
  978. return fract(sin(dot_product) * 43758.5453);
  979. }
  980.  
  981. float StratifiedPoisson(vec4 ShadowCoord, sampler2DShadow shadowMap) {
  982. float b = 1.0;
  983.  
  984. float visibility=1.0;
  985.  
  986. // Fixed bias, or...
  987. float bias = 0.005;
  988.  
  989. // ...variable bias
  990. // float bias = 0.005*tan(acos(cosTheta));
  991. // bias = clamp(bias, 0,0.01);
  992.  
  993. // Sample the shadow map 4 times
  994. for (int i=0;i<4;i++){
  995. // use either :
  996. // - Always the same samples.
  997. // Gives a fixed pattern in the shadow, but no noise
  998. int index = i;
  999. // - A random sample, based on the pixel's screen location.
  1000. // No banding, but the shadow moves with the camera, which looks weird.
  1001. // int index = int(16.0*random(gl_FragCoord.xyy, i))%16;
  1002. // - A random sample, based on the pixel's position in world space.
  1003. // The position is rounded to the millimeter to avoid too much aliasing
  1004. // int index = int(16.0*random(floor(Position_worldspace.xyz*1000.0), i))%16;
  1005.  
  1006. // being fully in the shadow will eat up 4*0.2 = 0.8
  1007. // 0.2 potentially remain, which is quite dark.
  1008. visibility -= 0.2*(1.0-texture( shadowMap, vec3(ShadowCoord.xy + poissonDisk[index]/700.0, (ShadowCoord.z-bias)/ShadowCoord.w) ));
  1009. }
  1010.  
  1011. return b;
  1012. }
  1013.  
  1014. float StratifiedPoisson(vec3 worldPos, vec4 ShadowCoord, sampler2DArrayShadow shadowMap) {
  1015. float b=1.0;
  1016.  
  1017. float bias = 0.001;
  1018. float shadow = 0.0;
  1019. int samples = 8;
  1020. for (int i = 0; i < samples; i++){
  1021. //int index = i;
  1022. int index = int(16.0 * random(floor(worldPos.xyz * 1000.0), i)) % 16;
  1023.  
  1024. vec2 offset = poissonDisk[index] / textureSize(shadowMap, 0).x;
  1025. shadow += texture(shadowMap, vec4(ShadowCoord.xy + offset, ShadowCoord.z, ShadowCoord.w-bias)).r;
  1026. }
  1027. b = shadow / samples;
  1028. return b;
  1029. }
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036. layout(std140, binding = SHADOW_CASCADE_BINDING) uniform ShadowCascadeBlock
  1037. {
  1038. mat4[4] terrainShadowMatrixes;
  1039. vec4 splitEdges;
  1040. vec4 normalOffsetScales;
  1041. vec4 sunDir;
  1042. float terrainShadowsMax;
  1043. int cascadeCount;
  1044. int dontMixWithBaseShadows;
  1045. } shadow_uniforms;
  1046.  
  1047. #ifdef DEFERBASE
  1048.  
  1049.  
  1050. layout(binding=SHADOWMAPFARUNIT) uniform sampler2DShadow shadowMapFar;
  1051. layout(binding=SHADOWMAPNEARUNIT) uniform sampler2DShadow shadowMapNear;
  1052.  
  1053. uniform float shadowMapWidthInv;
  1054. uniform float shadowMapHeightInv;
  1055.  
  1056. // Adapted from fogandlight.fsh
  1057. float getBrightnessFromShadowMap() {
  1058. #if SHADOWQUALITY > 0
  1059. float totalFar = 9.0;
  1060. if (shadowCoordsFar.w > 0) {
  1061. for (int x = -1; x <= 1; x++) {
  1062. for (int y = -1; y <= 1; y++) {
  1063. totalFar -= texture (shadowMapFar, vec3(shadowCoordsFar.xy + vec2(x * shadowMapWidthInv, y * shadowMapHeightInv), shadowCoordsFar.z - 0.0009));
  1064. }
  1065. }
  1066. }
  1067. totalFar /= 9.0;
  1068.  
  1069. #ifdef TERRAINSHADOWS
  1070. // Don't fade outside edge here
  1071. float shadow = shadowCoordsFar.w > 0 && shadowCoordsNear.w == 0 ? totalFar : totalFar * shadowCoordsFar.w;
  1072. #else
  1073. float shadow = totalFar * shadowCoordsFar.w;
  1074. #endif
  1075. #endif
  1076.  
  1077. #if SHADOWQUALITY > 1
  1078. float totalNear = 9.0;
  1079. if (shadowCoordsNear.w > 0) {
  1080. for (int x = -1; x <= 1; x++) {
  1081. for (int y = -1; y <= 1; y++) {
  1082. totalNear -= texture (shadowMapNear, vec3(shadowCoordsNear.xy + vec2(x * shadowMapWidthInv, y * shadowMapHeightInv), shadowCoordsNear.z - 0.0005));
  1083. }
  1084. }
  1085. }
  1086. totalNear /= 9.0;
  1087.  
  1088. shadow += totalNear * shadowCoordsNear.w;
  1089. #endif
  1090.  
  1091. #if SHADOWQUALITY > 0
  1092. return 1 - shadow * 0.5;
  1093. #endif
  1094.  
  1095. return 1.0;
  1096. }
  1097. #endif
  1098.  
  1099.  
  1100. uniform bool terrainShadowsEnabled;
  1101. uniform bool softTerrainShadows;
  1102.  
  1103. #ifdef COLORCASCADES
  1104. uniform bool colorCascades;
  1105. #endif
  1106.  
  1107. layout(binding=6) uniform sampler2DArrayShadow terrainShadowNear;
  1108. layout(binding=7) uniform sampler2DArrayShadow terrainShadowFar;
  1109.  
  1110. float getTerrainShadowBrightness(vec3 worldPos, vec3 normal, float viewDepth) {
  1111. float b = 1.0;
  1112.  
  1113. // Normal offset shadow biasing, based on https://github.com/godotengine/godot/issues/17260
  1114. float cosLightAngle = dot(shadow_uniforms.sunDir.xyz, normal);
  1115. float normalOffsetScale = clamp(1 - cosLightAngle, 0, 1);
  1116.  
  1117. int terrainShadowIdx = viewDepth <= shadow_uniforms.splitEdges[0]? 0
  1118. : viewDepth <= shadow_uniforms.splitEdges[1]? 1
  1119. : viewDepth <= shadow_uniforms.splitEdges[2]? 2
  1120. : 3;
  1121. terrainShadowIdx = min(terrainShadowIdx, shadow_uniforms.cascadeCount);
  1122. #ifdef COLORCASCADES
  1123. if(colorCascades) outColor = (terrainShadowIdx == 3 ? vec4(0.8,0.3,0.8,0) : terrainShadowIdx == 2 ? vec4(0.8,0.8,0,0) : terrainShadowIdx == 1 ? vec4(0.2,0.5,1,0) : vec4(0.9,0.1,0.5,0));
  1124. #endif
  1125.  
  1126. vec4 terrainShadowPos = (shadow_uniforms.terrainShadowMatrixes[terrainShadowIdx] * vec4(worldPos, 1));
  1127.  
  1128. normalOffsetScale *= shadow_uniforms.normalOffsetScales[terrainShadowIdx];
  1129. vec3 shadowOffset = normal.xyz * normalOffsetScale;
  1130. vec2 offsetShadowPos = (shadow_uniforms.terrainShadowMatrixes[terrainShadowIdx] * vec4(worldPos + shadowOffset, 1)).xy;
  1131.  
  1132. terrainShadowPos.xy = offsetShadowPos.xy;
  1133.  
  1134. // Ignore if not on the texture
  1135. vec2 onMap = step(vec2(0.0), terrainShadowPos.xy) * step(terrainShadowPos.xy, vec2(1.0));
  1136. if(onMap.x * onMap.y == 0) return 1.0;
  1137.  
  1138. // sampler2DArrayShadow indexing is weird
  1139. vec4 shadowPos = vec4(terrainShadowPos.xy, terrainShadowIdx % 2, terrainShadowPos.z);
  1140.  
  1141. if(softTerrainShadows) {
  1142. if(terrainShadowIdx < 2)
  1143. {
  1144. b = StratifiedPoisson(worldPos, shadowPos, terrainShadowNear);
  1145. } else {
  1146. b = StratifiedPoisson(worldPos, shadowPos, terrainShadowFar);
  1147. }
  1148. } else {
  1149. if(terrainShadowIdx < 2)
  1150. {
  1151. b = texture(terrainShadowNear, shadowPos);
  1152. } else {
  1153. b = texture(terrainShadowFar, shadowPos);
  1154. }
  1155. }
  1156.  
  1157. #ifndef DEFERBASE
  1158. // Blend with edges of base game shadows
  1159. float blendFactor = shadowCoordsFar.w;
  1160. #if SHADOWQUALITY > 1
  1161. blendFactor += shadowCoordsNear.w;
  1162. #endif
  1163. blendFactor *= shadow_uniforms.dontMixWithBaseShadows;
  1164. if(blendFactor > 0.33) { b = 1 - (1 - b) * smoothstep(1.1, SHADOWQUALITY > 1 ? 0.15 : 0.6, blendFactor); }
  1165. #endif
  1166.  
  1167. return max(b, shadow_uniforms.terrainShadowsMax);
  1168. }
  1169. uniform bool cloudshadowsEnabled;
  1170. layout(binding=8) uniform sampler2D cloudShadowmap;
  1171. uniform vec3 cloudspaceOrigin;
  1172. uniform int cloudmapSize;
  1173. uniform int cloudTileSize;
  1174. uniform vec3 sunPosition;
  1175. uniform int cloudShadowStyle;
  1176. uniform float cloudShadowMax;
  1177. uniform float cloudStart;
  1178. uniform float cloudRange;
  1179. uniform float cloudshadowK;
  1180.  
  1181. float getCloudShadowBrightness(vec3 worldPos) {
  1182. float bCloud = 1.0;
  1183. vec3 sunPosition = -shadow_uniforms.sunDir.xyz;
  1184.  
  1185. // Slide position in sun direction to intersect cloud plane
  1186. vec3 toCloudPlane = abs(sunPosition.y) > 0.01? (cloudspaceOrigin.y - worldPos.y) * (sunPosition / sunPosition.y) : vec3(0);
  1187. vec2 cloudmapPos = (worldPos.xz + toCloudPlane.xz) / cloudTileSize;
  1188. cloudmapPos -= cloudspaceOrigin.xz;
  1189. vec2 cloudmapUV = cloudmapPos / cloudmapSize;
  1190.  
  1191. vec2 onMap = step(vec2(0), cloudmapUV) * step(cloudmapUV, vec2(1));
  1192. if(onMap.x * onMap.y > 0) {
  1193. float cloudExpShadow = cloudShadowStyle == 0? texelFetch(cloudShadowmap, ivec2(cloudmapPos) * 4, 0).r : texture(cloudShadowmap, cloudmapUV).r;
  1194.  
  1195. float shadowmapDepth = clamp((sign(sunPosition.y) * length(toCloudPlane) / cloudTileSize + cloudStart) / cloudRange, 0, 1);
  1196. bCloud = clamp(exp(-cloudshadowK*shadowmapDepth) * cloudExpShadow, 1 - cloudShadowMax, 1);
  1197. }
  1198. return bCloud;
  1199. }
  1200.  
  1201.  
  1202. void main() {
  1203. vec4 viewPos = texelFetch(GPosition, ivec2(gl_FragCoord.xy), 0);
  1204. if(viewPos.z == 0.0) discard;
  1205. vec4 inColor = texelFetch(inColor, ivec2(gl_FragCoord.xy), 0);
  1206. vec4 glowData = texelFetch(inGlow, ivec2(gl_FragCoord.xy), 0);
  1207. vec4 gnormal = texelFetch(GNormal, ivec2(gl_FragCoord.xy), 0);
  1208. vec3 normal = (invModelView * vec4(gnormal.xyz, 0)).xyz;
  1209. vec4 worldPos = invModelView * vec4(viewPos.xyz, 1);
  1210. float fogLevel = (viewPos.w - glowData.r) / 2;
  1211.  
  1212. float b = 1.0;
  1213. #ifdef DEFERBASE
  1214. calcShadowMapCoords(modelViewMtx, worldPos);
  1215. b = min(b, getBrightnessFromShadowMap());
  1216. #endif
  1217.  
  1218. if(terrainShadowsEnabled) {
  1219. float terrainShadow = getTerrainShadowBrightness(worldPos.xyz, normal, -viewPos.z);
  1220. b = mix(b, terrainShadow, smoothstep(0.8, 0.6, (shadowCoordsFar.w + shadowCoordsNear.w)));
  1221. }
  1222. #ifdef COLORCASCADES
  1223. if(colorCascades) return;
  1224. #endif
  1225. if(cloudshadowsEnabled) b = min(b, getCloudShadowBrightness(worldPos.xyz));
  1226.  
  1227.  
  1228. b = 1 - (1 - b) * shadowIntensity;
  1229.  
  1230. // The game adjusts brightness based on surface normal, so we need to account for it
  1231. float intensity = 0.34 + (1 - shadowIntensity)/8.0;
  1232. float nb = max(max(intensity, 0.5 + 0.5 * dot(normal, -shadow_uniforms.sunDir.xyz)), normal.y * 0.95);
  1233. if(b > nb) discard;
  1234. b = clamp(glowData.z + 1 - (1 - b) * nb * (1 - fogLevel), 0 ,1);
  1235.  
  1236. outColor = inColor * b;
  1237. }
  1238. (FormatException)
  1239. 9.8.2026 08:41:20 [Error] Link error in shader program for pass deferredlighting: error: linking with uncompiled/unspecialized shader
  1240. 9.8.2026 08:41:20 [Warning] ===============================================================
  1241. 9.8.2026 08:41:20 [Notification] OpenAL Initialized. Available Mono/Stereo Sources: 255/1
  1242. 9.8.2026 08:41:20 [Fatal] Game Version: v1.22.6 (Stable)
  1243. 2026-08-09 8:41:20 a.m.: Critical error occurred in the following mod: [email protected]
  1244. System.AggregateException: One or more errors occurred. ([DeferredLightingProgram] Shader failed to compile:
  1245. Link error in shader program for pass deferredlighting: error: linking with uncompiled/unspecialized shader)
  1246. ---> CoriaenderShaders.CoriaenderShaders.ShaderCompileException: [DeferredLightingProgram] Shader failed to compile:
  1247. Link error in shader program for pass deferredlighting: error: linking with uncompiled/unspecialized shader
  1248. at CoriaenderShaders.ShaderPrograms.UniformQueueShaderProgram.Initialize() in Src:\ShaderPrograms\UniformQueueShaderProgram.cs:line 184
  1249. at CoriaenderShaders.Effects.DeferredShading.SetupShaders() in Src:\Effects\DeferredShading.cs:line 68
  1250. at CoriaenderShaders.Effects.EffectManager.SetupGLResources(GLResourceFlags flags) in Src:\Effects\EffectManager.cs:line 97
  1251. --- End of inner exception stack trace ---
  1252. at CoriaenderShaders.CoriaenderShaders.CoriaenderShadersModSystem.<SetupException>b__68_0() in Src:\CoriaenderShaders\CoriaenderShadersModSystem.cs:line 237
  1253. at CoriaenderShaders.Helpers.CoriaenderRenderer.<>c__DisplayClass27_0.<SetRenderMethod>b__0(Single f, EnumRenderStage s) in Src:\Helpers\CoriaenderRenderer.cs:line 51
  1254. at CoriaenderShaders.Helpers.CoriaenderRenderer.OnRenderFrame(Single deltaTime, EnumRenderStage stage) in Src:\Helpers\CoriaenderRenderer.cs:line 82
  1255. at Vintagestory.Client.NoObf.ClientEventManager.TriggerRenderStage(EnumRenderStage stage, Single dt) in VintagestoryLib\Client\Util\ClientEventManager.cs:line 257
  1256. at Vintagestory.Client.NoObf.ClientMain.TriggerRenderStage(EnumRenderStage stage, Single dt) in VintagestoryLib\Client\ClientMain.cs:line 858
  1257. at Vintagestory.Client.NoObf.ClientMain.MainRenderLoop(Single dt) in VintagestoryLib\Client\ClientMain.cs:line 910
  1258. at Vintagestory.Client.NoObf.ClientMain.MainGameLoop(Single deltaTime) in VintagestoryLib\Client\ClientMain.cs:line 782
  1259. at Vintagestory.Client.GuiScreenRunningGame.RenderToPrimary(Single dt) in VintagestoryLib\Client\MainMenu\Screens\GuiScreenRunningGame.cs:line 173
  1260. at Vintagestory.Client.ScreenManager.Render(Single dt) in VintagestoryLib\Client\ScreenManager.cs:line 742
  1261. at Vintagestory.Client.ScreenManager.OnNewFrame(Single dt) in VintagestoryLib\Client\ScreenManager.cs:line 686
  1262. at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame(FrameEventArgs e) in VintagestoryLib\Client\ClientPlatform\GameWindow.cs:line 112
  1263. at OpenTK.Windowing.Desktop.GameWindow.Run()
  1264. at Vintagestory.Client.ClientProgram.Start(ClientProgramArgs args, String[] rawArgs) in VintagestoryLib\Client\ClientProgram.cs:line 354
  1265. at Vintagestory.Client.ClientProgram.<>c__DisplayClass10_0.<.ctor>b__1() in VintagestoryLib\Client\ClientProgram.cs:line 131
  1266. at Vintagestory.ClientNative.CrashReporter.Start(ThreadStart start) in VintagestoryLib\Client\ClientPlatform\ClientNative\CrashReporter.cs:line 95
  1267. CoriaenderShaders.CoriaenderShaders.ShaderCompileException: [DeferredLightingProgram] Shader failed to compile:
  1268. Link error in shader program for pass deferredlighting: error: linking with uncompiled/unspecialized shader
  1269. at CoriaenderShaders.ShaderPrograms.UniformQueueShaderProgram.Initialize() in Src:\ShaderPrograms\UniformQueueShaderProgram.cs:line 184
  1270. at CoriaenderShaders.Effects.DeferredShading.SetupShaders() in Src:\Effects\DeferredShading.cs:line 68
  1271. at CoriaenderShaders.Effects.EffectManager.SetupGLResources(GLResourceFlags flags) in Src:\Effects\EffectManager.cs:line 97
  1272. Crash written to file at "/home/bran/.config/VSLInstallations/My-New-Installation/Logs/client-crash.log"
  1273.  
  1274. 9.8.2026 08:41:20 [Notification] Exiting game now. Server running=True. Exit reason: Game crashed
  1275. 9.8.2026 08:41:20 [Notification] Destroying game session, waiting up to 200ms for client threads to exit
  1276. 9.8.2026 08:41:21 [Notification] Stopping single player server
  1277. 9.8.2026 08:41:22 [Notification] Finished fully loading sounds (async)
  1278. 9.8.2026 08:41:22 [Notification] ChunkIntake threads completed gracefully.
  1279. 9.8.2026 08:41:22 [Notification] ChunkLoading threads completed gracefully.
  1280. 9.8.2026 08:41:22 [Notification] Exiting current game to main menu, reason: window close event
  1281.  
Advertisement
Add Comment
Please, Sign In to add comment