Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Broken widget frames, and poor FPS after set commits #4722

Closed
wzdev-ci opened this issue Jan 28, 2018 · 34 comments
Closed

Broken widget frames, and poor FPS after set commits #4722

wzdev-ci opened this issue Jan 28, 2018 · 34 comments

Comments

@wzdev-ci
Copy link
Contributor

resolution_fixed type_bug | by Prot


In our circle have noticed bad FPS somewhere between versions 3.2.1 and 3.2.3, I decided to investigate it.
I found this series of commits that break frame widgets and degrade performance.
Starting from commit:a6017da6a838ba17630a629d6c3c8c4483c09ccc - is broke widgets, and have some loss FPS at NVIDIA Cards.
Ending with commit:ae2e4c0e23d824dee6dde7464237fb854aa24ec7 - even worse performance.
After this, still problem not fixed. Now we have a bad performance and broken frames of widgets.
Screenshots and details will make in the forum.


Issue migrated from trac:4722 at 2022-04-16 13:01:20 -0700

@wzdev-ci
Copy link
Contributor Author

@wzdev-ci
Copy link
Contributor Author

Per changed blocking which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

Per changed blockedby which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

Per commented


What NVidia card do you have, what driver version, what platform (linux/windows), and what FPS results do you get?

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jan 28, 2018

Prot commented


Replying to Warzone2100/old-trac-import#4722 (comment:2):

What NVidia card do you have, what driver version, what platform (linux/windows), and what FPS results do you get?
I tested only on Windows 10, Debian 8 and Arch linux, no Mac OS.
Cards: Nvidia 440 GT, Nvidia 680 GTX, AMD Radeon R7 M260DX
Now will add screenshots from windows 10 on forum.

@wzdev-ci
Copy link
Contributor Author

Forgon uploaded file ticket_4722_1ce7e09ba.png (459.7 KiB)

screenshot after last working commit 1ce7e09bab668d06022fdae33c4132043658bbc
ticket_4722_1ce7e09ba.png

@wzdev-ci
Copy link
Contributor Author

Forgon uploaded file ticket_4722_a6017da6a.png (416.9 KiB)

screenshot after first faulty commit a6017da6a838ba17630a629d6c3c8c4483c09ccc with widget frames broken
ticket_4722_a6017da6a.png

@wzdev-ci
Copy link
Contributor Author

Forgon uploaded file ticket_4722_ae2e4c0e2.png (416.8 KiB)

screenshot after second faulty commit ae2e4c0e23d824dee6dde7464237fb854aa24ec7 with fps reduced from 60 to 50
ticket_4722_ae2e4c0e2.png

@wzdev-ci
Copy link
Contributor Author

Forgon uploaded file ticket_4722_c89320c2d.png (395.7 KiB)

screenshot of most recent commit c89320c2d5ef7bb2262ce3e2659cdd58e2fb2000 with fps slightly lowered from 50 to 47
ticket_4722_c89320c2d.png

@wzdev-ci
Copy link
Contributor Author

Forgon commented


I reproduced the problem with ArchLinux using the integrated graphics card of the Intel i5-2540M processor powered by Mesa 17.3.3.2. Results:

commit 1ce7e09bab668d06022fdae33c4132043658bbc:
60 fps (see attached image [raw-attachment:ticket_4722_1ce7e09ba.png])

commit a6017da6a838ba17630a629d6c3c8c4483c09ccc:
60 fps with widget frames broken (see attached image [raw-attachment:ticket_4722_a6017da6a.png])

commit ae2e4c0e23d824dee6dde7464237fb854aa24ec7:
50 fps (see attached image [raw-attachment:ticket_4722_ae2e4c0e2.png])

commit c89320c2d5ef7bb2262ce3e2659cdd58e2fb2000:
47 fps (see attached image [raw-attachment:ticket_4722_c89320c2d.png])

@wzdev-ci
Copy link
Contributor Author

Per commented


Is this fixed with the high-dpi build?

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg commented


Nope. These two commits are the ones causing the performance loss: a6017da6a838ba17630a629d6c3c8c4483c09ccc and ae2e4c0e23d824dee6dde7464237fb854aa24ec7.

@wzdev-ci
Copy link
Contributor Author

Per commented


To those who still have performance issues - are you CPU bound or GPU bound?

To tell which it is - try looking at 'top' (on linux) or performance monitor (windows), to see if you are at 100% CPU on the process running Warzone. If you are at 100% CPU on that process, then you are likely CPU bound. Otherwise you are GPU bound.

Also, make sure you turn vsync off if you cannot reach 60 fps.

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg changed _comment0 which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg commented


Apparently I am GPU bound and I never have vsync on. It only really is slightly noticeable when the reticule research menu is open.

Edit:
I just noticed that the only widget that displays the black borders correctly is the results screen you see. Like on the win/lose scenario in a campaign mission.

