Skip to content

Commit 056d34c

Browse files
committed
Model viewer: fix flickering
1 parent d89fc86 commit 056d34c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cake-model-viewer/src/main/kotlin/org/demoth/cake/modelviewer/Lwjgl3Launcher.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ private val defaultConfiguration: Lwjgl3ApplicationConfiguration
2323
configuration.useVsync(true)
2424
//// Limits FPS to the refresh rate of the currently active monitor.
2525
configuration.setForegroundFPS(Lwjgl3ApplicationConfiguration.getDisplayMode().refreshRate)
26+
// increase depth buffer precision 16 -> 24 to avoid polygon flickering
27+
configuration.setBackBufferConfig(8, 8, 8, 8, 24, 0, 0)
2628
//// If you remove the above line and set Vsync to false, you can get unlimited FPS, which can be
2729
//// useful for testing performance, but can also be very stressful to some hardware.
2830
//// You may also need to configure GPU drivers to fully disable Vsync; this can cause screen tearing.

0 commit comments

Comments
 (0)