mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Example 49 - hextile (Changes to fix regular tiling (tiling rate) to match hex tile rate) (#2924)
This commit is contained in:
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()
|
||||
{
|
||||
// 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)
|
||||
{
|
||||
gl_FragColor = vec4(texture2D(s_trx_d, v_texcoord0.xy));
|
||||
gl_FragColor = vec4(texture2D(s_trx_d, uv0.xy));
|
||||
}
|
||||
else
|
||||
{
|
||||
// actual world space position
|
||||
vec3 surfPosInWorld = v_position.xyz;
|
||||
|
||||
vec3 sp = GetTileRate() * surfPosInWorld;
|
||||
|
||||
vec2 uv0 = vec2(sp.x, sp.z);
|
||||
|
||||
vec3 color, weights;
|
||||
FetchColorAndWeight(color, weights, uv0);
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user