javiergcim / MakeUpUltraFast

High performance Minecraft shader (Java). For a graphical enhancement. Intended for low-spec computers.
GNU Lesser General Public License v3.0
97 stars 37 forks source link

Error in water reflection #32

Closed lijaesela closed 2 years ago

lijaesela commented 2 years ago

Objects in front of water will reflect onto it as if they were behind it, shown below with this block of granite.

2022-07-19_14 23 23

This is not only unrealistic but pretty confusing sometimes, especially walking by rivers in broad daylight. It happens a lot with leaves of trees.

lijaesela commented 2 years ago

I should clarify that this happens with or without Raymarching, although with Raymarching it doesn't happen at far distances. Still pretty jarring with leaves in rivers though.

javiergcim commented 2 years ago

It's not exactly a bug. These are inherent limitations of the technique used in the latest version.

These changes were introduced to correct other reflection issues that occur in other situations. Not all problems can be solved at once.

MakeUp uses a screen space reflection, to create the reflections. Which means you can't mirror something that isn't visible on the screen.

This will create terrible difficulties, because there are a lot of things that should be able to be reflected, but they are not visible on the screen. So there are a lot of "holes" to fill. The technique you use to fill in the gaps may have flaws or virtues.

Those "fake" reflections you see are a problem in some situations, but fix others in other circumstances. It is IMPOSSIBLE to do a correct mirroring for all situations with only the information on the screen. I know there are techniques that fill those "holes" better, but they require a higher sample count than MakeUp uses. And it is that low sample count that gives MakeUp its speed in all aspects (not just reflections)

As an example I will tell you that Complementary uses up to 30 samples per pixel in its reflections. MakeUp uses only 10. The third part. (Partly because of this MakeUp can DOUBLE the FPS that Complementary gives).

I myself have discovered that I don't really like the settings of the latest version, so I will find a middle ground between this and the previous one. But don't expect much (or anything).

The reflection that is not raymarching, I don't even take it into account. It is equivalent to turning the screen image upside down, to get a quick "mirror" with a single sample.

javiergcim commented 2 years ago

The latest version has some adjustments related to this issue. Hope they solve the problem for most of the cases.