The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 94 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 573 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 573 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined variable $can_access_moderationqueue - Line: 752 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 752 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 892 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 892 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined variable $awaitingusers - Line: 34 - File: global.php(959) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(959) : eval()'d code 34 errorHandler->error
/global.php 959 eval
/showthread.php 28 require_once
Warning [2] Undefined array key "style" - Line: 1024 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 1024 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5308 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5308 errorHandler->error
/global.php 1024 build_theme_select
/showthread.php 28 require_once
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1429 fetch_forum_permissions
/showthread.php 103 forum_permissions
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key "mybb" - Line: 2121 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 2121 errorHandler->error
/inc/functions_indicators.php 41 my_set_array_cookie
/showthread.php 669 mark_thread_read
Warning [2] Undefined variable $postsdone - Line: 906 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 906 errorHandler->error
Warning [2] Undefined array key 14754 - Line: 912 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 912 errorHandler->error
Warning [2] Undefined array key 14755 - Line: 912 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 912 errorHandler->error
Warning [2] Undefined array key 14756 - Line: 912 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 912 errorHandler->error
Warning [2] Undefined array key 14757 - Line: 912 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 912 errorHandler->error
Warning [2] Undefined array key 14758 - Line: 912 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 912 errorHandler->error
Warning [2] Undefined array key 14759 - Line: 912 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 912 errorHandler->error
Warning [2] Undefined array key 14755 - Line: 1643 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1643 errorHandler->error
/showthread.php 1645 buildtree
/showthread.php 924 buildtree
Warning [2] Undefined array key 14756 - Line: 1643 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1643 errorHandler->error
/showthread.php 1645 buildtree
/showthread.php 924 buildtree
Warning [2] Undefined array key 14757 - Line: 1643 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1643 errorHandler->error
/showthread.php 1645 buildtree
/showthread.php 924 buildtree
Warning [2] Undefined array key 14758 - Line: 1643 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1643 errorHandler->error
/showthread.php 1645 buildtree
/showthread.php 924 buildtree
Warning [2] Undefined array key 14759 - Line: 1643 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1643 errorHandler->error
/showthread.php 1645 buildtree
/showthread.php 924 buildtree
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 925 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 925 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 925 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 925 build_postbit
Warning [2] Undefined array key "posttime" - Line: 9 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 9 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 925 build_postbit
Warning [2] Undefined array key "avatar_padding" - Line: 19 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 19 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 925 build_postbit
Warning [2] Undefined array key "invisible" - Line: 1568 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1568 errorHandler->error
Warning [2] Undefined variable $threadnotesbox - Line: 33 - File: showthread.php(1600) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 33 errorHandler->error
/showthread.php 1600 eval
Warning [2] Undefined variable $multipage - Line: 36 - File: showthread.php(1600) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 36 errorHandler->error
/showthread.php 1600 eval
Warning [2] Undefined variable $multipage - Line: 68 - File: showthread.php(1600) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 68 errorHandler->error
/showthread.php 1600 eval
Warning [2] Undefined variable $addremovesubscription - Line: 82 - File: showthread.php(1600) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 82 errorHandler->error
/showthread.php 1600 eval
Warning [2] Undefined variable $thread_deleted - Line: 104 - File: showthread.php(1600) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 104 errorHandler->error
/showthread.php 1600 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FPS fluctuations with GL2
07-06-2013, 09:43 AM, (This post was last modified: 07-06-2013, 09:55 AM by CrystalH.)
#5
RE: FPS fluctuations with GL2
Is it maybe because of VSync and particles ? Probably not.
Anyway a while ago I moved simulation to 2nd thread (but in Stunt Rally).
And I did it even so that both threads aren't even synchronized (no mutex lock). We used boost but I'm sure the SDL threads are ok too.
My main reason was to have more cpu time for graphics (draw calls are on cpu) and have graphics independent of simulation time (we have 160Hz on game thread, doesn't slow down because the game is gpu bound on drawing). We did get few fps more on graphics. I also had to separate the camera code.

Here is what I did.
I made a structure for car position data (can be just position and rotation for start).
Then a simple array of eg. 8 of those structs (can't use std::queue since its not thread safe)
also an int for current index (so graphics thread knows which data from array is last valid and meant for render).
In sim thread when new data is computed it is filled in next position in this array,
and then the index is increased. This operation is atomic, can be done from both threads without sync.

So just for reference, from OgreGame.h:
Code:
const int CarPosCnt = 8;  // size of poses queue
    // This list holds new positions info for every CarModel
    PosInfo carPoses[CarPosCnt][8];  // max 8 cars
    int iCurPoses[8];  // current index for carPoses queue
and in UpdatePoses.cpp, sim thread after tick, when new poses are available
Code:
        ///  store new pos info in queue  _________
            PosInfo pi;
            pi.bNew = true;  // new data
            // .... fill pos, rot, etc.

            int qn = (iCurPoses[c] + 1) % CarPosCnt;  // next index in queue
            carPoses[qn][c] = pi;
            //  update camera
            if (carM->fCam)
                carM->fCam->update(time, pi, &carPoses[qn][c], &pGame->collision);
            iCurPoses[c] = qn;  // atomic, set new index in queue
        }
and in graphics update just read the current index
Code:
    int q = iCurPoses[c];  // c is car index
    carM->Update(carPoses[q][c], time);
// and inside it just check if there are new positions available
    if (!posInfo.bNew)  return;  // new only
    posInfo.bNew = false;
Hope it helps anyhow.
Reply


Messages In This Thread
FPS fluctuations with GL2 - by NaN - 07-02-2013, 09:53 AM
RE: FPS fluctuations with GL2 - by NaN - 07-02-2013, 03:28 PM
RE: FPS fluctuations with GL2 - by Timo 6 - 07-02-2013, 04:06 PM
RE: FPS fluctuations with GL2 - by NaN - 07-02-2013, 04:16 PM
RE: FPS fluctuations with GL2 - by CrystalH - 07-06-2013, 09:43 AM
RE: FPS fluctuations with GL2 - by NaN - 07-09-2013, 08:50 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)