Hi
here is a simple code to demonstrate the issue.
On windows, it's ok, but when I use broadcast (to test on android) : I have the bug with the fog :
// Project: FogTest
// Created: 2018-03-09
// set window properties
SetWindowTitle( "FogTest" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
#CONSTANT KEY_LEFT GetRawKeyState(37)
#CONSTANT KEY_UP GetRawKeyState(38)
#CONSTANT KEY_RIGHT GetRawKeyState(39)
#CONSTANT KEY_DOWN GetRawKeyState(40)
SetFogRange(100,1500)
SetFogMode(1)
// the ground
g = CreateObjectPlane(2000,2000)
SetObjectRotation(g, 90,0,0)
//some elements
d = 800
u = 10
s = 10
For i=0 to 50
n= i+1
CreateObjectBox(n, u, u, u)
SetObjectScale(n,10,10,10)
SetObjectColor(n, 255, 0,0,255)
SetObjectPosition(n, random(0,d)-random(0,d), random(0,d)-random(0,d), random(0,d)-random(0,d))
Next i
SetCameraLookAt(1, 0,0,0,0)
SetCameraRange(1,1,10000)
MoveCameraLocalZ(1,-500)
do
if KEY_LEFT then MoveCameraLocalX(1, -10)
if KEY_RIGHT then MoveCameraLocalX(1, 10)
if KEY_DOWN then MoveCameraLocalZ(1, -10)
if KEY_UP then MoveCameraLocalZ(1, 10)
mouse_speed=5
if ( GetPointerPressed())
drag_start_x = GetPointerX()
drag_start_y = GetPointerY()
drag_ang_x = GetCameraAngleX(1)
drag_ang_y = GetCameraAngleY(1)
endif
diff_x as float
diff_y as float
new_x as float
if ( GetPointerState() = 1 )
diff_x = (GetPointerX() - drag_start_x)/1.0
diff_y = (GetPointerY() - drag_start_y)/1.0
new_x = drag_ang_x + diff_y
if ( new_x > 89 ) then new_x = 89
if ( new_x < -89 ) then new_x = -89
SetCameraRotation( 1, new_x, drag_ang_y + diff_x, 0 )
endif
if GetRawMouseWheelDelta()>0 then MoveCameraLocalZ(1, 10)
if GetRawMouseWheelDelta()<0 then MoveCameraLocalZ(1, -10)
Print( ScreenFPS() )
Sync()
loop
AGK2 tier1 - http://www.dracaena-studio.com