Weird artifacts Screen Distortions - MegaMek/megamek GitHub Wiki

Weird artifacts/Screen Distortions

You can try one of these solutions. Adding the following flags in the Megamek.l4j.ini and Mekhq.l4j.ini file.

-Xmx2048m -Dsun.java2d.d3d=false

-or-

-Xmx2048m -Dsun.java2d.opengl=true

For systems with 16 Gig

-Xmx4096m -Dsun.java2d.d3d=false

-or-

-Xmx4096m -Dsun.java2d.opengl=true

Systems with 32 gig of memory should safely be able to go to

-Xmx8192m -Dsun.java2d.d3d=false

-or-

-Xmx8192m -Dsun.java2d.opengl=true


For MegaMekLab issues add the following to the MegaMekLab.l4j.ini

-Xmx1024m -Dsun.java2d.d3d=false

-or-

-Xmx1024m -Dsun.java2d.opengl=true


If you still have issues with UI Scaling some players have reported success adding

-Dsun.java2d.uiScale=1


Some users of the Flat themes (highlighted in red) might encounter scaling issues in programs like MegaMekLab and MekHQ.

If you experience scaling problems similar to the screenshot below, you will need to adjust the configuration files (MegaMek.l4j.ini, MegaMekLab.l4j.ini, and MekHQ.l4j.ini).

Scaling issue screenshot

To resolve the scaling issue, add the following line to the bottom of each configuration file using a text editor:

-Dflatlaf.uiScale=1.0

For example, after adding the line to the MekHQ.l4j.ini file, it should look like this:

MekHQ.l4j.ini example

This adjustment should help correct the scaling issues.