Slow down flight + extend corridor for longer tile residency
Camera speed was 0.45 units/sec which on 13km/tile tiles = ~5850 km/h = supersonic. User reported flying through tiles too fast. - drift speed 0.45 -> 0.12 units/sec (~1500 km/h, fast plane) - corridor 15 -> 25 tiles along travel (~3.5 min between refetches at uSpeed=1, instead of ~12 sec) - buffer 2 -> 3 tiles (refetch starts earlier so we always have tiles loaded before the camera reaches the edge) - Updated JS-side drift calculation to match the new shader speed Camera now leisurely follows the corridor; refetch only once every couple of minutes.
This commit is contained in:
1 parent
587c8f4a19
commit
425dbf4529
1 file changed
+4
-4
Vendored
+4
-4
@@ -136,7 +136,7 @@ var FRAG_SRC = [
|
|||||||
// Camera path: slow drift in X, cruising just above the cloud deck
|
// Camera path: slow drift in X, cruising just above the cloud deck
|
||||||
// like an airliner cockpit. No dives — we stay above so the
|
// like an airliner cockpit. No dives — we stay above so the
|
||||||
// deck is always visible below us.
|
// deck is always visible below us.
|
||||||
'float drift = uTime * uSpeed * 0.45;',
|
'float drift = uTime * uSpeed * 0.12;',
|
||||||
// Fixed altitude well above the cloud ceiling (y=1.5).
|
// Fixed altitude well above the cloud ceiling (y=1.5).
|
||||||
'float camY = 2.2;',
|
'float camY = 2.2;',
|
||||||
'vec3 ro = vec3(0.0, camY, drift);',
|
'vec3 ro = vec3(0.0, camY, drift);',
|
||||||
@@ -275,9 +275,9 @@ var GROUND_TILE_SIZE = 256;
|
|||||||
// The corridor is aligned with both motion and look direction.
|
// The corridor is aligned with both motion and look direction.
|
||||||
var GROUND_TRAVEL_COS = 0.0; // cos(90 deg)
|
var GROUND_TRAVEL_COS = 0.0; // cos(90 deg)
|
||||||
var GROUND_TRAVEL_SIN = 1.0; // sin(90 deg)
|
var GROUND_TRAVEL_SIN = 1.0; // sin(90 deg)
|
||||||
var GROUND_CORRIDOR_LONG = 15; // tiles along the travel direction
|
var GROUND_CORRIDOR_LONG = 25; // tiles along travel direction (~3.5 min of flight at uSpeed=1)
|
||||||
var GROUND_CORRIDOR_PERP = 5; // tiles perpendicular to travel
|
var GROUND_CORRIDOR_PERP = 5; // tiles perpendicular to travel
|
||||||
var GROUND_BUFFER_LONG = 2; // refetch when this close to forward edge
|
var GROUND_BUFFER_LONG = 3; // refetch when this close to forward edge
|
||||||
var GROUND_BUFFER_PERP = 1; // refetch when this close to side edge
|
var GROUND_BUFFER_PERP = 1; // refetch when this close to side edge
|
||||||
// Passau tile at zoom 11
|
// Passau tile at zoom 11
|
||||||
var GROUND_BASE_X = 1099;
|
var GROUND_BASE_X = 1099;
|
||||||
@@ -522,7 +522,7 @@ window.clouds3dRender = function(target) {
|
|||||||
gl.uniform2f(s.uGroundCenter, centerWorld.x, centerWorld.y);
|
gl.uniform2f(s.uGroundCenter, centerWorld.x, centerWorld.y);
|
||||||
gl.uniform2f(s.uGroundSize, GROUND_CORRIDOR_LONG, GROUND_CORRIDOR_PERP);
|
gl.uniform2f(s.uGroundSize, GROUND_CORRIDOR_LONG, GROUND_CORRIDOR_PERP);
|
||||||
|
|
||||||
var drift = now * speed * 0.45;
|
var drift = now * speed * 0.12;
|
||||||
if (performance.now() - groundLastCheck > 1500) {
|
if (performance.now() - groundLastCheck > 1500) {
|
||||||
groundLastCheck = performance.now();
|
groundLastCheck = performance.now();
|
||||||
maybeRefetchGround(drift, drift * 0.7, gl);
|
maybeRefetchGround(drift, drift * 0.7, gl);
|
||||||
|
|||||||
Reference in new issue
Block a user