@wzdev-ci
Copy link
Contributor Author

Prot commented


Also flying black pixels at the top left, it is corners of minimap, if you try to resize minimap then you see how those pixels moves too.
high-dpi build - just boost graphics what we have now, if not for these commits a6017da6a838ba17630a629d6c3c8c4483c09ccc and ae2e4c0e23d824dee6dde7464237fb854aa24ec7 i think we would have had a double boost FPS.

@wzdev-ci
Copy link
Contributor Author

Forgon changed priority from normal to blocker

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 7, 2018

Forgon uploaded file widget_borders.patch (1.7 KiB)

patch file created with git format-patch

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 7, 2018

Forgon commented


The missing window borders are caused by erroneous calls to the functions 'iV_DrawImageRepeatX()' and 'iV_DrawImageRepeatY()', both of which are declared in './lib/ivis_opengl/pieblitfunc.h'.

The errors had been introduced in commit a6017da6a838ba17630a629d6c3c8c4483c09ccc.

Please try my attached patch and improve on it if you can.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 7, 2018

pastdue commented


@forgon: Fantastic catch!

Here's a (smaller) patch that fixes the root cause of the issue:
https://patch-diff.githubusercontent.com/raw/Warzone2100/warzone2100/pull/148.patch

In the definition of RenderWindowFrame, the modelViewProjection matrix was defaulting to glm::mat4().
It needs to default to defaultProjectionMatrix().

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 7, 2018

Berserk Cyborg commented


Replying to Warzone2100/old-trac-import#4722 (comment:12):

Here's a (smaller) patch that fixes the root cause of the issue
Works for me.

Replying to Warzone2100/old-trac-import#4722 (comment:9):

Also flying black pixels at the top left, it is corners of minimap, if you try to resize minimap then you see how those pixels moves too.

I thought it was only one little triangle when it is in fact an outline matching the dimensions of the mini-map.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 7, 2018

Berserk Cyborg uploaded file pixel.png (803.9 KiB)

pixel.png

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 7, 2018

Berg commented


I think the black border is the no go part of the warzone map its a area on the edges of the map that you cant build on or drive on

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 8, 2018

Forgon changed _comment0 which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 8, 2018

Forgon commented


Replying to Warzone2100/old-trac-import#4722 (comment:13):

Replying to Warzone2100/old-trac-import#4722 (comment:12):

Here's a (smaller) patch that fixes the root cause of the issue
Works for me.

Replying to Warzone2100/old-trac-import#4722 (comment:9):

Also flying black pixels at the top left, it is corners of minimap, if you try to resize minimap then you see how those pixels moves too.

I thought it was only one little triangle when it is in fact an outline matching the dimensions of the mini-map.

This is the mini map border, which is drawn in the wrong place since commit a6017da6a838ba17630a629d6c3c8c4483c09ccc.

It is visible with my patch (see attached image [raw-attachment:minimap_border_error.png]), but not with your patch.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 8, 2018

Forgon uploaded file minimap_border_error.png (406.5 KiB)

minimap border drawn in wrong location
minimap_border_error.png

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 8, 2018

pastdue changed _comment0 which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 8, 2018

pastdue commented


@forgon: Then there's a remaining call to RenderWindowFrame that is passing in an incorrect modelViewProjection matrix. The culprit looks to be in DrawRadarExtras. Try removing modelViewProjectionMatrix from the call to RenderWindowFrame inside DrawRadarExtras. (Am not able to test right now.)

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 9, 2018

pastdue commented


To all: Please see the updated patch at: https://github.com/Warzone2100/warzone2100/pull/148.patch

This also fixes the drawing of the radar frame corners, which weren't respecting the input modelViewProjectionMatrix.

@wzdev-ci
Copy link
Contributor Author

past-due <30942300+past-due@...> changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

past-due <30942300+past-due@...> changed owner from `` to past-due <30942300+past-due@users.noreply.github.com>

@wzdev-ci
Copy link
Contributor Author

past-due <30942300+past-due@...> changed resolution from `` to fixed

@wzdev-ci
Copy link
Contributor Author

past-due <30942300+past-due@...> committed [1]


In Warzone2100/warzone2100@1a1b075:

#CommitTicketReference repository="" revision="1a1b0750506b663055f71f856c1079ba576b8a14"
fixes #4722: fix drawing of widget borders

Co-Authored-By: Forgon2100 <forgon2100@users.noreply.github.com>

@wzdev-ci
Copy link
Contributor Author

past-due <30942300+past-due@...> commented


In Warzone2100/warzone2100@fedcb22:

#CommitTicketReference repository="" revision="fedcb22aec21387ce4ea4c64bf9453e5183fc3ef"
fixes #4722: Frame corners should respect the input modelViewProjectionMatrix

This fixes the drawing of the radar frame corners.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant