Skip to content

MahoganyTown/Water-Shader-Alpha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Water Shader Alpha

Water Shader Picture

Introducing Water Shader Alpha for Minecraft 1.21!

This shader is a complete rewrite of the old Water Shader Mod developed by Necrowizzard and later updated by Superbomb17 up to version 1.6.2 of Minecraft. The shader was a standalone mod for Minecraft Beta and Alpha versions. The shader used planar reflection to compute the reflection color on flat water patches. Most Minecraft shaders use screen space reflections (SSR) to compute reflections because of its ease of implementation in a deferred shading pipeline (Iris & Optifine). Instead, this shader uses planar reflection to reproduce the behavior of the original mod and to address the shortcomings of SSR. In addition, the original water shader was a mod incompatible with Optifine and Iris. This work brings the mod to the land of shaderpacks supported by Iris. This makes the shader much simpler to install and to use. The shader is still in alpha version, so expect bugs, inconsistencies, and slow performance especially near large water areas and depending on your hardware.

Comparison

This shaderpack is more stable than the original mod which contained many bugs like: inconsistent lighting, flickering reflections, holes in water, crash of the game, white horizon artifact, transluscency artifacts, underwater bugs, and slow water updates. The new shaderpack is now robust to these issues and supports up to four simultaneous water heights for planar reflection. On the flip side, this shaderpack does not support particles, clouds, and star reflections on the water. Transparent geometry is omitted in the reflection texture for a lack of realism.

Implementation

This shaderpack uses the shadow pass to compute the reflection texture for all water heights. The shadow geometry shader duplicates the scene for each detected water height and computes the reflection according to each water patch. The refraction and reflection textures are then mixed together to produce the final image. An additional process runs to detect which water patch is more important to prioritize reflection calculations on bigger water patches over smaller ones. This work is carried out by two compute shaders in the composite pass.

Installation

  • Download the lastest version of the shader
  • Open .minecraft/shaderpacks folder
  • Drag and drop the Water Shader Alpha.zip in shaderpacks

FAQ

Why update the Water Shader Mod? The Water Shader Mod was particularly important to me when I played Minecraft as a kid. I loved it and wanted to update this shader to bring it to Minecraft's newer versions.

Why is the Water Shader Iris-only? Iris provides very useful features and gives additional controls and options to shader developers that Optifine do not support.

What is the number of simulataneous planes in the settings? Planar reflection only allows to compute reflections for only one water height (plane height). Because Minecraft worlds can have multiple water patches at various heights, planar reflection fails to accurately compute reflections for all water patches. Thus, many iterations of the algorithm must run to compute reflections for each water patch. This process is expensive and decreases performance. For best performance, use one water plane. In my tests, two planes cover most scenarios.

Is MacOS supported? No, because Apple decided to deprecate OpenGL. There is no way to run this shader on a mac computer unfortunately.

Can I use your code in my shader projects? Yes, of course!

Features

  • Planar reflection
  • Multiple water planes (up to 4)
  • Automatic large water patch prioritization
  • Distortion effects
  • See-through water
  • Better underwater fog
  • Better transluscency
  • Better sky & reflection on water
  • Necrowizzard & Superbomb17 styles
  • Sun & moon reflection in water (experimental)
  • Vanilla lighting

Liminations

  • Clouds, stars, and particles not reflected
  • Performance bottleneck in shadow geometry shader
  • MacOS not supported
  • OpenGL 4.3 required

Links

Credits

I would like to thank Coolq1000 for his help and advice. This shader would not have existed without his help. I would also like to thank the shaderLABS discord community for their help.

About

Water Shader Mod compatible with Iris and Minecraft 1.20+

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published