De-tile the water normal map - #1134
Open
Mikewando wants to merge 1 commit into
Open
Conversation
Replace the two single-tap normal samples with 3-tap triangle-grid stochastic detiling (Heitz & Neyret 2018), breaking the visible texture-repeat lattice that produced diagonal stripe aliasing in the distance. Cells anchor to unscrolled world UV while texture lookups carry the scrolled + flow-distorted UV, so animationFrame wraps shift within stable cells (continuous via GL_REPEAT) rather than jumping cell IDs (which otherwise produced a visible 28-second jolt at grazing angles). Per-cell offsets use pcg2d (Jarzynski & Olano 2020) for independently- mixed 2D output. The barycentric blend uses Heitz & Neyret's variance rescale to restore tilt magnitude lost to averaging tangent-space normals -- adapted without T/T-inverse LUTs since normal maps sit around a known analytical mean. Cost: 6 normal-map fetches per fragment (was 2).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current:


De-tiled:
Change was made with Claude. The normal map is sampled more times and there's a little more math but this doesn't have an impact I could really measure on my system so I didn't add a toggle, but seems straightforward to do so if there's a more measurable impact on weaker systems.