Euphoria's Bug Fixes and Improvements for SEUS - Pastebin.com (2022)

  1. ### Euphoria's Bug Fixes and Improvements For Sonic Ethers Unbelievable Shaders (SEUS) ###

  2. This guide is based on SEUS 10.1 Ultra DOF. But will work for most versions of SEUS. If you are using a different version, the line numbers will mostly likely be slightly different, but you can easily press "Ctrl F" then search to find the correct lines. Simples :)

  3. ### Link to me on the Minecraftforums: http://www.minecraftforum.net/members/euphoria4949 ###

  4. This guide took me a long time to put together, testing and tweaking over and over and over... So please don't take credit for my work.

  5. If you used my guide and found it helpful, please share it so everyone can enjoy SEUS shaders.

  6. Please read carefully, and always use the brilliant and Free "Notepad++" to edit any files for any mod or game. Standard Microsoft Notepad will make it difficult for you to navigate.

  7. -----------------------------------------------------------------------------------------------------

  8. ##### CRASHING / LITTLE BOXES IN THE BOTTOM LEFT CORNER OF THE SCREEN / ERROR MESSAGES / BLACK SCREEN / #####

  9. -----------------------------------------------------------------------------------------------------

  10. LAPTOP AND NOTEBOOK USERS: (PC & MAC Guide below)

  11. -----------------------------------------------------------------------------------------------------

  12. Open your Nvidia or AMD Control Panel and set the "Preferred Graphics Processor" to Nvidia or AMD. (Not Auto or Intel)

  13. Do this "Globally", not just for Minecraft.exe.

  14. If you do not have either an Nvidia or AMD Control Panel then please read the guide below for: PC USERS.

  15. -----------------------------------------------------------------------------------------------------

  16. PC USERS: (MAC Guide below)

  17. -----------------------------------------------------------------------------------------------------

  18. The descriptions and instructions for this shader mod, that you were supposed to read "BEFORE" installing it, very clearly say:

  19. "You need a modern and very powerful Graphics Card to run a shader."

  20. "Intel HD Graphics are Not compatible with SEUS."

  21. If you are "Not" using Intel HD and "Do" have a proper dedicated Nvidia or AMD graphics card but you still get the black screen, crashing or errors, then please skip the next paragraph.

  22. Intel HD Graphics are not designed for modern high-end games because they are "Not" a Graphics Card, they are an "iGPU". This means it's a small part of your Processor/CPU that just "Acts" like (Pretends) to be a Graphics Card.

  23. Intel HD is extremely weak and has many issues due to buggy drivers and Intel's refusal to conform with industry standards. Intel HD is designed to give you enough graphical power to watch a movie, YouTube video or play a basic game like Candy Crush or Farmville on Facebook, not for running extremely complex and ultra demanding graphical applications, like shaders.

  24. Shaders like SEUS need more graphical power to run them, than it takes to run big AAA games like, GTA5, Fallout 4 or The Witcher 3 on Ultra settings!

  25. For people "Not" using Intel HD, one of the following is the cause of the issue:

  26. 1# - Your PC's graphics card is not powerful enough or is too old. The mods description clearly says you need a "Modern and very powerful graphics card"

  27. 2# - Your graphics card driver is out of date. Update it to the latest version from your manufactures website.

  28. 3# - The wrong or an out dated version of the GLSL Shader Core mod is installed.

  29. 4# - You have mod installed or a setting that is causing an incompatibility.

  30. Feel free to post on the SEUS thread if you want more info about whether your graphics card (Nvidia or AMD/ATI) is compatible.

  31. There are some very basic and low-end Shaders available on Minecraft.net forum that might work with old or low powered cards and Intel HD.

  32. -------------------------------------------------

  33. MAC USERS:

  34. -----------------------------------------------------------------------------------------------------

  35. If you had read the mods description you would have seen that it clearly says: "The author of SEUS Shader-pack has no access to a Mac, so is unable to provide Mac support"

  36. -----------------------------------------------------------------------------------------------------

  37. ##### LINES IN THE CLOUDS/SKY FIX #####

  38. -----------------------------------------------------------------------------------------------------

  39. Force Disable Anisotropic Filtering in your Nvidia or AMD Control Panel.

  40. -----------------------------------------------------------------------------------------------------

  41. ##### INVISIBLE RAIN AND SNOW FIX #####

  42. -----------------------------------------------------------------------------------------------------

  43. Open: "gbuffers_weather.fsh",

  44. Line 13:

  45. Delete: "discard;"

  46. -----------------------------------------------------------------------------------------------------

  47. ##### RAINING INSIDE COVER/THROUGH BLOCKS FIX #####

  48. -----------------------------------------------------------------------------------------------------

  49. Open: "gbuffers_weather.vsh",

  50. Delete everything on line 9

  51. -----------------------------------------------------------------------------------------------------

  52. ##### HOW TO ENABLE PUDDLES/WET GROUND AND SURFACES WHEN RAINING #####

  53. -----------------------------------------------------------------------------------------------------

  54. Open: "gbuffers_terrain.fsh",

  55. Change line 333 to this:

  56. spec.g += max(0.0f, clamp((wet * 1.0f + 0.2f), 0.0f, 1.0f) - (1.0f - w) * 1.0f);

  57. -----------------------------------------------------------------------------------------------------

  58. ##### ENHANCED FOG WHEN RAINING #####

  59. -----------------------------------------------------------------------------------------------------

  60. Open: "final.fsh"

  61. Line 621:

  62. Change "0.023f" to "0.066f" for best effect.

  63. -----------------------------------------------------------------------------------------------------

  64. ##### REDUCED SUN BRIGHTNESS (CORONA) #####

  65. -----------------------------------------------------------------------------------------------------

  66. Open: "composite.fsh"

  67. Line 1059,

  68. Change the entry "7.0f" to a lower number to reduce the suns corona brightness. (5.5f - 6.0f Seems good)

  69. -----------------------------------------------------------------------------------------------------

  70. ##### LIGHTING TWEAKS (INCREASE/DECREASE BRIGHTNESS) #####

  71. -----------------------------------------------------------------------------------------------------

  72. Open: "composite.fsh",

  73. All Lighting parameters start at line "2225",

  74. To reduce the brightness of a source, reduce the corresponding value,

  75. To increase the brightness, increase the value.

  76. + final.sunlight* 0.65f

  77. + final.skylight * 0.05f

  78. + final.nolight * 0.0005f

  79. + final.bouncedSunlight * 0.005f

  80. + final.scatteredSunlight * 0.02f

  81. + final.scatteredUpLight * 0.0015f

  82. + final.torchlight * 5.0f

  83. + final.glow.lava* 8.6f

  84. + final.glow.glowstone* 1.1f

  85. + final.glow.fire* 0.025f

  86. + final.glow.torch* 1.15f

  87. + final.heldLight * 0.05f

  88. -----------------------------------------------------------------------------------------------------

  89. ##### HOW TO ADD WAVING CARROTS, POTATOES & NETHER WART #####

  90. -----------------------------------------------------------------------------------------------------

  91. Open: "gbuffers_terrain.vsh",

  92. Add the following to lines 50, 51 and 52. Press enter to make room if you have to:

  93. Line 50: #define WAVING_CARROTS

  94. Line 51: #define WAVING_NETHER_WART

  95. Line 52: #define WAVING_POTATOES

  96. Now add the following to line 192. Again Press enter to make room if you have to:

    (Video) Obscure Demoknight TF2 Facts (And Bugs)

  97. Line 192, add: || mc_Entity.x == 115.0f //Nether Wart

  98. Now add the following to line 209. Again Press enter to make room if you have to:

  99. Line 209, add:

  100. //WAVING_CARROTS

  101. if (mc_Entity.x == 141.0) {

  102. materialIDs = max(materialIDs, 2.0f);

  103. waveCoeff = 1.0f;

  104. }

  105. //WAVING_POTATOES

  106. if (mc_Entity.x == 142.0) {

  107. materialIDs = max(materialIDs, 2.0f);

  108. waveCoeff = 1.0f;

  109. }

  110. *** END OF CODE *** DO NOT COPY THIS ***

  111. Now Open: "shadow.vsh"

  112. Add the following code to the "//Grass" section starting line 122:

  113. || mc_Entity.x == 141.0f //Carrots

  114. || mc_Entity.x == 115.0f //Nether Wart

  115. || mc_Entity.x == 142.0f //Potatoes

  116. -----------------------------------------------------------------------------------------------------

  117. ##### HOW TO ENABLE POM (PARALLAX OCCLUSION MAPPING - AKA 3D TEXTURES) #####

  118. -----------------------------------------------------------------------------------------------------

  119. WARNING! POM can be buggy and require a lot of tweaking for some people, depending on your PC hardware, drivers plus MC version, texture pack and mods installed.

  120. If you are not good with coding or don't have a lot of time and patience to learn it, do "NOT" enable POM.

  121. Open: "gbuffers_terrain.fsh",

  122. Line 24:

  123. Delete the // at the beginning of the line.

  124. -----------------------------------------------------------------------------------------------------

  125. ##### HOW TO ENABLE PARALLAX (3D) WATER AND INCREASE WAVE SIZE #####

  126. -----------------------------------------------------------------------------------------------------

  127. WARNING! POM (3D) Water can be extremely taxing on GPU power, do "NOT" enable it unless you have a very modern and powerful graphics card. Recommended minimum Nvidia GTX 680/770 or AMD 7970/R9-290.

  128. Open: "gbuffers_water.fsh",

  129. Line 293:

  130. Delete the // at the beginning of the line.

  131. Line 3: Increases the wave height, 0.30f or 0.35f for best effect.

  132. -----------------------------------------------------------------------------------------------------

  133. ##### INCREASE OR DECREASE THE AMOUNT OF MOTION BLUR #####

  134. -----------------------------------------------------------------------------------------------------

  135. Open: "final.fsh"

  136. Line 309:

  137. To increase the amount of blur, change "0.12f;" to any number up to a maximum of "0.60f;".

  138. -----------------------------------------------------------------------------------------------------

  139. ##### HOW TO ENABLE 3D VOLUMETRIC CLOUDS #####

  140. -----------------------------------------------------------------------------------------------------

  141. Open: "composite.fsh"

  142. Line 2256:

  143. Delete the "//" at the beginning of the line.

  144. -----------------------------------------------------------------------------------------------------

  145. ##### BETTER LOOKING AND OPTIMISED 3D VOLUMETRIC CLOUDS #####

  146. -----------------------------------------------------------------------------------------------------

  147. Open: "composite.fsh"

  148. Copy and Paste the follow code over Lines 1422 to 1915: (YOU MUST PASTE "OVER" THE ORIGINAL CODE, "DON'T" JUST ADD IT TO THE ORIGINAL CODE!):

  149. vec4 CloudColor(in vec4 worldPosition, in float sunglow, in vec3 worldLightVector)

  150. {

  151. float cloudHeight = 400.0f;

  152. float cloudDepth = 120.0f;

  153. float cloudUpperHeight = cloudHeight + (cloudDepth / 2.0f);

  154. float cloudLowerHeight = cloudHeight - (cloudDepth / 2.0f);

  155. if (worldPosition.y < cloudLowerHeight || worldPosition.y > cloudUpperHeight)

  156. return vec4(0.0f);

  157. else

  158. {

  159. vec3 p = worldPosition.xyz / 150.0f;

  160. float t = frameTimeCounter * 1.0f;

  161. //t *= 0.001;

  162. p.x -= t * 0.01f;

  163. // p += (Get3DNoise(p * 1.0f + vec3(0.0f, t * 0.01f, 0.0f)) * 2.0f - 1.0f) * 0.3f;

  164. vec3 p1 = p * vec3(1.0f, 0.5f, 1.0f) + vec3(0.0f, t * 0.01f, 0.0f);

  165. float noise = Get3DNoise(p * vec3(1.0f, 0.5f, 1.0f) + vec3(0.0f, t * 0.01f, 0.0f)); p *= 3.0f; p.x -= t * 0.057f; vec3 p2 = p;

  166. noise += (1.0f - abs(Get3DNoise(p) * 3.0f - 1.0f)) * 0.20f; p *= 3.0f; p.xz -= t * 0.05f; vec3 p3 = p;

  167. noise += (1.0f - abs(Get3DNoise(p) * 3.0f - 1.0f)) * 0.075f; p *= 3.0f; p.xz -= t * 0.05f;

  168. noise += (1.0f - abs(Get3DNoise(p) * 3.0f - 1.0f)) * 0.05f;

  169. noise /= 1.2f;

  170. const float lightOffset = 0.35f;

  171. float heightGradient = clamp(( - (cloudLowerHeight - worldPosition.y) / (cloudDepth * 1.0f)), 0.0f, 1.0f);

  172. float heightGradient2 = clamp(( - (cloudLowerHeight - (worldPosition.y + worldLightVector.y * lightOffset * 30.0f)) / (cloudDepth * 1.0f)), 0.0f, 1.0f);

  173. float cloudAltitudeWeight = 1.0f - clamp(distance(worldPosition.y, cloudHeight) / (cloudDepth / 2.0f), 0.0f, 1.0f);

  174. cloudAltitudeWeight = pow(cloudAltitudeWeight, mix(0.2f, 0.6f, rainStrength));

  175. cloudAltitudeWeight *= 1.0f - heightGradient;

  176. float cloudAltitudeWeight2 = 1.0f - clamp(distance(worldPosition.y + worldLightVector.y * lightOffset * 30.0f, cloudHeight) / (cloudDepth / 2.0f), 0.0f, 1.0f);

  177. cloudAltitudeWeight2 = pow(cloudAltitudeWeight2, mix(0.2f, 0.6f, rainStrength));

  178. cloudAltitudeWeight2 *= 1.0f - heightGradient2;

  179. noise *= cloudAltitudeWeight;

  180. //cloud edge

  181. float coverage = 0.8f;

  182. coverage = mix(coverage, 1.05f, rainStrength);

  183. float density = 0.65f;

  184. noise = clamp(noise - (1.0f - coverage), 0.0f, 1.0f - density) / (1.0f - density);

  185. //noise = GetCoverage(coverage, density, noise);

  186. //float sunProximity = pow(sunglow, 1.0f);

  187. //float propigation = mix(15.0f, 9.0f, sunProximity);

  188. // float directLightFalloff = pow(heightGradient, propigation);

  189. // directLightFalloff += pow(heightGradient, propigation / 2.0f);

  190. // directLightFalloff /= 2.0f;

  191. //float sundiff = -Get3DNoise(p1 + worldLightVector.xyz * lightOffset) * cloudAltitudeWeight2;

  192. //sundiff += -(1.0f - abs(Get3DNoise(p2 + worldLightVector.xyz * lightOffset) * 1.0f - 0.5f)) * 0.4f * cloudAltitudeWeight2;

    (Video) How To Get Any Car For FREE in Driving Empire!

  193. //sundiff += -(1.0f - abs(Get3DNoise(p3 + worldLightVector.xyz * lightOffset) * 3.0f - 1.0f)) * 0.035f * cloudAltitudeWeight2;

  194. float sundiff = Get3DNoise(p1 + worldLightVector.xyz * lightOffset);

  195. sundiff += (1.0f - abs(Get3DNoise(p2 + worldLightVector.xyz * lightOffset) * 1.0f - 0.5f)) * 0.4f;

  196. sundiff *= 1.1f;

  197. sundiff *= cloudAltitudeWeight2;

  198. //sundiff += (1.0f - abs(Get3DNoise(p3 + worldLightVector.xyz * lightOffset) * 3.0f - 1.0f)) * 0.075f * cloudAltitudeWeight2;

  199. sundiff = -GetCoverage(coverage * 1.0f, 0.0f, sundiff);

  200. float firstOrder = pow(clamp(sundiff * 1.0f + 1.15f, 0.0f, 1.0f), 56.0f);

  201. //firstOrder *= pow(clamp(1.3f - noise, 0.0f, 1.0f), 12.0f);

  202. float secondOrder = pow(clamp(sundiff * 1.0f + 1.1f, 0.0f, 1.0f), 11.0f);

  203. //directLightFalloff *= mix( clamp(pow(noise, 1.2f) * 1.0f, 0.0f, 1.0f), clamp(pow(1.0f - noise, 10.3f), 0.0f, 0.5f), pow(sunglow, 1.2f));

  204. float directLightFalloff = mix(firstOrder, secondOrder, 0.5f);

  205. //float directLightFalloff = firstOrder;

  206. float anisoBackFactor = mix(clamp(pow(noise, 1.6f) * 2.5f, 0.0f, 1.0f), 1.0f, pow(sunglow, 1.0f));

  207. directLightFalloff *= anisoBackFactor;

  208. directLightFalloff *= mix(11.5f, 1.0f, pow(sunglow, 0.5f));

  209. vec3 colorDirect = colorSunlight * 1.55f;

  210. colorDirect = mix(colorDirect, colorDirect * vec3(0.5f, 0.7f, 1.0f), timeMidnight);

  211. //colorDirect *= 1.0f + pow(sunglow, 10.0f) * 0.0f * pow(directLightFalloff, 1.0f);

  212. colorDirect *= 1.0f + pow(sunglow, 2.0f) * 100.0f * pow(directLightFalloff, 1.1f) * (1.0f - rainStrength);

  213. //colorDirect *= mix(1.0f, (clamp(pow(1.1f - noise, 50.09f) * 1.0f, 0.0f, 1.0f)) * 5.0f + 1.0f, pow(sunglow, 1.5f));

  214. vec3 colorAmbient = mix(colorSkylight, colorSunlight * 2.0f, vec3(heightGradient * 0.0f)) * 0.03f;

  215. //colorAmbient *= vec3(0.5f, 0.7f, 1.0f);

  216. colorAmbient *= mix(1.0f, 0.3f, timeMidnight);

  217. colorAmbient = mix(colorAmbient, colorAmbient * 3.0f + colorSunlight * 0.05f, vec3(clamp(pow(1.0f - noise, 12.0f) * 1.0f, 0.0f, 1.0f)));

  218. colorAmbient *= heightGradient * heightGradient + 0.1f;

  219. vec3 colorBounced = colorBouncedSunlight * 0.1f;

  220. colorBounced *= pow((1.0f - heightGradient), 8.0f);

  221. directLightFalloff *= 1.0f - rainStrength * 0.7f;

  222. // //cloud shadows

  223. // vec4 shadowPosition = shadowModelView * (worldPosition - vec4(cameraPosition, 0.0f));

  224. // shadowPosition = shadowProjection * shadowPosition;

  225. // shadowPosition /= shadowPosition.w;

  226. // float dist = sqrt(shadowPosition.x * shadowPosition.x + shadowPosition.y * shadowPosition.y);

  227. // float distortFactor = (1.0f - SHADOW_MAP_BIAS) + dist * SHADOW_MAP_BIAS;

  228. // shadowPosition.xy *= 1.0f / distortFactor;

  229. // shadowPosition = shadowPosition * 0.5f + 0.5f;

  230. // float sunlightVisibility = shadow2D(shadow, vec3(shadowPosition.st, shadowPosition.z)).x;

  231. // directLightFalloff *= sunlightVisibility;

  232. vec3 color = mix(colorAmbient, colorDirect, vec3(min(1.0f, directLightFalloff)));

  233. //color += colorBounced;

  234. //color = colorAmbient;

  235. //color = colorDirect * directLightFalloff;

  236. //color *= clamp(pow(noise, 0.1f), 0.0f, 1.0f);

  237. color *= 1.0f;

  238. //color *= mix(1.0f, 0.4f, timeMidnight);

  239. vec4 result = vec4(color.rgb, noise);

  240. return result;

  241. }

  242. }

  243. void CalculateClouds (inout vec3 color, inout SurfaceStruct surface)

  244. {

  245. //if (texcoord.s < 0.5f && texcoord.t < 0.5f)

  246. //{

  247. surface.cloudAlpha = 0.0f;

  248. vec2 coord = texcoord.st * 2.0f;

  249. vec4 worldPosition = gbufferModelViewInverse * surface.screenSpacePosition;

  250. worldPosition.xyz += cameraPosition.xyz;

  251. float cloudHeight = 100.0f;

  252. float cloudDepth = 400.0f;

  253. float cloudDensity = 1.0f;

  254. float startingRayDepth = far - 5.0f;

  255. float rayDepth = startingRayDepth;

  256. //rayDepth += CalculateDitherPattern1() * 0.09f;

  257. //rayDepth += texture2D(noisetex, texcoord.st * (viewWidth / noiseTextureResolution, viewHeight / noiseTextureResolution)).x * 0.1f;

  258. //rayDepth += CalculateDitherPattern2() * 0.1f;

  259. float rayIncrement = far / 11.0f;

  260. rayDepth += CalculateDitherPattern1() * rayIncrement;

  261. int i = 0;

  262. vec3 cloudColor = colorSunlight;

  263. vec4 cloudSum = vec4(0.0f);

  264. cloudSum.rgb = colorSkylight * 0.2f;

  265. cloudSum.rgb = color.rgb;

  266. float sunglow = CalculateSunglow(surface);

  267. float cloudDistanceMult = 500.0f / far;

  268. float surfaceDistance = length(worldPosition.xyz - cameraPosition.xyz);

  269. while (rayDepth > 0.0f)

  270. {

  271. //determine worldspace ray position

  272. vec4 rayPosition = GetCloudSpacePosition(texcoord.st, rayDepth, cloudDistanceMult);

  273. float rayDistance = length((rayPosition.xyz - cameraPosition.xyz) / cloudDistanceMult);

  274. vec4 proximity = CloudColor(rayPosition, sunglow, surface.worldLightVector);

  275. proximity.a *= cloudDensity;

  276. //proximity.a *= clamp(surfaceDistance - rayDistance, 0.0f, 1.0f);

  277. if (surfaceDistance < rayDistance * cloudDistanceMult && !surface.mask.sky)

  278. proximity.a = 0.0f;

  279. //cloudSum.rgb = mix( cloudSum.rgb, proximity.rgb, vec3(min(1.0f, proximity.a * cloudDensity)) );

  280. //cloudSum.a += proximity.a * cloudDensity;

  281. color.rgb = mix(color.rgb, proximity.rgb, vec3(min(1.0f, proximity.a * cloudDensity)));

  282. surface.cloudAlpha += proximity.a;

  283. //Increment ray

  284. rayDepth -= rayIncrement;

  285. i++;

  286. // if (rayDepth * cloudDistanceMult < ((cloudHeight - (cloudDepth * 0.5)) - cameraPosition.y))

  287. // {

  288. // break;

    (Video) how to fix This site can’t be reached, 5 different Solution

  289. // }

  290. }

  291. //color.rgb = mix(color.rgb, cloudSum.rgb, vec3(min(1.0f, cloudSum.a * 20.0f)));

  292. //color.rgb = cloudSum.rgb;

  293. }

  294. vec4 CloudColor(in vec4 worldPosition, in float sunglow, in vec3 worldLightVector, in float altitude, in float thickness)

  295. {

  296. float cloudHeight = altitude;

  297. float cloudDepth = thickness;

  298. float cloudUpperHeight = cloudHeight + (cloudDepth / 2.0f);

  299. float cloudLowerHeight = cloudHeight - (cloudDepth / 2.0f);

  300. worldPosition.xz /= 1.0f + max(0.0f, length(worldPosition.xz - cameraPosition.xz) / 3000.0f);

  301. vec3 p = worldPosition.xyz / 300.0f;

  302. float t = frameTimeCounter * 1.0f;

  303. //t *= 0.001;

  304. p.x -= t * 0.01f;

  305. p += (Get3DNoise(p * 1.0f + vec3(0.0f, t * 0.01f, 0.0f)) * 2.0f - 1.0f) * 0.3f;

  306. vec3 p1 = p * vec3(1.0f, 0.5f, 1.0f) + vec3(0.0f, t * 0.01f, 0.0f);

  307. float noise = Get3DNoise(p * vec3(1.0f, 0.5f, 1.0f) + vec3(0.0f, t * 0.01f, 0.0f)); p *= 2.0f; p.x -= t * 0.057f; vec3 p2 = p;

  308. noise += (1.0f - abs(Get3DNoise(p) * 1.0f - 0.5f)) * 0.15f; p *= 3.0f; p.xz -= t * 0.035f; vec3 p3 = p;

  309. noise += (1.0f - abs(Get3DNoise(p) * 3.0f - 0.0f)) * 0.045f; p *= 3.0f; p.xz -= t * 0.035f; vec3 p4 = p;

  310. noise += (1.0f - abs(Get3DNoise(p) * 3.0f - 0.0f)) * 0.015f; p *= 3.0f; p.xz -= t * 0.035f;

  311. noise += ((Get3DNoise(p))) * 0.015f; p *= 3.0f;

  312. noise += ((Get3DNoise(p))) * 0.006f;

  313. noise /= 1.175f;

  314. const float lightOffset = 0.2f;

  315. float heightGradient = clamp(( - (cloudLowerHeight - worldPosition.y) / (cloudDepth * 1.0f)), 0.0f, 1.0f);

  316. float heightGradient2 = clamp(( - (cloudLowerHeight - (worldPosition.y + worldLightVector.y * lightOffset * 50.0f)) / (cloudDepth * 1.0f)), 0.0f, 1.0f);

  317. float cloudAltitudeWeight = 1.0f;

  318. float cloudAltitudeWeight2 = 1.0f;

  319. noise *= cloudAltitudeWeight;

  320. //cloud edge

  321. float coverage = 0.39f;

  322. coverage = mix(coverage, 0.77f, rainStrength);

  323. float dist = length(worldPosition.xz - cameraPosition.xz);

  324. coverage *= max(0.0f, 1.0f - dist / 40000.0f);

  325. float density = 0.8f;

  326. noise = GetCoverage(coverage, density, noise);

  327. float sundiff = Get3DNoise(p1 + worldLightVector.xyz * lightOffset);

  328. sundiff += Get3DNoise(p2 + worldLightVector.xyz * lightOffset / 2.0f) * 0.15f;

  329. float largeSundiff = sundiff;

  330. largeSundiff = -GetCoverage(coverage, 0.0f, largeSundiff * 1.3f);

  331. sundiff += Get3DNoise(p3 + worldLightVector.xyz * lightOffset / 5.0f) * 0.045f;

  332. sundiff += Get3DNoise(p4 + worldLightVector.xyz * lightOffset / 8.0f) * 0.015f;

  333. sundiff *= 1.3f;

  334. sundiff *= cloudAltitudeWeight2;

  335. sundiff = -GetCoverage(coverage * 1.0f, 0.0f, sundiff);

  336. float firstOrder = pow(clamp(sundiff * 1.0f + 1.1f, 0.0f, 1.0f), 12.0f);

  337. float secondOrder = pow(clamp(largeSundiff * 1.0f + 0.9f, 0.0f, 1.0f), 3.0f);

  338. float directLightFalloff = mix(firstOrder, secondOrder, 0.1f);

  339. float anisoBackFactor = mix(clamp(pow(noise, 1.6f) * 2.5f, 0.0f, 1.0f), 1.0f, pow(sunglow, 1.0f));

  340. directLightFalloff *= anisoBackFactor;

  341. directLightFalloff *= mix(11.5f, 1.0f, pow(sunglow, 0.5f));

  342. vec3 colorDirect = colorSunlight * 0.815f;

  343. colorDirect = mix(colorDirect, colorDirect * vec3(0.2f, 0.5f, 1.0f), timeMidnight);

  344. colorDirect *= 1.0f + pow(sunglow, 2.0f) * 300.0f * pow(directLightFalloff, 1.1f) * (1.0f - rainStrength);

  345. vec3 colorAmbient = mix(colorSkylight, colorSunlight * 2.0f, vec3(heightGradient * 0.0f + 0.15f)) * 0.36f;

  346. colorAmbient *= mix(1.0f, 0.3f, timeMidnight);

  347. colorAmbient = mix(colorAmbient, colorAmbient * 3.0f + colorSunlight * 0.05f, vec3(clamp(pow(1.0f - noise, 12.0f) * 1.0f, 0.0f, 1.0f)));

  348. colorAmbient *= heightGradient * heightGradient + 0.1f;

  349. vec3 colorBounced = colorBouncedSunlight * 0.1f;

  350. colorBounced *= pow((1.0f - heightGradient), 8.0f);

  351. directLightFalloff *= 1.0f;

  352. //directLightFalloff += pow(Get3DNoise(p3), 2.0f) * 0.05f + pow(Get3DNoise(p4), 2.0f) * 0.015f;

  353. vec3 color = mix(colorAmbient, colorDirect, vec3(min(1.0f, directLightFalloff)));

  354. color *= 1.0f;

  355. vec4 result = vec4(color.rgb, noise);

  356. return result;

  357. }

  358. vec4 CloudColor2(in vec4 worldPosition, in float sunglow, in vec3 worldLightVector, in float altitude, in float thickness, const bool isShadowPass)

  359. {

  360. float cloudHeight = altitude;

  361. float cloudDepth = thickness;

  362. float cloudUpperHeight = cloudHeight + (cloudDepth / 2.0f);

  363. float cloudLowerHeight = cloudHeight - (cloudDepth / 2.0f);

  364. worldPosition.xz /= 1.0f + max(0.0f, length(worldPosition.xz - cameraPosition.xz) / 9001.0f);

  365. vec3 p = worldPosition.xyz / 75.0f;

  366. float t = frameTimeCounter * 1.0f;

  367. t *= 0.4;

  368. p += (Get3DNoise(p * 2.0f + vec3(0.0f, t * 0.01f, 0.0f)) * 2.0f - 1.0f) * 0.10f;

  369. p.x -= (Get3DNoise(p * 0.125f + vec3(0.0f, t * 0.01f, 0.0f)) * 2.0f - 1.0f) * 1.2f;

  370. // p.xz -= (Get3DNoise(p * 0.0525f + vec3(0.0f, t * 0.01f, 0.0f)) * 2.0f - 1.0f) * 1.7f;

  371. p.x *= 0.25f;

  372. p.x -= t * 0.01f;

  373. vec3 p1 = p * vec3(1.0f, 0.5f, 1.0f) + vec3(0.0f, t * 0.01f, 0.0f);

  374. float noise = Get3DNoise(p * vec3(1.0f, 0.5f, 1.0f) + vec3(0.0f, t * 0.01f, 0.0f)); p *= 2.0f; p.x -= t * 0.017f; p.z += noise * 1.35f; p.x += noise * 0.5f; vec3 p2 = p;

  375. noise += (2.0f - abs(Get3DNoise(p) * 2.0f - 0.0f)) * (0.25f); p *= 3.0f; p.xz -= t * 0.005f; p.z += noise * 1.35f; p.x += noise * 0.5f; p.x *= 3.0f; p.z *= 0.55f; vec3 p3 = p;

  376. p.z -= (Get3DNoise(p * 0.25f + vec3(0.0f, t * 0.01f, 0.0f)) * 2.0f - 1.0f) * 0.4f;

  377. noise += (3.0f - abs(Get3DNoise(p) * 3.0f - 0.0f)) * (0.035f); p *= 3.0f; p.xz -= t * 0.005f; vec3 p4 = p;

  378. noise += (3.0f - abs(Get3DNoise(p) * 3.0f - 0.0f)) * (0.025f); p *= 3.0f; p.xz -= t * 0.005f;

  379. if (!isShadowPass)

  380. {

  381. noise += ((Get3DNoise(p))) * (0.039f); p *= 3.0f;

  382. noise += ((Get3DNoise(p))) * (0.024f);

  383. }

  384. noise /= 1.575f;

    (Video) Rust | How To Increase FPS and Reduce Input Lag (Ultimate Rust FPS Increase Guide of 2021) *WORKING*

  385. //cloud edge

  386. float rainy = mix(wetness, 1.0f, rainStrength);

  387. //rainy = 0.0f;

  388. float coverage = 0.55f + rainy * 0.35f;

  389. //coverage = mix(coverage, 0.97f, rainStrength);

  390. float dist = length(worldPosition.xz - cameraPosition.xz);

  391. coverage *= max(0.0f, 1.0f - dist / mix(10000.0f, 3000.0f, rainStrength));

  392. float density = 0.0f;

  393. if (isShadowPass)

  394. {

  395. return vec4(GetCoverage(coverage + 0.2f, density + 0.2f, noise));

  396. }

  397. else

  398. {

  399. noise = GetCoverage(coverage, density, noise);

  400. noise = noise * noise * (3.0f - 2.0f * noise);

  401. const float lightOffset = 0.2f;

  402. float sundiff = Get3DNoise(p1 + worldLightVector.xyz * lightOffset);

  403. sundiff += (2.0f - abs(Get3DNoise(p2 + worldLightVector.xyz * lightOffset / 2.0f) * 2.0f - 0.0f)) * (0.55f);

  404. float largeSundiff = sundiff;

  405. largeSundiff = -GetCoverage(coverage, 0.0f, largeSundiff * 1.3f);

  406. sundiff += (3.0f - abs(Get3DNoise(p3 + worldLightVector.xyz * lightOffset / 5.0f) * 3.0f - 0.0f)) * (0.065f);

  407. sundiff += (3.0f - abs(Get3DNoise(p4 + worldLightVector.xyz * lightOffset / 8.0f) * 3.0f - 0.0f)) * (0.025f);

  408. sundiff /= 1.5f;

  409. sundiff = -GetCoverage(coverage * 1.0f, 0.0f, sundiff);

  410. float secondOrder = pow(clamp(sundiff * 1.00f + 1.35f, 0.0f, 1.0f), 7.0f);

  411. float firstOrder = pow(clamp(largeSundiff * 1.1f + 1.56f, 0.0f, 1.0f), 3.0f);

  412. float directLightFalloff = secondOrder;

  413. float anisoBackFactor = mix(clamp(pow(noise, 1.6f) * 2.5f, 0.0f, 1.0f), 1.0f, pow(sunglow, 1.0f));

  414. directLightFalloff *= anisoBackFactor;

  415. directLightFalloff *= mix(11.5f, 1.0f, pow(sunglow, 0.5f));

  416. vec3 colorDirect = colorSunlight * 0.915f;

  417. colorDirect = mix(colorDirect, colorDirect * vec3(0.2f, 0.5f, 1.0f), timeMidnight);

  418. colorDirect *= 1.0f + pow(sunglow, 2.0f) * 100.0f * pow(directLightFalloff, 1.1f) * (1.0f - rainStrength);

  419. // colorDirect *= 1.0f + pow(1.0f - sunglow, 2.0f) * 30.0f * pow(directLightFalloff, 1.1f) * (1.0f - rainStrength);

  420. vec3 colorAmbient = mix(colorSkylight, colorSunlight * 2.0f, vec3(0.15f)) * 0.04f;

  421. colorAmbient *= mix(1.0f, 0.3f, timeMidnight);

  422. colorAmbient *= mix(1.0f, ((1.0f - noise) + 0.5f) * 1.4f, rainStrength);

  423. // colorAmbient = mix(colorAmbient, colorAmbient * 3.0f + colorSunlight * 0.05f, vec3(clamp(pow(1.0f - noise, 12.0f) * 1.0f, 0.0f, 1.0f)));

  424. directLightFalloff *= 1.0f - rainStrength * 0.75f;

  425. //directLightFalloff += (pow(Get3DNoise(p3), 2.0f) * 0.5f + pow(Get3DNoise(p3 * 1.5f), 2.0f) * 0.25f) * 0.02f;

  426. //directLightFalloff *= Get3DNoise(p2);

  427. vec3 color = mix(colorAmbient, colorDirect, vec3(min(1.0f, directLightFalloff)));

  428. color *= 1.0f;

  429. // noise *= mix(1.0f, 5.0f, sunglow);

  430. vec4 result = vec4(color, noise);

  431. return result;

  432. }

  433. }

  434. void CloudPlane(inout SurfaceStruct surface)

  435. {

  436. //Initialize view ray

  437. vec4 worldVector = gbufferModelViewInverse * (-GetScreenSpacePosition(texcoord.st, 1.0f));

  438. surface.viewRay.dir = normalize(worldVector.xyz);

  439. surface.viewRay.origin = vec3(0.0f);

  440. float sunglow = CalculateSunglow(surface);

  441. float cloudsAltitude = 1200.0f;

  442. float cloudsThickness = 200.0f;

  443. float cloudsUpperLimit = cloudsAltitude + cloudsThickness * 0.5f;

  444. float cloudsLowerLimit = cloudsAltitude - cloudsThickness * 0.5f;

  445. float density = 1.0f;

  446. if (cameraPosition.y < cloudsLowerLimit)

  447. {

  448. float planeHeight = cloudsUpperLimit;

  449. float stepSize = 25.5f;

  450. planeHeight -= cloudsThickness * 0.85f;

  451. //planeHeight += CalculateDitherPattern1() * stepSize;

  452. //planeHeight += CalculateDitherPattern() * stepSize;

  453. //while(planeHeight > cloudsLowerLimit)

  454. ///{

  455. Plane pl;

  456. pl.origin = vec3(0.0f, cameraPosition.y - planeHeight, 0.0f);

  457. pl.normal = vec3(0.0f, 1.0f, 0.0f);

  458. Intersection i = RayPlaneIntersectionWorld(surface.viewRay, pl);

  459. if (i.angle < 0.0f)

  460. {

  461. if (i.distance < surface.linearDepth || surface.mask.sky)

  462. {

  463. vec4 cloudSample = CloudColor2(vec4(i.pos.xyz * 0.5f + vec3(30.0f), 1.0f), sunglow, surface.worldLightVector, cloudsAltitude, cloudsThickness, false);

  464. cloudSample.a = min(1.0f, cloudSample.a * density);

  465. surface.sky.albedo.rgb = mix(surface.sky.albedo.rgb, cloudSample.rgb, cloudSample.a);

  466. cloudSample = CloudColor2(vec4(i.pos.xyz * 0.65f + vec3(10.0f) + vec3(i.pos.z * 0.5f, 0.0f, 0.0f), 1.0f), sunglow, surface.worldLightVector, cloudsAltitude, cloudsThickness, false);

  467. cloudSample.a = min(1.0f, cloudSample.a * density);

  468. surface.sky.albedo.rgb = mix(surface.sky.albedo.rgb, cloudSample.rgb, cloudSample.a);

  469. }

  470. }

  471. }

  472. }

  473. ##### END OF CODE! DO "NOT" COPY THIS #####

  474. -----------------------------------------------------------------------------------------------------

  475. ##### OPTIONAL DISABLE 2D CLOUDS #####

  476. -----------------------------------------------------------------------------------------------------

  477. Open "composite1.fsh",

  478. Line 1234:

  479. Change that line to read this: //CloudPlane(surface);

  480. -----------------------------------------------------------------------------------------------------

    (Video) Before & After - High Resolution Texture Pack New DLC for Fallout 4 - Plus, Black Face Glitch Fix

  481. ##### END #####

  482. -----------------------------------------------------------------------------------------------------

