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

Normalize vector in fragment shader #332

Merged
merged 1 commit into from
Nov 27, 2023
Merged

Normalize vector in fragment shader #332

merged 1 commit into from
Nov 27, 2023

Conversation

tyfkda
Copy link
Contributor

@tyfkda tyfkda commented Nov 24, 2023

The normal vector passed to the fragment shader is the interpolated value between the vertex normals,
and it should be normalized.

In the deferredRendering sample, the normal vector is written to the G-buffer and used in a later pass.
It looks like the texture sampled value are being used directly:
https://github.com/webgpu/webgpu-samples/blob/2d193cb2764c736f435ce748630fae5f29f7518d/src/sample/deferredRendering/fragmentDeferredRendering.wgsl#L55C7-L59

@austinEng austinEng requested a review from shrekshao November 27, 2023 17:36
@shrekshao shrekshao merged commit 78b9cc1 into webgpu:main Nov 27, 2023
1 check passed
@tyfkda tyfkda deleted the feature/normalize-normal branch November 28, 2023 00:55
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

Successfully merging this pull request may close these issues.

2 participants