Skip to content

Commit

Permalink
Fixes #314
Browse files Browse the repository at this point in the history
using fma() here avoids precision loss.
  • Loading branch information
Xtarsia authored and TokisanGames committed Aug 26, 2024
1 parent bb0a429 commit a57e128
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shaders/main.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void vertex() {
UV = round(v_vertex.xz * _mesh_vertex_density);

// UV coordinates in region space + texel offset. Values are 0 to 1 within regions
UV2 = (UV + vec2(0.5)) * _region_texel_size;
UV2 = fma(UV, vec2(_region_texel_size), vec2(0.5 * _region_texel_size));

// Discard vertices for Holes. 1 lookup
v_region = get_region_uv(UV);
Expand Down

0 comments on commit a57e128

Please sign in to comment.