Example 49 - hextile (Changes to fix regular tiling (tiling rate) to match hex tile rate) (#2924)

This commit is contained in:
blackhole 2022-09-16 13:48:19 -07:00 committed by GitHub
parent c0a7e838b3
commit 2b11045331
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 8 deletions

Binary file not shown.

View File

@ -196,19 +196,19 @@ void FetchColorAndWeight(out vec3 color, out vec3 weights, vec2 uv)
void main() void main()
{ {
// actual world space position
vec3 surfPosInWorld = v_position.xyz;
vec3 sp = GetTileRate() * surfPosInWorld;
vec2 uv0 = vec2(sp.x, sp.z);
if(u_useRegularTiling > 0.0) if(u_useRegularTiling > 0.0)
{ {
gl_FragColor = vec4(texture2D(s_trx_d, v_texcoord0.xy)); gl_FragColor = vec4(texture2D(s_trx_d, uv0.xy));
} }
else else
{ {
// actual world space position
vec3 surfPosInWorld = v_position.xyz;
vec3 sp = GetTileRate() * surfPosInWorld;
vec2 uv0 = vec2(sp.x, sp.z);
vec3 color, weights; vec3 color, weights;
FetchColorAndWeight(color, weights, uv0); FetchColorAndWeight(color, weights, uv0);