Michael_J Posted March 26, 2014 Share Posted March 26, 2014 Could someone confirm this so we can find out if it's local or not, please? Using the tutorial found here (I'm using c++): http://www.leadwerks.com/werkspace/page/tutorials_legacy/_/making-a-first-person-camera-r15 To prepare, do two things: Comment out this line: window->HideMouse(); Add this line just before context->Sync(true): cout << Time::UPS() << endl; Compile and run. Do you notice two things--a spiking of the mouse pointer, and a drop in frame rate from 60 (vsync'ed) to about 30-ish as you rotate the camera? It seems to get worse as you rotate faster. It's very noticeable if you turn vsync off: context->Sync(false). For me, I go from the 300's with drops down into double digits. I've seen this type of thing before in engines, but only when video memory was being offloaded to system memory. I can't imagine this would be happening though for a scene with two textured boxes... What it does do though is make the character controller, in this example, very choppy when you look around... I don't care what the consensus is, I just need to know if it's a local issue or something that Josh may need to take a look at So, either way, thanks in advance for the confirmation. Quote --"There is no spoon" Link to comment Share on other sites More sharing options...
YouGroove Posted March 26, 2014 Share Posted March 26, 2014 In some performance test and LE3 FPS demo i got some 60-70 maximum pics, and in some places 30 FPS max, lights that even you don't see are drawn so perhaps you turn your camera in a direction it will draw more lights? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Michael_J Posted March 26, 2014 Author Share Posted March 26, 2014 In that tutorial there are no lights created. Sorry, I should have mentioned in my post that I tried disabling both lighting for the camera and physics for the world with no help. If this is not a local issue to me then hopefully there's some issue Josh can track down using this tutorial code that will help smooth things out. Hence, I need someone to confirm my findings.... Quote --"There is no spoon" Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 26, 2014 Share Posted March 26, 2014 I will try this tonight (2 to 4 hours from now). Which version are you using? Quote Link to comment Share on other sites More sharing options...
Michael_J Posted March 26, 2014 Author Share Posted March 26, 2014 Thanks Aggror. I'm using 3.1's c++ project template... Quote --"There is no spoon" Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 26, 2014 Share Posted March 26, 2014 I need to test out the C++ tutorials for 3.1 anyway so this is a good excuse to start with it. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 26, 2014 Share Posted March 26, 2014 Just tested with 3.1 for both run and debug, but everything works perfectly here. with vsync on I stay at 60 fps Quote Link to comment Share on other sites More sharing options...
Michael_J Posted March 26, 2014 Author Share Posted March 26, 2014 Let me guess, you're NOT running Windows 8.1, right? http://support.microsoft.com/kb/2908279 Supposedly Josh might be able to correct this on his end, but I don't know the details... Quote --"There is no spoon" Link to comment Share on other sites More sharing options...
shadmar Posted March 26, 2014 Share Posted March 26, 2014 8.1 here, it varys between 900 and 600 fps in debug mode, but it doesn't matter if I move the mouse or not. (seems to be the same) Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 26, 2014 Share Posted March 26, 2014 indeed: windows 7. Quote Link to comment Share on other sites More sharing options...
Michael_J Posted March 26, 2014 Author Share Posted March 26, 2014 Well, I'm not sure what precisely is causing it. I've tried both the latest AMD release and beta drivers (WARNING: for me, I got a noticeable pause every second in debug mode with the beta driver), and did some other suggestions I found to no avail. Actually, it was better when I had my video driver completely uninstalled, but that makes my triple-monitor setup useless... If anyone else runs across this, or something similar, please leave a comment. Thanks... Quote --"There is no spoon" Link to comment Share on other sites More sharing options...
Einlander Posted March 26, 2014 Share Posted March 26, 2014 I changed from dual 7770s to dual r7 260x's and my gfx performance has suffered in leadwerks. Its fine everywhere else. Also leadwerks will tend to stutter when a light goes into the view frustum, whether or not you see it. So I can make a room of lights and be a distance from it and not looking at it. When I turn around and look at the lights, I ca see in the debug screen that the lights are then being loaded for the first time. Over the next few months I think there will be some optimizations as the feature set gets finalized. 1 Quote Link to comment Share on other sites More sharing options...
Michael_J Posted March 29, 2014 Author Share Posted March 29, 2014 Some more info on this: this has NOTHING to do with the camera itself rotating. The FPS stuttering is a direct result of the mouse pointer being re-centered over and over (as is common practice for any sort of "mouse look". This is either an issue with my Radeon r9 290, or Windows 8.1 (both Microsoft and AMD have confirmed cases of stuttering when turning the camera, which again would use this method). So, the question now is what to do about it. I've tried re-centering the mouse on one frame and taking a difference reading on the next, but that didn't help. Obviously you have to recenter the mouse or eventually you'll hit a stop, so I'm not sure how else this could be managed in game code. Quote --"There is no spoon" Link to comment Share on other sites More sharing options...
YouGroove Posted March 29, 2014 Share Posted March 29, 2014 This is how works Leadwerks 3.1 FPS demo : mouse reading and recentring each frame. This is not whta can drop frame rate (i have frame rate drop even on TPS games protorypes) Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Michael_J Posted March 29, 2014 Author Share Posted March 29, 2014 I understand this is how it works on the 3.1 demo. I'm sure there may be other performance issues at the moment; but, this CAN drop frame rate briefly (micro-stutter) as verified by both MS and AMD (for various reasons). I tested my prog, as well as the tutorial above, on my other rig (Win 7 with nVidia) and all is well--FPS is stable when moving the mouse. I've confirmed this by locking the camera and moving the mouse--when the mouse is still the FPS are stable, when it moves they drop. I've done this with physics and camera lighting enabled and disabled--same result. Now, I've had 3 people tell me they have Win 8.1 and no problems, but I'm not sure (except in one case) what vid cards they have. My guess would be nVidia. Sometime this week I'll verify by moving my nVidia to this 8.1 rig and see what happens... Otherwise, there is something wrong with this rig, which could certainly be possible. Actually I'd prefer that because then it's an isolated case and doesn't reflect a deeper issue... The other possibility is the mouse is reflecting another issue in which case I'd still like to know what that issue is that seems to be machine-specific (based on my local test here)... Oh well--too busy to really worry about it right now Quote --"There is no spoon" Link to comment Share on other sites More sharing options...
tjheldna Posted March 29, 2014 Share Posted March 29, 2014 I was working on exactly the same thing last night creating a 3rd person camera. I had the same jittering that you describe when rotating. I was doing some testing and coming from that it seems that if you set the cameras rotation to the players rotation you get some nasty jittering. There is definitely something wrong going on here I think. Here is what I came up with that gave me good results. I have an interface manager that manages everything GUI This takes place every game loop to give me the mouses offset. Vec3 mousePosition = context->window->GetMousePosition(); if (mousePosition != mousePreviousPosition) { mouseDelta = mousePreviousPosition - mousePosition; } else { mouseDelta = 0.0F; } if ((cursor) && cursor->IsVisible()) { cursor->SetPosition(mousePosition.x, mousePosition.y); cursor->Render(); } else { context->window->SetMousePosition(context->GetWidth() / 2, context->GetHeight() / 2); mousePreviousPosition = context->window->GetMousePosition(); } In the player controller's update, and the yaw value is used in the characters SetInput() function for rotation. float cameraTopAngle = 45; float cameraBottomAngle = -45; yaw += TheInterface->GetMouseDelta().x / mouseSensitivity; pitch += TheInterface->GetMouseDelta().y / mouseSensitivity; //Adjust and set the camera rotation if (pitch > cameraTopAngle) pitch = cameraTopAngle; else if (pitch < cameraBottomAngle) pitch = cameraBottomAngle; My camera object Update if (GetCameraTarget()) { //GameObject *objectTarget = (GameObject*)TheGameWorld->FindObjectByAddress(Object::GetAddress(GetCameraTarget())); if (!TheMainWindow) { Vec3 lastPosition; BaseObject* object = (BaseObject*)GetCameraTarget()->GetUserData(); if (object->GetBaseType() == kObjectCharacter) { GameCharacter *character = static_cast<GameCharacter*>(object); if(character) { //Figure out new position //lastPosition = entity->GetPosition(); //Calculate the furthest TPS pivot position tpsPivot->SetPosition(GetCameraTarget()->GetPosition()); tpsPivot->Move(0.0F, GetHeight(), -GetCamDistance(), false); //Use a pick to determine where the camera should be PickInfo pick; Vec3 pickPos = GetCameraTarget()->GetPosition(); pickPos.y += GetHeight(); character->entity->SetPickMode(0); if (TheGameWorld->world->Pick(pickPos, tpsPivot->GetPosition(), pick, 0.0F, true)) { //Store distance float distance = tpsPivot->GetPosition().DistanceToPoint(pick.position); std::cout << distance << std::endl; tpsPivot->SetPosition(pick.position); } character->entity->SetPickMode(Entity::SpherePick); tpsPivot->SetRotation(GetCameraTarget()->GetRotation()); Vec3 rot = tpsPivot->GetRotation(); rot.y = -character->GetYaw(); rot.x = -character->GetPitch(); //Apply position lastPosition.x = Math::Curve(tpsPivot->GetPosition().x, entity->GetPosition().x, (GetSmoothness()) / Time::GetSpeed()); lastPosition.y = Math::Curve(tpsPivot->GetPosition().y, entity->GetPosition().y, (GetSmoothness()) / Time::GetSpeed()); lastPosition.z = Math::Curve(tpsPivot->GetPosition().z, entity->GetPosition().z, (GetSmoothness()) / Time::GetSpeed()); entity->SetRotation(rot); entity->SetPosition(lastPosition); } } } } The important thing to note is that the delta of the mouse movement is fed into the pitch and yaw variables which is accessed by the camera to set it's rotation opposed to camera->SetRotation(character->GetRotation()) (Although I would have thought the set rotation method should work). Obviously there are declarations which I haven't included above. I coded it in the early hours of last night and haven't looked at it since but hope it helps. Quote Link to comment Share on other sites More sharing options...
tjheldna Posted March 29, 2014 Share Posted March 29, 2014 Actually just looking at with fresher eyes today it's still not that smooth as it should be with the camera rotation. Quote Link to comment Share on other sites More sharing options...
Michael_J Posted May 17, 2014 Author Share Posted May 17, 2014 I DID find the cause of this and it's a very real issue for a lot of people. There's two reasons actually: The first is a virus that you can find in your processes list with the name stij.exe Removal is easy (one of many videos here: ) as long as you get all of it so it doesn't come back. MY issue though was Windows 8.1 and my high performance gaming mouse. As I understand it, M$ set the mouse poll rate down to 125 for Win8.1 from Win7's 1000. What this did was cause any high performance mouse with DPI's in the thousand's to basically "flood" the system with any fast motion inputs. In a small Le test app I went from 1000 UPS down to *2* (yes, two). You have three options here: 1) buy a cheap, low poll-rate mouse 2) set Win8.1's poll rate back up to 1000 through some method I wasn't 100% comfortable with. 3) If you're fortunate (as I was) your high performance mouse comes with software to allow you to lower the poll rate. My Logitech did. Setting it down to 500 helped. 250 helped even more, and at 125 everything is now as smooth as glass Anyway, I just wanted to report back on this to say that this wasn't an Le issue, but it is real and I wanted to pass on the info if anyone else has a similar problem. Thanks 2 Quote --"There is no spoon" Link to comment Share on other sites More sharing options...
Josh Posted May 17, 2014 Share Posted May 17, 2014 http://support.microsoft.com/kb/2908279 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Michael_J Posted May 17, 2014 Author Share Posted May 17, 2014 Yeah, I tried that fix and it didn't work for me (but at least it confirmed the issue ). Not saying it doesn't work, just didn't on my system... Quote --"There is no spoon" Link to comment Share on other sites More sharing options...
catch22 Posted May 17, 2014 Share Posted May 17, 2014 I'll also point out dumping to console is exceedingly slow, it will always cause a frame rate loss, especially if you're calling it every cycle. Best to put it on a 500ms timer or some such or draw it on your context in game. I doubt that's the center of your problem but it certainly will have an effect. Quote Coding for Christ. Link to comment Share on other sites More sharing options...
Michael_J Posted May 17, 2014 Author Share Posted May 17, 2014 Yeah, console writing will slow things down, but that's a steady, constant hit. This was absolutely system pauses when moving the mouse quickly. AMD also had an issue with this a year or so ago, but that was fixed with a driver update. Whatever, I'm just happy I found the problem, and also pretty happy it wasn't an issue with either my code nor with Le 3.1 Quote --"There is no spoon" Link to comment Share on other sites More sharing options...
tumira Posted December 18, 2016 Share Posted December 18, 2016 Not sure if I should bring back old topic. But is the mouse rotating around object stuttering is a known bug or fixed ? I get a strange stuttering when I try to rotate while looking at the stairs railing in the AI-Event demo. Windows 10 64Bit GTX970 My settings 1920x1080, msaa2, vsync=on,anisotropy filtering=16, fullscreen on. Funny thing is, I want to record and show this to Josh, when I turn on Shadowplay and try to record it, the stuttering when rotating is almost gone. But if I turn off recording, the stuttering is back. Quote Link to comment Share on other sites More sharing options...
nick.ace Posted December 18, 2016 Share Posted December 18, 2016 I doubt Shadowplay records at a variable framerate, so it probably drops to a lower framerate, so if you're getting around 45 FPS on the other thread you commented on, it samples at 30, and you don't get the stuttering you would normally get with V-sync enabled. Turn off V-Sync if you don't want that stuttering. Quote Link to comment Share on other sites More sharing options...
Josh Posted December 18, 2016 Share Posted December 18, 2016 It is possible there may be something to what you are saying, but if a problem exists, it also existed in 4.1 since I do not think anything I have done would have changed this. So it will be deferred until after the release of 4.2. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.