![]() Keep in mind, the faster we get the framerate, the more effects that can be added. In a game as fast as Xonotic, that's important. Having your framerate at 45 and having it drop to 20 breaks flow, but having your framerate at 100 and having it drop to 60 does not. That's not a good thing, optimization(especially LOD which I one of my priorities) frees them to create better looking maps. Also, at the current moment, most mappers are limited by the number of realtime lights, models, and reflections they can put in a map. On the other hand, if you shoot for 120fps, the lowest will be 30fps, far more manageable. If the target is 60fps, then the lowest rate under worst conditions will probably be around 15fps. At least, I believe this was true with Nexuiz.įor realz though, part of the issue comes from inconsistencies in the framerate. Information is updated twice as fast(better sniper shots ). Waiting for your thoughts.I've heard that the difference between 60fps and 120fps is the double mouse polling rate. Thank you, if you need some additional details please let me know. The problem is in this Image control, arrangement of such instance is heavy for some reason, but why a Profiler doesn't tell anything about it? Could I miss something important with Image instance creation? If yes, what can I try to solve this problem? So a very interesting thing for me is that if replace this Image control with some Rectangle any other simple control the lock at 30fps disappear and I have a smooth 60fps during scroll animation. UpdateFrameworkElement(imageControl, imageSize, new Rect(imageSize)) Size imageSize = new Size(image.Width, image.Height) ImageControl.CacheMode = new BitmapCache() ImageControl.Effect = new .DropShadowEffect() RenderOptions.SetBitmapScalingMode(imageControl, BitmapScalingMode.NearestNeighbor) Here is a code of child adding method: private void AddChild(BitmapSource image) The important thing is that both the stackPanel objects has less than 40 children, I checked it in a Live Visual Tree window.Īs I mentioned above I add children to the second panel in code, every child is an Image control with a Source property set. I think it's very strange behaviour for such a simple. We can see, that first panel loads UI thread much more because of a bit expensive layout and code operations, but it has a stable 60 fps the second panel, which is created in code loads UI thread much less than the first panel scrolling, but nevertheless it drops a framerate down to 30 as it woulld be locked at 30 fps. The first panel scrolling is at the left part of profiling screenshot, the second panel - at the right. Here is a Profiler screenshot which, I hope, shows all important info. Private void UpdateFrameworkElement(FrameworkElement element, Size availableSize, Rect finalRect) / Updates layout of FrameworkElement object UpdateFrameworkElement(ScrollOwner, RenderSize, new Rect(RenderSize)) HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled VerticalScrollBarVisibility = ScrollBarVisibility.Disabled, UpdateFrameworkElement(ItemsOwner, RenderSize, new Rect(RenderSize)) VirtualizingPanel.SetVirtualizationMode(ItemsOwner, VirtualizationMode.Recycling) VirtualizingPanel.SetCacheLength(ItemsOwner, new VirtualizationCacheLength(2)) VirtualizingPanel.SetCacheLengthUnit(ItemsOwner, VirtualizationCacheLengthUnit.Item) VirtualizingPanel.SetIsVirtualizing(ItemsOwner, true) ![]() The creation code: private void InitializeItemsOwner() The only one thing(that I know) they are different is that the first is created with xaml and is a ListView.ItemsPanelTemplate and is managed by ItemSource property of ListView the second panel I created manually in code, manually set it as a Content of manually created ScrollViewer object and manually add every child to this panel. So, I have two VirtualizingStackPanel, they both use a DoubleAnimation for smooth scrolling. I am very confused, I see that UI thread is almost not loaded, timeline profiling tells me that my fps should be at least equal to 60, but the real fps unstable.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |