Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect vertex normal for terrain #2554

Open
GeForceLegend opened this issue Dec 4, 2024 · 0 comments
Open

Incorrect vertex normal for terrain #2554

GeForceLegend opened this issue Dec 4, 2024 · 0 comments

Comments

@GeForceLegend
Copy link

What happened?

Iris is using unsigned normalized octahedron decoding for vertex normal. To get exact vertex normal for common surfaces, it needs the input be 0.0 and 0.5. But in vertex attributes, Iris is using RGBA8_SNORM and even throw values between [-1.0, 0.0) away, and 0.5 will be about 0.496 in vertex attribute. This will create obvious artifact in some situation, like this image using ComplementaryReimagined_r5.2.2, because of the incorrect normal, left part is reflecting things under water:

Image

As Iris is using RGBA8_SNORM as vertex attribute format, why not just using the full [-1.0, 1.0] range, and removing * 2.0 + 1.0 in the beginning of octahedron decoding code? RGBA8_SNORM can get 0.0 correctly (works same as 0.5 in current solution), which means we will get exact normal data on common surfaces.

Screenshots

No response

Log output

No response

Minecraft Version

Minecraft 1.21.3

Iris Version

iris-fabric-1.8.1+mc1.21.3.jar

Operating System

Windows 10

What is your GPU?

NVIDIA GeForce RTX 4070

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant