====== Scripts > Sapphire debug v2 ====== ^ Description | A script to test the different rendering modules in Sapphire and log the frame render times. | ^ Author | Aaron | ^ Created | 2014/09/10 | ^ Requires | L3DT v11.11 or later | ^ Download | {{:scripts:sapphire debug v2.zs|sapphire_debug_v2.zs}} | ===== About ===== This script is included with L3DT v14.09 or later. Prior releases of L3DT included an older version of this script, which did not include frame render time logging. ===== Script contents ===== // // Declare variables // bool TempBool hvar pHF pWM pTX int cnt int cntmax set cntmax 10 int Start End difftime // // Test maps // set pHF set pWM set pTX assert > "Heightfield is not initialised!" echo "Sapphire debug v2" echo >>> echo "m">> float minalt maxalt assert "Cannot get heightfield min/max altitude!" echo >>> if echo >>> endif // // disable all modules (e.g. textures, lighting, fog) // set TempBool false Sapphire.SetParam "Skybox.IsShown" TempBool Sapphire.SetParam "Terrain.DetailMap.IsShown" TempBool Sapphire.SetParam "Terrain.ElevLUT.EnableFlag" TempBool Sapphire.SetParam "WaterMap.IsShown" TempBool Sapphire.SetParam "Atmosphere.FogEnabled" TempBool Sapphire.SetParam "Lighting.EnableFlag" TempBool Sapphire.SetParam "UI.CursorMesh.IsShown" TempBool // // Test with all options disabled // MessageBox "Starting test 1: all disabled" 64 echo "Starting test 1: all disabled" Sapphire.SetPause true Sapphire.ShowWndEx pHF pWM pTX 8 set cnt 0 do set Start Sapphire.RenderFrame 0 set End set difftime echo >>> while cntmax> Sapphire.SetPause false MessageBox "Closing test 1: all disabled" 64 Sapphire.HideWnd // // Test elev LUT // MessageBox "Starting test 2: ElevLUT" 64 echo "Starting test 2: ElevLUT" Sapphire.SetPause true set TempBool true Sapphire.SetParam "Terrain.ElevLUT.EnableFlag" TempBool Sapphire.ShowWndEx pHF pWM pTX 8 set cnt 0 do set Start Sapphire.RenderFrame 0 set End set difftime echo >>> while cntmax> Sapphire.SetPause false MessageBox "Closing test 2: ElevLUT" 64 Sapphire.HideWnd //set TempBool false //Sapphire.SetParam "Terrain.ElevLUT.EnableFlag" TempBool // // Test lighting map // MessageBox "Starting test 3: lighting" 64 echo "Starting test 3: lighting" Sapphire.SetPause true set TempBool true Sapphire.SetParam "Lighting.EnableFlag" TempBool Sapphire.ShowWndEx pHF pWM pTX 8 set cnt 0 do set Start Sapphire.RenderFrame 0 set End set difftime echo >>> while cntmax> Sapphire.SetPause false MessageBox "Closing test 3: lighting" 64 Sapphire.HideWnd //set TempBool false //Sapphire.SetParam "Lighting.EnableFlag" TempBool // // Test fog // MessageBox "Starting test 4: fog" 64 echo "Starting test 4: fog" Sapphire.SetPause true set TempBool true Sapphire.SetParam "Atmosphere.FogEnabled" TempBool Sapphire.ShowWndEx pHF pWM pTX 8 set cnt 0 do set Start Sapphire.RenderFrame 0 set End set difftime echo >>> while cntmax> Sapphire.SetPause false MessageBox "Closing test 4: fog" 64 Sapphire.HideWnd //set TempBool false //Sapphire.SetParam "Atmosphere.FogEnabled" TempBool // // Test skybox // MessageBox "Starting test 5: skybox" 64 echo "Starting test 5: skybox" Sapphire.SetPause true set TempBool true Sapphire.SetParam "Skybox.IsShown" TempBool Sapphire.ShowWndEx pHF pWM pTX 8 set cnt 0 do set Start Sapphire.RenderFrame 0 set End set difftime echo >>> while cntmax> Sapphire.SetPause false MessageBox "Closing test 5: skybox" 64 Sapphire.HideWnd //set TempBool false //Sapphire.SetParam "Skybox.IsShown" TempBool // // Test terrain texture // if > MessageBox "Starting test 6: terrain texture" 64 echo "Starting test 6: terrain texture" Sapphire.SetPause true Sapphire.ShowWndEx pHF pWM pTX 16 set cnt 0 do set Start Sapphire.RenderFrame 0 set End set difftime echo >>> while cntmax> Sapphire.SetPause false MessageBox "Closing test 6: terrain texture" 64 Sapphire.HideWnd else MessageBox "Skipping test 6: terrain texture (no texture map)" 64 endif // // Test detail map // MessageBox "Starting test 7: detail map" 64 echo "Starting test 7: detail map" Sapphire.SetPause true set TempBool true Sapphire.SetParam "Terrain.DetailMap.IsShown" TempBool Sapphire.ShowWndEx pHF pWM pTX 16 set cnt 0 do set Start Sapphire.RenderFrame 0 set End set difftime echo >>> while cntmax> Sapphire.SetPause false MessageBox "Closing test 7: detail map" 64 Sapphire.HideWnd //set TempBool false //Sapphire.SetParam "Terrain.DetailMap.IsShown" TempBool // // Test water map // if > MessageBox "Starting test 8: water texture" 64 echo "Starting test 8: water texture" Sapphire.SetPause true set TempBool true Sapphire.SetParam "WaterMap.IsShown" TempBool Sapphire.ShowWndEx pHF pWM pTX 16 set cnt 0 do set Start Sapphire.RenderFrame 0 set End set difftime echo >>> while cntmax> Sapphire.SetPause false MessageBox "Closing test 8: water texture" 64 Sapphire.HideWnd // set TempBool false // Sapphire.SetParam "WaterMap.IsShown" TempBool else MessageBox "Skipping test 8: water texture (no water map)" 64 endif // // Test mesh object // MessageBox "Starting test 9: cursor mesh" 64 echo "Starting test 9: cursor mesh" Sapphire.SetPause true set TempBool true Sapphire.SetParam "UI.CursorMesh.IsShown" TempBool Sapphire.ShowWndEx pHF pWM pTX 16 set cnt 0 do set Start Sapphire.RenderFrame 0 set End set difftime echo >>> while cntmax> Sapphire.SetPause false MessageBox "Closing test 9: cursor mesh" 64 Sapphire.HideWnd //set TempBool false //Sapphire.SetParam "UI.CursorMesh.IsShown" TempBool // // all together now // MessageBox "Starting test 10: all modules" 64 echo "Starting test 10: all modules" Sapphire.SetPause true set TempBool true Sapphire.SetParam "Skybox.IsShown" TempBool Sapphire.SetParam "Terrain.DetailMap.IsShown" TempBool Sapphire.SetParam "Terrain.ElevLUT.EnableFlag" TempBool Sapphire.SetParam "WaterMap.IsShown" TempBool Sapphire.SetParam "Atmosphere.FogEnabled" TempBool Sapphire.SetParam "Lighting.EnableFlag" TempBool Sapphire.SetParam "UI.CursorMesh.IsShown" TempBool Sapphire.ShowWndEx pHF pWM pTX 16 set cnt 0 do set Start Sapphire.RenderFrame 0 set End set difftime echo >>> while 20> Sapphire.SetPause false MessageBox "Closing test 10: all modules" 64 Sapphire.HideWnd MessageBox "All modules OK!" 64 return true