-
Notifications
You must be signed in to change notification settings - Fork 0
DPI awareness, monitor geometry
If you play GAMMA/Anomaly on macOS through Wine the game may look a bit wrong even when the in-game and display resolution are set to 1920x1080. Weapon HUD position, lighting, scopes, night vision, blur, bloom, SSAO, and other screen-space effects can shift because Wine may expose a different effective display geometry than the one you think you are using.
The problem is most apparent if you use an app like BetterDisplay to handle your external display - if set to 1080p HiDPI - internally that may involve a larger backing resolution or different scaling path. Wine can then report display size, DPI, or Retina/backing behavior in a way that does not match the intended 1920x1080 game setup.
The X-Ray engine does not reason in such terms. It consumes the Windows/D3D values Wine gives it.
The important chain is:
Wine/macOS display state
-> Windows monitor/window/D3D values
-> Device.dwWidth / Device.dwHeight
-> Device.fASPECT
-> scene projection, HUD projection, screen-space shader constants
Force Wine to behave like a plain 1080p Windows display regardless of the resolution used to not rely on auto-detection:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Wine\Mac Driver]
"RetinaMode"="n"
[HKEY_CURRENT_USER\Control Panel\Desktop]
"LogPixels"=dword:00000060
"Win8DpiScaling"=dword:00000000
Gamma Setup Tool exposes this setting on wrapper creation.
Camera aspect is derived from device dimensions and then rebuilds both scene and HUD projection matrices in CameraManager.cpp
That means a bad display/backbuffer interpretation can affect both the world camera and the first-person weapon/HUD camera.
-
Weapon HUD positioning is affected because HUD item transforms use Device.fASPECT, then convert HUD space to world space: src/xrGame/HudItem.cpp
-
HUD/world conversion depends on projection matrices: src/xrEngine/device.h
-
Render passes also receive screen size and inverse screen size from Device.dwWidth / Device.dwHeight: src/Layers/xrRenderPC_R3/r3.cpp
-
Volumetric lighting uses Device.dwWidth / Device.dwHeight for viewport sizing: src/Layers/xrRender/lights_render.cpp
Relevant shader and script examples: /shaders/r3/models_lfo_light_dot_weapons.ps /shaders/r3/night_vision.h /shaders/r3/scope_common.h /scripts/dialog_fov.script