PadWorld-Entertainment / worldofpadman

World of PADMAN game repository
https://worldofpadman.net
Other
39 stars 9 forks source link

MENU: Selecting antialiasing or anisotropy of 2x shows antialiasing or anisotropy of 4x after selection and vid_restart #136

Closed kai-li-wop closed 2 years ago

kai-li-wop commented 2 years ago

If antialiasing of 2x is selected in the menu in the graphics settings, after vid_restart the value 4x is shown as selected in the menu instead of 2x. However, the value of the variable r_ext_multisample is set to 2 as desired. The problem besides the incorrect display is also that the user can no longer set a value of 4 for r_ext_multisample via the menu afterwards, because selecting 4x again is not recognized as a change.

The absolute same issue applies to selecting Anisotropy of 2x!

Steps to reproduction:

  1. Go to the graphics options
  2. Set antialiasing/anisotropy to 2x
  3. Click Accept to restart
  4. Then go to the graphics options again
  5. Antialiasing/anisotropy is set to 4x instead of 2x

This is independent of the changes in 55cd12ff4b56b8dbb853708199b2b041c3a32290 (#135 )

Basically, the setting via the menu works flawlessly, because the following values are reached by selection: Antialiasing Off --> r_ext_multisample 0 Antialiasing 2x --> r_ext_multisample 2 Antialiasing 4x --> r_ext_multisample 4 Antialiasing 8x --> r_ext_multisample 8

Same for anisotropy.

Further information:

The function ceil in combination with the function sqrt is used for both options and therein lies the problem. sqrt of 2 leads to a value of 1.41, which is rounded up to 2 with the function ceil, which leads to the wrong display of "4x". But here a value of 1 is needed, which would lead to the correct display of "2x". Another solution must be found here. For the other selection options of 4x and 8x the existing solution leads to a correct display.

kai-li-wop commented 2 years ago

Another problem I just found in this context is that a selected value for Anisotropy after a complete restart of WoP (not "vid_restart"!) causes the selected value in the graphics settings to always be reset to "Off". This problem can be traced back to the fact that "r_ext_anisotropy" instead of "r_ext_max_anisotropy" is tried to be read for the current state of the graphics option. "r_ext_anisotropy" does not exist.

kai-li-wop commented 2 years ago

Both issues should be fixed with 0381b4f02deca4ac39810d2eed829c8023314672

3aTmE commented 2 years ago

I could replicate the issues with version 1.6.2 with the steps given. After building from source this issue does not appear any more! 👍 Seems to be fixed now!