-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify normal map sample, fix toy box normals.
Mirror the toy-box texture to fix the normals. Simplify the `box.ts` code. This was more complicated than it needed to be, and borrowed code from another project. This code also used vec3 methods with two-element vectors, which might cause issues with future versions of 'wgpu-matrix' Simplfiy `normalMap.wgsl` * Use `const` declarations to name the various modes instead of magic literals. * Calculate the `worldViewProj` and `worldView` matrices on the CPU and pass them in as part of the uniform buffer. Reduces duplicated work in the vertex shader, and reduces the amount of data needed to be passed in. * Use `vec3f` for the light position instead of scalar. Pass in the position in view-space. * Reduce the amount of data passed from vertex to fragment. * Rename `tbn` to `tangent`, `bitangent` and `normal`. * Remove unused function `when_greater` * Split `parallax_uv` into two functions. * Simplify steep-parallax loop. Pre-calculate the UV derivatives so we can break early from the loop. Rename 'diffuse' textures to 'albedo'. Technically a diffuse texture already has diffuse lighting applied. Fixed: #317
- Loading branch information
1 parent
b77d32c
commit d67ae2a
Showing
11 changed files
with
270 additions
and
538 deletions.
There are no files selected for viewing
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.