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

Fix: Decal 'Normal Fade' feature appears incorrect on scaled meshes #58153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

techiepriyansh
Copy link
Contributor

Fixes #56590.

Before:
image

After:
image

@techiepriyansh techiepriyansh requested a review from a team as a code owner February 15, 2022 17:50
@akien-mga akien-mga added this to the 4.0 milestone Feb 15, 2022
@akien-mga
Copy link
Member

This would need a rebase as the files moved. The code still seems to be the same as before this PR so the fix might still be relevant, though I'm not familiar enough with decals to assess whether #56590 is still reproducible (CC @Calinou).

@Calinou
Copy link
Member

Calinou commented Feb 13, 2023

The code still seems to be the same as before this PR so the fix might still be relevant, though I'm not familiar enough with decals to assess whether #56590 is still reproducible (CC @Calinou).

See #56590 (comment).

@clayjohn
Copy link
Member

While this fixes the bug, it also introduces a change in behaviour. normal_interp contains the geometric normal from the vertex function while normal contains the transformed normal from the user including the normal_map.

If we want to keep the current behaviour the same, we should normalize normal_interp. Everywhere else in the shader that normal_interp is used it is normalized first.

At any rate, we can merge this after 4.0. I would like to discuss whether it would be preferable to include normal maps in the normal fading behaviour.

@clayjohn clayjohn modified the milestones: 4.0, 4.1 Feb 14, 2023
@Calinou
Copy link
Member

Calinou commented Feb 14, 2023

I would like to discuss whether it would be preferable to include normal maps in the normal fading behaviour.

This is probably desired for decals made of "particles", such as patches of sand or snow that are sprinkled on top of another surface.

@clayjohn clayjohn modified the milestones: 4.1, 4.x May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vulkan: Decal 'Normal Fade' feature appears incorrect on scaled meshes
4 participants