Videos

1. Euphoria’s Alexa Demie Shares Her ’90s Glam Tutorial | Beauty Secrets | Vogue
(Vogue)
2. DayZ Expansion Custom Trader Setup Step by Step
(Twurtleee)
3. Al Sweigart Python Stream 2019/4/17
(Al Sweigart)
4. HOW TO UNLOCK EVERY MONSTER IN MONSTERS OF ETHERIA!
(Jamiy Jamie)
5. How I got 1,000,000 Free Credits on IMVU! Working 2022 Tutorial iOS/Android
(Mrr Nat Walker)
6. Things I Wish I Knew Before Playing Factorio (Tips And Tricks Tutorial)
(Trupen)

You might also like

Latest Posts

Article information

Author: Lidia Grady

Last Updated: 11/11/2022

Views: 5235

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Lidia Grady

Birthday: 1992-01-22

Address: Suite 493 356 Dale Fall, New Wanda, RI 52485

Phone: +29914464387516

Job: Customer Engineer

Hobby: Cryptography, Writing, Dowsing, Stand-up comedy, Calligraphy, Web surfing, Ghost hunting

Introduction: My name is Lidia Grady, I am a thankful, fine, glamorous, lucky, lively, pleasant, shiny person who loves writing and wants to share my knowledge and understanding with you.