Skip to content

De-tile the water normal map - #1134

Open
Mikewando wants to merge 1 commit into
117HD:masterfrom
Mikewando:water-stochastic-detiling
Open

De-tile the water normal map#1134
Mikewando wants to merge 1 commit into
117HD:masterfrom
Mikewando:water-stochastic-detiling

Conversation

@Mikewando

Copy link
Copy Markdown

Current:
current
De-tiled:
detiled

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.

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).
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.

1 participant