Example 49 - hextile (Changes to fix regular tiling (tiling rate) to match hex tile rate) (#2924)
This commit is contained in:
parent
c0a7e838b3
commit
2b11045331
BIN
examples/49-hextile/fs_hextile.bin
Normal file
BIN
examples/49-hextile/fs_hextile.bin
Normal file
Binary file not shown.
@ -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);
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user